6 Replies Latest reply on Feb 5, 2009 3:16 AM by mahlaoui

    Right to left languages in flex 3

    elixir_adeel
      i have a problem in displaying arabic text in Alert.show method of flex 3 so kindly tell me the procedure of displaying arabic text in flex 3
      thanks
        • 1. Re: Right to left languages in flex 3
          Gregory Lafrance Level 6
          Flex 3 has support for RTL languages, but in some cases, as you obviously have found, it does not work as it should. Someone else may have better info, but I think you will have to write custom code until Flex 4, where I believe there will be some improvement.
          • 2. Re: Right to left languages in flex 3
            elixir_adeel Level 1
            thanks
            can you help me getting arabic text from locale property file
            • 3. Re: Right to left languages in flex 3
              Gregory Lafrance Level 6
              1) Create a file named MainApp.resources and place it in a folder locale/ar_AE, where the locale folder is a sub-folder of the folder containing your main application mxml file. Before you put Arabic text in the file, change its encoding to UTF-8 by right clicking, properties.

              2) Put this string in the .properties file: Hello=مرحبا

              3) Make a copy of the following folders and rename the copied en_US folder to ar_AE:

              C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\frameworks\locale\en_US

              C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\frameworks\projects\framework\bundles\en_US

              4) Select Project-Properties from FB menu, click on Flex Build Path, click the Source Path tab, click Add Folder, and add this: "C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\frameworks\projects\framework\bundles\ar_AE\src"

              5) Select Project-Properties from FB menu, click on Flex Build Path, click the Source Path tab, click Add Folder, and add this: src/locale/ar_AE

              6) Select Project-Properties from FB menu, click on Flex Compiler and add this -locale ar_AE

              7) Add this code, compile, and you should be good to go:

              <?xml version="1.0"?>
              <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml">
              <mx:Script>
              <![CDATA[
              import mx.resources.ResourceBundle;
              import mx.controls.Alert;
              private function clickHandler():void{
              Alert.show(resourceManager.getString('MainApp','Hello'));
              }
              ]]>
              </mx:Script>
              <mx:Metadata>
              [ResourceBundle("MainApp")]
              </mx:Metadata>

              <mx:Button label="@Resource(key='Hello', bundle='MainApp')"
              click="clickHandler()" fontSize="16"/>
              </mx:Application>

              • 4. Re: Right to left languages in flex 3
                elixir_adeel Level 1
                i have already done all this but it display arabic words into separate letters not in joined form so please tell how to correct it
                thank you
                • 5. Right to left languages in flex 3
                  Gregory Lafrance Level 6
                  That is probably an example of where Flex is lacking in support for RTL languages. To correct this, you've got some non-trivial custom coding to do. I have not attempted this.
                  • 6. Re: Right to left languages in flex 3
                    mahlaoui
                    Hi
                    If the arabic text appear in separate char you have to enable arabic as the main language for reading documents in your PC.