iOS Multi-language settings

Source: Internet
Author: User

When you are inside your project, new File. A localizable.strings file.


After that, want to choose Add Language, when you click on the right side of the toolbar (View-> Utilities->shoe File inspector) inside the localization want to add language, you find only English one, And it's not possible to add other language types.


at this point you can follow these steps


When you go back to Localizable.strings's localization option, you will find that there is a Chinese (Simplified) option in it, and when you tick the corresponding option in front of it, You'll find that the localizable.strings you created earlier (the left side of Xcode) will work, and then you've added the language, and then you've used it, Just write the content in the corresponding file:: (for example: in the Localizable.strings (Chinese (Simplified)) file , write "name" = "Zhang San"; In the Localizable.strings (English) file, write "name" = "Zhangsan";)

Through where you need to be.

NSString *namestr= nslocalizedstring (@ "name", nil);
Call to get the corresponding content

Internation ", nil)

Internation ", nil)

when the custom name, use nslocalizedstring way does not work, here to pay special attention, attention, attention!!! (important to say three times);

iOS Multi-language settings

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.