IOS development diary 34-International, ios diary 34-
Today, the blogger has an international demand and encountered some difficulties. I would like to share with you the hope to make common progress.
Most applications use different app names and in-app display languages based on the language of the mobile phone system.
Generally, it is common to support English, simplified Chinese, and traditional Chinese. Of course, if you want to add other languages, the principle is the same.
These are common characters, which can be used for copying.
InfoPlist.strings
CFBundleDisplayName="";
CLLoctionNotice="Location is required to find out your sports status";
Localizable.strings
NSLocalizedString(@"", nil)
1. Internationalization of application names
Add support for languages that require Internationalization
Add support for languages that require Internationalization
Add a new International File
Add a new International File
Add and name
Add and name
Select the added file and add base on the right.
Select the added file and add base on the right.
Are checked and added to the project.
Are checked and added to the project.
After being added, it is displayed as follows:
After being added, it is displayed as follows:
Modify the application name in the format of "key" = "value"; in the file.
Modify the application name in the format of "key" = "value"; in the file. 2. internationalize the application name.
The internationalization of the application is basically the same as the above, but a new file will be created and the name will be different.
The internationalization of the application is basically the same as the above, but a new file will be created and the name will be different, as shown in
Then, use NSLocalizedString (@ "XXX", nil) to replace NSString in the project format.
Use
The format of NSLocalizedString (@ "XXX", nil) replaces NSString.