1. Use following sample
<Alloy>
<Window>
<Label text="L(foo)" />
</Window>
</Alloy>
2. Build and run
Results in Alloy runtime error.
[ERROR] : Script Error {
[ERROR] : backtrace = "#0 () at file:///Users/fmiao/Library/Application%20Support/iPhone%20Simulator/7.1/Applications/5E942DE7-5E41-4DE0-81EF-D3CB0000304A/ALOY-1052.app/alloy.js:231";
[ERROR] : line = 46;
[ERROR] : message = "Can't find variable: foo";
[ERROR] : name = ReferenceError;
[ERROR] : sourceId = 349641088;
[ERROR] : sourceURL = "file:///Users/fmiao/Library/Application%20Support/iPhone%20Simulator/7.1/Applications/5E942DE7-5E41-4DE0-81EF-D3CB0000304A/ALOY-1052.app/alloy/controllers/index.js";
[ERROR] : }
PR: https://github.com/appcelerator/alloy/pull/472 Test app: https://github.com/feons/alloy/tree/ALOY-1068/test/apps/testing/ALOY-1068 Functional Test: 1. Run test app on iOS 2. No runtime error, and
<Label text="L(foo)" />
should display asL(foo)
Per our discussion, we'll implement the following: Any instance of
L(
will be treated as a trigger to implement the localization functionality. In other words, all three of the following forms should output the i18n string value for the key 'foo'Updated PR, now all three usage mention above will output the i18n string value for the key 'foo'.
Works as expected, PR merged.
Verified fix on: Mac OSX 10.9.4 Appcelerator Studio, build: 3.4.0.201408210941 Titanium SDK build: 3.4.0.v20140813022514 Titanium CLI, build: 3.4.0-dev Alloy: 1.5.0-dev iOS Device 5S (8.0b5) iOS Simulator 7.1 Ran the test app on device and simulator, all the labels display 'foo'. Closing ticket.