Reputation: 351
I am hoping to support both Traditional and Simplified Chinese in my app, but have not been able to make the app work with Language-Region pairs (such as es-AR, es-MX, es-ES).
In the Mac Dev Library's Internationalization Programming Topics, under Language and Locale Designations, I find the following:
Important: In iOS, the bundle interfaces do not take dialect or script information into account when looking for localized resources; only the language designator code is considered. Therefore if your project includes language-specific project directories with both a language and region designator, those directories are ignored. The bundle interfaces in OS X do support region designators in language-specific project directories.
link to Internationalization Programming Topics
So, I'm thinking that I can't support two versions of Chinese.
Is this correct? It seems strange that Apple wouldn't provide a mechanism for this.
Upvotes: 1
Views: 1718
Reputation: 351
If I use the following localization structure:
...project/Resources/Locales/en.lproj/Localizable.strings
...project/Resources/Locales/es-MX.lproj/Localizable.strings
...project/Resources/Locales/es-AR.lproj/Localizable.strings
...project/Resources/Locales/es-ES.lproj/Localizable.strings
and drag the Localizable.strings into my project, it will show me the regional variants as being available, but iOS will ignore them - which is what is described in the apple documentation. Setting the device to Spanish will default to English.
I need to provide a default Spanish localization:
...project/Resources/Locales/es.lproj/Localizable.strings
So, for the Chinese variants:
...project/Resources/Locales/zh-Hans-CN.lproj/Localizable.strings
...project/Resources/Locales/zh-Hant-TW.lproj/Localizable.strings
The app will not differentiate between regions.
If, however, I use the following:
...project/Resources/Locales/zh-Hans.lproj/Localizable.strings
...project/Resources/Locales/zh-Hant.lproj/Localizable.strings
The app can differentiate between Simplified and Traditional Chinese. It seems that zh-Hant and zh-Hans are treated as different languages, and not as regional variants. Appending the CN and TW to them results in them being regional variants and ignored by iOS.
Upvotes: 2
Reputation: 4404
I'm not sure of what you're talking about with Mac OS, but at least my apps on iOS (iPhone and iPad) are localized to both Chinese Simplified and Traditional.
This is in the "Project" section of the app, and on the strings.
Is this what you're talking about?
Upvotes: 0