Category Archives: Apps

Apps worth to annouce to the world

iOS9 localization and Internationalization

 

https://developer.apple.com/library/ios/technotes/tn2418/_index.html

Language Identifiers in iOS 9

With iOS 9, the results returned by NSLocale.preferredLanguages() can differ from previous releases. In iOS 8 and earlier, only certain language, script, and region combinations were returned by this API. However, in iOS 9, more combinations of language, script, and region are permitted.

For example, when a user has configured their iOS device with language set to English and region set to India, NSLocale.preferredLanguages() will now return [ "en-IN" ], instead of [ "en" ]. This allows for smarter language fallbacks; for this user, if an app doesn’t support en-IN as a localization, but does support en-GB, the fallback mechanism will select en-GB instead of en.

These implicit fallbacks are not always obvious from the language identifier; they are driven by locale data used by NSBundle’s resource-loading mechanism. Trying to handle language identifiers manually, or performing string comparisons on them, will lead to problems. Instead, rely on NSBundle APIs when loading resources or matching language identifiers to an available set of languages.

 

 

http://www.tuicool.com/articles/zER7Zvb

 

关于iOS项目的国际化,之前有写过一篇文章,不过不是很系统,也有不少纰漏,还特地写过一篇填坑文,但是因为太坑了,所以不了了事。这段时间又踩了不少坑,也啃了啃官方的文档,特此整理10条Tip,有一些问题不会经常遇到,有些细节也很容易被忽略,不过大部分应该还是很有用的!
如果你之前对iOS的国际化一无所知,推荐看一下这篇文章,很精炼也很完整——