[ALOY-1068] Runtime error if Label's text attribute starts with L() alias in quotes
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-07-18T19:30:35.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Alloy 1.5.0 |
Components | I18N, XML |
Labels | alloy, i18n, label, qe-manualtest, view, xml |
Reporter | Feon Sua Xin Miao |
Assignee | Feon Sua Xin Miao |
Created | 2014-07-02T14:58:25.000+0000 |
Updated | 2014-08-25T18:28:33.000+0000 |
Description
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] : }
Comments
- Feon Sua Xin Miao 2014-07-07
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)
- Tim Poulsen 2014-07-17
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'<Alloy> <Window> <Label text="L(foo)" /> <Label text="L('foo')" /> <Label textid="foo" /> </Window> </Alloy>
- Feon Sua Xin Miao 2014-07-18 Updated PR, now all three usage mention above will output the i18n string value for the key 'foo'.
- Tim Poulsen 2014-07-18 Works as expected, PR merged.
- Ewan Harris 2014-08-25 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.