1 - Use this module to force language change, it'll load correct strings link
2 - Add android:supportsRtl="true"
to tag in tiapp.xml
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>
<application android:supportsRtl="true" />
</manifest>
</android>
3 - Use if in .tss file to switch RTL & LTR
// alloy.js
Alloy.Globals.isRTL = Ti.Locale.currentLanguage === 'ar';
'#exampleLabel' : {
color: ‘red'
}
'#exampleLabel[if=Alloy.Globals.isRTL]' : {
right: 5
}
'#exampleLabel[if=!Alloy.Globals.isRTL]' : {
left: 5
}
4 - Set iOS 9+ is minimum in tiapp.xml
<?xml version="1.0" encoding="UTF-8"?>
<ti:app xmlns:ti="http://ti.appcelerator.org">
<ios>
<min-ios-ver>9.0</min-ios-ver>
</ios>
</ti:app>
5 - Set Android 4.2 as minimum
<?xml version="1.0" encoding="UTF-8"?>
<ti:app xmlns:ti="http://ti.appcelerator.org">
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest android:versionCode="17">
<uses-sdk android:minSdkVersion="17"/>
</manifest>
</android>
</ti:app>
- LeftNavButton & RightNavButton
- Default ListView/TableView templates
- Window open transition come from right with RTL and left with LTR
- CollectionView list items from top right with RTL and top left with LTR
- ActionBar and menus items flip RTL/LTR with zero code
- Drawer layout come from right instead of left
- linearlayout (horizontal/vertical layout) will not flip, Titanium calculate positions manually, same with autolayout in iOS. ref
- Natural direction for the text supported nativly in both iOS and Android, while Titanium has only right, left and center allignment. Android iOS
- Titanium has no API to change local, but we can use this module
- Titanium has an issue to re-open the hole UI stack on iOS, so change loal will load strings from the new selected file but will not wich RTL/LTR till you close the app and open it again.