Localization with i18n - Default language?
Hi guys,
I'm localizing my app with this blog post
So how do I set the "fallback" (= default) language? I have a German and an English file, but if I set the Simulator's language to Spanish, the app defaults to German (should be English). How do I set the default language if the right i18n file does not exist?
Thanks for your help!
5 Answers
-
Felix
See Getting a localized string for an example of using the hint text parameter when no key exists.
Cheers
-
I could use some help on this too. What if the app is in two languages (dutch and french) and the device is in English. Is there a way to let the user select which is their preferred language?
If the language is not found it automatically uses french - since "fr" comes before "nl" in alphabetical sorting or something, a stupid way to fall back!!
The only solution I have found so far is:
- Create your i18n xml files
- Choose your default language
- copy the default language with a language code that comes first in the alphabet (I think it must be an existing code, like "aa" or something)
-
Any one find a solution ??
-
Anybody have an update or solution on this?
To set the "Localization native development region" to English in the plist doesn't help :( -
Answers above no longer apply, in Titanium alloy the folder that the language files go to is compiled from i18n to en.lproj and from strings.xml into Localizable.strings, therefore all that code above just breaks bcs the titanium XML parser can not parse the .strins file anymore.