4 Replies Latest reply on Oct 5, 2006 9:34 AM by nated

    English / Spanish Toggle

      I would like to show a toggle button "English" and "Spanish" and have the user click to show the appropriate language, no matter what page they're on. Are there any gurus out there that would know the best way to approach this?

      Sincere thanks.
        • 1. Re: English / Spanish Toggle
          Randy64 Level 1
          Non-guru answers welcome as well...
          • 2. Re: English / Spanish Toggle
            nyfeman Level 1
            You could have a view stack of pages comprised of your mirrored pages, then the appropriate link button could make the appropriate view visible.

            That'd probably be easiest.

            • 3. Re: English / Spanish Toggle
              inlineblue Level 1
              You can use binding for all your labels. It's not too complicated, but could be a lot of work. You have to store all your text inside language-specific objects and then have the labels in your app bind to these language objects. For example:

              //Define the label text in each language
              private var englishLabels: Object = {button1Label:"<eng label>", button2Label:"<eng label>"};
              private var spanishLabels: Object = {button1Label:"<esp label>", button2Label:"<esp label>"};

              private var labels: Object; //All your components will bind to this

              <mx:Button id="button1" label="{labels.button1Label}"/>
              <mx:Button id="button2" label="{labels.button2Label}"/>

              At runtime, you can then set "labels = spanishLabels" and all your labels will change to Spanish.
              • 4. Re: English / Spanish Toggle
                nated Level 1
                My vote would go to a ViewStack. An alternative would be using view states. Depending on if you're using the Flex 2 SDK or Flex Builder, it may even be easier. I'm not much on the up&up of creating view states in the SDK, so it'd be hard for me to do that. But with Flex Builder, you don't have to do any of the coding to edit a view state, so it's a whole lot easier.