IOS Study Notes (12)-iOS Internationalization

Source: Internet
Author: User

The development of mobile applications is more likely to attract more users to the world, which requires the application to be internationalized. Internationalization is actually a multi-language process. This article introduces the internationalization of Xcode4.5 and later, including Internationalization of application names and application content. For versions earlier than Xcode4.5, see.

Internationalized application content

1. Create a resource file named Localizable. strings.



2. In the attribute selector on the right, you can see the multiple buttons Localize:

3. Click the Localize button. If you have not done internationalization, the options are only English. If you have done internationalization, there will be multiple options.


4. Click the Localize button, click the PROJECT root directory, select the PROJECT, and select the INFO tab. At the bottom, we can see Localizations and click "+" to select a language.


5. Check Localizable. strings,
6. First select the Localizable. strings (English) file and add the following content in the corresponding content:

"Language" = "english ";

Select the Localizable. strings (Chinese) file and add the following content:

"Language" = "Chinese ";

7. Use NSLocalizedString to obtain the content

NSLog (@ "% @", NSLocalizedString (@ "language ",@""));

The system identifies Chinese or English based on the language environment of the current device. International Application name

1. Based on the above operations, select InfoPlist. strings.


In InfoPlist. strings (English), add:

CFBundleDisplayName = "English ";

In InfoPlist. strings (Chinese), add:

CFBundleDisplayName = "Chinese ";

2. Why is CFBundleDisplayName?

You can view the key of the Application name by following these steps.

So far, the application name and the application content have been internationalized.

/**

* @ Author Zhang xingye * http://blog.csdn.net/xyz_lmn* iOS entry group: 83702688

* Android Development Group: 241395671

* My Sina Weibo:@ Zhang xingye TBOW*/

Refer:

Http://developer.apple.com/library/ios/#referencelibrary/GettingStarted/RoadMapiOSCh/chapters/InternationalizeYourApp/

Http://www.cnblogs.com/stoic/archive/2012/07/08/2581298.html

Http://blog.csdn.net/tangren03/article/details/8081032

Related Article

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.