problem
Internationalized strings can currently be specified in .js and .tss files, but NOT the .xml files for the view. This forces the UI designer to define an 'id' for each control in order for the internationalized string to be set in the .tss file.
Index.xml file
<Button id="ApplyButton"/>
index.tss file
"#ApplyButton": {
title: L('ApplyBtnLbl')
}
Add the ability to specify internationalized strings in the view's .xml file
index.xml file
<Button title: L('ApplyBtnLbl') />
also...
A localization test app would be beneficial for developers. Even though it is very similar to how it is done with Titanium, it'll be good for devs to have an explicit example of how to do it.
Giving this ticket a large estimate since I will likely create a localization test app to go along with it
PR: https://github.com/appcelerator/alloy/pull/174 test app: https://github.com/appcelerator/alloy/tree/master/test/apps/advanced/localization Functional test can be confirmed on all supported platforms with the following steps: 1. Make sure your sim/emulator/device is set to "english" as its language 2. Run the app 3. Make sure the app reads "Hello, world!" for all 3 headings in the main window. The first attached image should what the english version should look like. Prior to resolving this ticket, the text under the "via XML attribute" header would have read "L('hello_world')" 4. With this behavior confirmed, leave the app and force it to shut down. Go to your sim/emulator/device's settings and change the language to Spanish. 5. Run the app again and ensure that you get 3 "Hola Mundo" messages this time. *NOTE:* Only English (en) and Spanish (es) are supported in this app
Verified as working as expected. Titanium SDK 3.1.2.v20130726192706 Alloy 1.2.0-alpha Appcelerator Studio 3.1.3.201307252418 CLI 3.1.2 Node 0.8.22 Closing.