Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1067] Support L() in XML as Label text

GitHub Issuen/a
TypeImprovement
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2014-08-22T14:40:38.000+0000
Affected Version/sn/a
Fix Version/sAlloy 1.5.0
ComponentsI18N, XML
Labelsalloy, i18n, label, qe-manualtest, view, xml
ReporterFeon Sua Xin Miao
AssigneeFeon Sua Xin Miao
Created2014-07-02T14:42:20.000+0000
Updated2014-08-28T23:05:20.000+0000

Description

For following view, L() should work if we've set foo equal to some string in i18n. Now it prints out L('foo') instead
<Window>
    <Label>L('foo')</Label>  <!-- this print out L('foo') instead of treating it as L() -->
</Window>

Comments

  1. Malcolm Hollingsworth 2014-07-02

    Question of author only, not suggesting you are doing anything wrong; Rather than;
       <Label>L('foo')</Label>
       
    Why not;
       <Label textid="foo" />
       
  2. Tim Poulsen 2014-07-02

    [~core13] It's for parallelism as well as to match functionality being worked on for the linked ticket. Expectations are that these work:
       <Label>My label text here</Label>
       <Label text="L('foo')"></Label>
       
    So by extension this should work:
       <Label>L('foo')</Label>
       
  3. Malcolm Hollingsworth 2014-07-02

    Tim - I know all that, I was asking a specific question of the author - as noted "Question of author only, not suggesting you are doing anything wrong;" I was simply asking for an opinion of the author only - to find out if there was a reason one way over the other as different people have different reasons . If you are not convinced I know this stuff Tim - we need words my old friend.
  4. Feon Sua Xin Miao 2014-07-03

    [~core13], my opinion was the same as what [~skypanther] has clearly explained above. :)
  5. Feon Sua Xin Miao 2014-07-07

    PR: https://github.com/appcelerator/alloy/pull/473 Test app: https://github.com/feons/alloy/tree/ALOY-1067/test/apps/testing/ALOY-1067 Functional Test: 1. Run test app on iOS 2. For <Label>L('foo')</Label> locale string is displayed.
  6. Tim Poulsen 2014-07-09

    PR merged
  7. Tim Poulsen 2014-08-22

    PRs merged
  8. Federico Casali 2014-08-22

    Test Case verified and updated. TiSDK 3.4.0.v20140820125714 Appcelerator Studio 3.4.0.201408201526 CLI 3.4.0-dev Alloy 1.5.0-dev Xcode6-beta5 iPhone 5 iOS 7.1.2, Nexus Galaxy 4.3 and Mobileweb Closing.

JSON Source