1 Reply Latest reply on Jul 15, 2010 8:02 AM by VRPDeveloper

    Locale Selection Drop Down Menu label

    djh88ukwb Level 1

      Hello all, i am trying to get to grips with Localization with flex,  I have created my own files to be used, (.properties) files, and made a simple application that works.  It uses a dropdownlist to allow the user to select which language to view.


      Here is my code


      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                     xmlns:mx="library://ns.adobe.com/flex/mx" viewSourceURL="srcview/index.html">
              <fx:Date id="currentDate"/>
              <mx:DateFormatter id="df"/>
              <s:ArrayList id="locales">
              @namespace s "library://ns.adobe.com/flex/spark";
              s|Label { font-size:18; }
                  import spark.events.IndexChangeEvent;
                  protected function dropdownlist1_changeHandler(event:IndexChangeEvent):void
                      resourceManager.localeChain = [ locales.getItemAt(event.newIndex) ];
              <s:VerticalLayout horizontalAlign="center" paddingTop="20"/>
          <s:DropDownList dataProvider="{locales}"
          <s:Label id="dateLabel"
                   text="{resourceManager.getString('customStrings','todayItIs')} {df.format(currentDate)}"/>
          <s:Label text="{resourceManager.getString('customStrings','helloWorld')}"/>
          <s:BitmapImage source="{resourceManager.getClass('customStrings','helloFlag')}"/>


      The files used at the moment are "en_US" and "fr_FR" .  THe drop down populates using an array


              <s:ArrayList id="locales">


      However in my dropdown menu it lists en_US and fr_FR, how can i change this to English and French ?  Whilst maintaining the ability to swap the lang files,


      Thanks !