iOS internationalization (project name and content)

Source: Internet
Author: User



Blog Category: IOS
Ios
First step: Create a new file in supporting files Localizable.strings. Method: Right-click on supporting files to select the new file Select Resource----strings file.
Step two: There are now infoplist.strings and localizable.strings two files. The first of these two files is used to change the item's name on the phone's total picture, and the latter one is used to change the contents. Now click on the project name---"Project---" Info enter here there is a localizations by default there is a Chinese click on the "+" below, choose your language to international is generally Chinese. Note that you will be asked to select several files, You just have to choose Infoplist.strings and localizable.strings. All other options are deselected.
Step three: Then come back and look at the two files in the project. Click Find contains two sub-files respectively. Add one later (English) (Chinese). You just have to write the content inside.
The fourth step: illustrate: Write cfbundledisplayname= "China" in Infoplist.strings (English); Write cfbundledisplayname= "China" in Info.Plist.strings (Chinese); If your mobile language environment is Chinese, your project name will be displayed, China. If your phone locale is in English, your project will show China.
Fifth step: Write "name" = "Name" in Localizable.strings (中文版); Write "name" in Localizable.strings (Chinese) =
"Name"; at this time, in the process of using such as: UILabel *label=[[uilabel alloc]initwithframe:cgrectmake (0, 0, 320, 100)];
Label.text=nslocalizedstring (@ "name", nil);
[Self.view Addsubview:label];
If the phone locale is Chinese, the text on the label is the name two characters, and if the phone locale is English, the display is name.

iOS internationalization (project name and content)

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.