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