===========================================
Almost the same procedure with localization, except in step 5, simply use 'global' for the locale argument. This will build a multilingual application.
I18n.locale(loc: String): set target locale, 'default', 'global' & arbitary custom locales e.g. 'zh', 'fr', can be used.
I18n.assets(path: String): set the output assets folder, by default it's "assets/i18n". The folder is for storing all locale sensitive resource files.
To set compiler options in NME project, simply add two lines in NMML file, e.g.:
Assume I have original "i18n_work/default/strings.xml" like this:
And the Chinese translation is ready at "i18n_work/zh/strings.xml", like this:
When I target 'zh' locale and build the project, the original haxe code in Main.hx:
will be transformed to (at compile-time):
When I target 'global' locale and build the project, the code will be transformed to:
I18n._str() is a run-time method for accessing the string mapping.
While using 'global' locale, your app will gain the capability of launch-time locale switching. E.g.:
If the desired locale is not supported, then it will fallback to 'default'.
--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/groups/opt_out.
using I18n;
...
textfield.text = "Hello".i18n();
--