Ios applications are internationalized and ios applications are internationalized.

Source: Internet
Author: User

Ios applications are internationalized and ios applications are internationalized.

1. program name internationalization:

After creating a project in Xcode, you can find the Localization project on the info tab of the project, and add the international languages that the application needs to support.


 


When you return to the project, you can find in InfoPlist. strings, Main. storyboard (Main. strings) adds corresponding items, while Localizable. if the strings file already exists, the corresponding language version is also added. (By default, the Localizable file in Xcode5 + iOS7 needs to be created, as shown in)


After completing the preceding settings and adding files, you can see the ABC of internationalization of the application.


International Application name (InfoPlist. strings)

Set the display name of the program in the corresponding language in the file of InfoPList. strings in different language versions.

English version
/* Localized versions of Info.plist keys */     CFBundleDisplayName="test";
Chinese Version
/* Localized versions of Info.plist keys */

CFBundleDisplayName = "test ";


2. International content

Similarly, content in the application (Component display name, prompt, etc.) can be configured in the form of key-value pairs in the corresponding file Localizable. strings;

English

/*

Localizable. strings

LocalizeMe

Created by gisxy on 14-3-5.

Copyright (c) 2014 esrixa. All rights reserved.

*/

"Abc" = "CBA ";

"Message" = "this is english ";

"OK" = "OK ";

 
Chinese
/* Localizable. strings LocalizeMe Created by gisxy on 14-3-5. copyright (c) 2014 esrixa. all rights reserved. */"abc" = "I'm a test"; "message" = "this is a Chinese message prompt"; "OK" = "OK ";
Note that the Code should use NSLocalizedString (@ "key value", nil) for the code prompted)

UIAlertView * alert = [[UIAlertView alloc] initWithTitle: NSLocalizedString (@ "abc", nil)

Message: NSLocalizedString (@ "message", nil)

Delegate: self

CancelButtonTitle: NSLocalizedString (@ "OK", nil)

OtherButtonTitles: nil];

[Alert show];



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.