Titanium JIRA Archive
Alloy (ALOY)

[ALOY-518] Add support for internationalized strings in view XML files

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-07-11T18:12:59.000+0000
Affected Version/sn/a
Fix Version/sAlloy 1.2.0, 2013 Sprint 14
ComponentsXML
Labelsqe-testadded
ReporterJeff English
AssigneeTony Lukasavage
Created2013-02-14T13:28:47.000+0000
Updated2013-07-29T21:03:10.000+0000

Description

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.

Comments

  1. Tony Lukasavage 2013-02-14

    Giving this ticket a large estimate since I will likely create a localization test app to go along with it
  2. Tony Lukasavage 2013-07-11

    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
  3. Federico Casali 2013-07-29

    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.

JSON Source