iOS multi-language alternative mechanism

Source: Internet
Author: User

The recent Iraq book suddenly received some complaints from foreign users, said the book interface has become Chinese, but their system language is not Chinese, is French Russian and Japanese, the book only supports Chinese and English, in the language does not support the system, it should be automatically selected in English, I do not know why will be selected into Chinese, after arduous and difficult to troubleshoot, Finally found the reason, know the iOS multi-language alternative rules.

There are two main factors, one is cfbundledevelopmentregion (one field of Info.plist), and the other is the list of iOS8 new system preferred languages:


IOS8 Languages and regions

In IOS7 and previous versions, the system can only set a language, if the app does not support the language of the system settings, the choice of alternative language rules are:
1. If the app supports English, select English directly
2. If the app doesn't support English, pick one randomly and don't know the rules chosen here. The document says it will choose the language of the Cfbundledevelopmentregion setting, but I have not found it after testing, the system ignores this field directly.

For example, the app supports Chinese and English, and when the system language is not Chinese or English, it will be selected in English. If the app supports Chinese and Japanese, the system language is not Chinese or Japanese and will be randomly selected.

Starting with iOS8, the system language can be set up with a list of languages, depending on the order of the Language list, the rules change:
1. If the language supported by the app is in the list of system languages, select the pre-sorted language on the list of preferences.
2. If the app supports languages that are not in the list of system languages, select by Cfbundledevelopmentregion value, whether or not the app supports English, English is no longer the default alternative language.
For example, the app supports Chinese and English, the value of Cfbundledevelopmentregion is Chinese, when the system language list is [Japanese] or [Japanese, Chinese], the Chinese is selected, and the system language list is [Japanese, English], English is selected.

Apple in the language seems to have a lot of bugs, debugging process appeared a lot of things, such as change and delete language files must clean works otherwise not effective, IOS8 simulator does not recognize the value of cfbundledevelopmentregion, the real machine to recognize, Coupled with the fact that I didn't know iOS8 system language became a list, it took a lot of time to confuse me. In a word, to internationalize, let the app support English, cfbundledevelopmentregion fill in English, should be foolproof.
Reprinted from: http://blog.cnbang.net/tech/2481/

iOS multi-language alternative mechanism

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.