2012年8月6日 星期一

Alter app name display

To detect platform locale, use Ti.Platform.locale

iOS locale value:
en - for English
zh-Hant - for Tranditional Chinese
zh-Hans - for Simplified Chinese

iPhone: For renaming your app name you can update info.plist.
Android: You have to add these lines in your tiapp.xml file. The label tag holds the app name.

<android xmlns:android="http://schemas.android.com/apk/res/android">

    <manifest>

            <application android:debuggable="false" android:icon="@drawable/appicon" android:label="YourAppName" >


            </application>  
        </manifest>
</android>

For android, the above not work for app name in chinese.
Ref:
https://wiki.appcelerator.org/display/guides/Internationalization#Internationalization-Internationalizingtheapp%27sname
http://developer.appcelerator.com/blog/2012/02/internationalization-of-app-names.html#appxml

follow these steps:

1. compile and build the project. Duplicate AndroidManifest.xml generated in /build/android directory for later use.

2. create the platform/android/res/values-(language code) directory structure
values-en/
values-zh/

3. create new file strings.xml in these directory, with following content

<?xml version="1.0" encoding="UTF-8"?>

<resources>

    <string name="appname">中文App name</string>

</resources>


4. relocate AndroidManifest.xml, duplicated earlier in step 1 above, to platform/android
5. edit AndroidManifest.xml , change android:label to "@string/appname" (2 replacements)
6. clean and build project again

See also



沒有留言:

張貼留言