Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Created a new javascript file in the root called "localization.js", which contains an array called localDictionary, which is a collection of locales indexed by string (eg localDictionary['en_US']). Each locale is a dictionary object with a lower camel case english representation of each word/phrase (eg. getDirections: "Get Directions"). 
The locale string ("en_US") for the application is set in config.js, and can be retrieved anywhere in the application by calling Titanium.App.Properties.getString('locale'). However, for convenience, the dictionary is added to the facade which should be accessible by every controller in the application. The proper way to implement text anywhere throughout the application is to write app.localDictionary.translatedTextStringKey.

Localization

There's a javascript file in the root called "localization.js", which contains an array called localDictionary, which is a collection of locales indexed by string (eg localDictionary['en_US']). Each locale is a dictionary object with a lower camel case english representation of each word/phrase (eg. getDirections: "Get Directions"). 

...