6. Configuring internationalization on IOS programming Xcode6

Source: Internet
Author: User

First of all, write a good program in the simulator run is abnormal situation, the proposed use of the real machine to do the test, I wrote this article before the simulator toss to die, special told the small partners, do not step on the pit.

1. Create a project first

Take the name Localizabletest and add the language that needs to be internationalized as a picture.



After Finish, even if it is added successfully, you can then see the resulting small triangle on the left side of both the Main.storyboard and Launchscreen.xib, which can be expanded to include the language file you just added and a base file.

In the next point in the Main.storyboard, as shown in the picture, the Chinese this item, in fact, before the Base of the default is English, but here still hook for good.


After the hook, Main.storyboard will automatically generate a Chinese file.

Then click Supporting Files in this folder, as shown in the picture.


Create a new infoplist.strings and a localizable.strings, pay special attention to the name must be written in this way, convenient for later use.



Then, according to the method of the picture, point them separately, and then go to the relevant files on the hook. The next three pictures are the same operation.




After the build, you can see the following file on the left column.


Let's test how to configure the static text.

First, drag a lable control onto the storyboard, and then name the lab.


Let it relate to ViewController.h.


Write the relevant international information in Localizable.string's Chinese and English documents respectively. The most thing to note here is the difference between Xcode 6 and Xcode 5, that is, before 5, the left side does not need to add double quotation marks, now to add.



The result of running on the real machine is:


★ Again: It is possible to run out on a virtual machine without effect. It must be clear.



Sixth Chapter, End!

This article is original, reproduced please specify the source, prohibited for commercial use. Thank you!


6. Configuring internationalization on IOS programming Xcode6

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.