1
votes

The Ti.Locale.getString('label_title') / L('label_title') is giving null on Android Simulator, It is working and giving me the exact title text in iOS though. I am using the Alloy. Could anyone tell what is wrong or is it a bug of Titanium Alloy ?

My resource file is in /i18n/en/strings.xml, it looks like

<resources>
    <string name="labelTitle">Welcome to My App</string>
</resources>

and my login.js looks like

$.headingTitle.text = L("labelTitle");

login.xml looks like

<Alloy>
    <Window class="container">
        <Label id="headingTitle" />
    </Window>
</Alloy>

login.tss is as follows

".container": {
    backgroundColor:"white"
},
"Label": {
    width: Ti.UI.SIZE,
    height: Ti.UI.SIZE,
    color: "#000"
} 

I am using Titanium Studio SDK 3.1.3

I have uploaded the project to google drive as zip Please find below the link

My App

1
Hello @Anand, did you find any solution? - gorodezkiy

1 Answers

0
votes

You should use "textid" instead of "text".

If you want you can use tss files for internationalization :

 "#headingTitle":{
      textid:L('labelTitle'),
    },