Skip to content

Instantly share code, notes, and snippets.

@csemrm
Created December 14, 2013 04:45
Show Gist options
  • Save csemrm/7955779 to your computer and use it in GitHub Desktop.
Save csemrm/7955779 to your computer and use it in GitHub Desktop.
How to write multi-lingual script in Titanium? Step to use: 1. Create a titanium project 2. Update app.js file with my code 3. Create new folder "i18n" in project root directory if not exits 4. Add another folder "like en" your language 5. Add new file string.xml and update my code 6. Now ready to use
var win = Ti.UI.createWindow({
layout : 'vertical',
backgroundColor : '#fff'
});
var aLabel = Ti.UI.createLabel({
text : L('hello'),
});
win.add(aLabel);
win.open();
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<string name="hello">
Welcome to Titanium!
</string>
<string name="welcome">
Welcome to my gist
</string>
</resources>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment