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