Quantcast
Channel: Adobe Community : Popular Discussions - AIR Development
Viewing all articles
Browse latest Browse all 24121

Localization not working as expected

$
0
0

Hi there,

 

i'm struggling with an AIR 3.6 mobile app that should support several languages (for testing 'de_DE' and 'en_US').

Here is what i do in Flash Builder 4.7:

 

  1. adding resources.properties in ./locale/en_US and ./locale/de_DE with one key 'test' and a translated string in it
  2. adding the folder 'locale/{locale}' in ActionScript Build Path -> Source Path
  3. adding '-locale=de_DE,en_US' in ActionScript Compiler as an additional compiler argument
  4. in source code i add the following ResourceBundle metadata:

          [ResourceBundle("resources")]

         public class Root extends Sprite

 

   5. as a test i use the following code:      

          var sortedLocales:Array = LocaleUtil.sortLanguagesByPreference(["de_DE", "en_US"], Capabilities.languages, "de_DE");

          ResourceManager.getInstance().localeChain = sortedLocales;

          trace("String is: ", ResourceManager.getInstance().getString("resources", "test"));

 

When switching the language on my iPhone 4 from English to German i would expect that the trace shows the German string, but it's always the English one.

Also when i try to force the German language with

           ResourceManager.getInstance().localeChain = ["de_DE"];

 

it shows the English string.

Capabilities.languages shows me that German is supported and when selected it's on 1st place in the list.

I also tried with languages "de" and "en" -> no change

When i check the packaged files for e.g. iOS i see that my 2 resources.properties files are not included and whatever i try they never get into the package.

 

What is missing here or is there a misunderstanding in how the language is chosen ?

Thank you for your help!


Viewing all articles
Browse latest Browse all 24121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>