ios-Build Internationalization Pack-configure app multi-language support

Source: Internet
Author: User

Tags: ios internationalization iOS multi-language support Xcode multi- language support Xcode build multi -language internationalization it Category: Functional knowledge
If your app needs support for multiple languages. Then, you should add "internationalization" support for your app app. "Internationalization" at first glance is very advanced. In fact, Apple Xcode has been set up for us, we just need to simple configuration, we can complete. "Internationalization" as its name implies, is to allow people in countries to use your app to display the native language of their users. There are many such posts on the web, but Xcode is evolving and many things have moved or become easier. In this way, we can no longer look at the old posts. Not much nonsense! The internationalization language pack is generated under XCode 5.0. 1. Create an Internationalized language file: The file name must be: Localizable.strings

2. Select the Localizable.strings file, and in Utilites, click the localizable option



3. Create an English language pack. After creation, your localizable.strings file will be hung in the English language support file.
4. Add additional multi-lingual support as needed.


Click Finish directly.
In fact, we should note that in the Plish file, the default language pack is switched.

Add language support. Let's take my file as an example: in Localizable.strings (Chinese (Simplified)), add the following code:

"Play" = "play";

In Localizable.strings (中文版), add the following code:

"Play" = "play";

Other, identical ... Use language support

NSString *strplay = nslocalizedstring (@ "Play", @ "");

[Self.btnplay Settitle:strplay Forstate:uicontrolstatenormal];

get the language of the current device

Get user default information

Nsuserdefaults *defaults = [Nsuserdefaults standarduserdefaults];

Get all the language settings supported by the IPhone

Nsarray *languages = [defaults objectforkey: @ "Applelanguages"];

NSLog (@ "%@", languages);

Get the current iphone language

nsstring* currentlanguage = [languages objectatindex:0];

NSLog (@ "Current language:%@", currentlanguage);

ios-Build Internationalization Pack-configure app multi-language support

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.