iOS program localization

Source: Internet
Author: User

iOS localization is actually a very simple thing (Xcode is powerful) and there are many tutorials on the web. But as a beginner, there are some places where people are puzzled.

Localization is a way for a program to change itself to display text, pictures, or xib files based on the local international settings of the system (or the area where the user chooses the localized language).

iOS can be localized for all resource files (including Xib, storyBoard, images, audio, video, etc.), rather than text alone.

iOS localization operations are divided into several steps:

1. Click project-> info-> localizations to add the area you need to localize

  

2. Using infoplist.strings to localize local info.plist files, this is only for the Info.plist key value for different regions to make changes, you can set a different

APP name, icon, or launch screen. The common key values are:

Cfbundledisplayname App Name

Uilaunchimagefile Login Image

Specific key value information can be found in Apple official documentation

 

3. Use Localizable.strings to localize strings, pictures, audio and other resource files:

The main use of different keys in different branches of the same strings file to represent different strings to load different resource files, or change the string itself.

Generally when the strings file name is localizable, use the Nslocalizedstring macro when the strings file is used for a different name

Nslocalizedstringfromtable macros.

Specific operating procedures can be found in another article on this website

  

4. Use Xib or storyboard to localize xib files

Click on the xib file and click Localize on the right side of Xcode ... Select the region you want to localize to get several different xib files,

Xib files can be processed differently depending on the region, changing the language or layout, and so on.

  

  

  

Note:

With the strings file selected, right-click, the following view appears:

  

can open a strings file as a plist file or a source code file

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.