1 Reply Latest reply on Oct 5, 2007 11:08 PM by Gregory Lafrance

    How to display application in multiple languages

      I am developing a Flex application that needs to be displayed in multiple languages. What would be the best approach to this?
        • 1. Re: How to display application in multiple languages
          Gregory Lafrance Level 6
          Search for these topics in the Flex 2.0.1 help:
          Creating a localized application
          Using localized properties files and ResourceBundle subclasses
          Using the ResourceBundle API

          Basically in Flex 2.0.1 you create a .properties file with your localized strings, and then in your UI you access the localizable strings in the .properties files. For example you might name it strings.properties. When you compile the app you use a locale arg, so the right language strings.properties file is compiled into the SWF.

          The various language strings.properties file is usually placed within a directory structure within your project:

          The entries in the strings.properties file are key=value pairs, such as:
          open_button_label = Open

          and the entries are accessed in your application in MXML as follows:

          <mx:Button id="b1" label="@Resource(key='open_button_label, bundle='strings)" click="whatever()"/>

          You also need to localize the file:
          Flex Builder 2\Flex SDK 2\frameworks\locale\en_US\framework_rb.swc

          Read the help docs as there are other details to know about. In Flex 3.0 localization will be even more flexible.