Development of mobile applications more want to get more users, to the world, which requires the application of internationalization, internationalization is actually multi-language. This article introduces the internationalization of Xcode4.5, including application name internationalization and application content internationalization. Please refer to the previous version if it is Xcode4.5.
Application content Internationalization
1. Create a new resource file named Localizable.strings
2, in the right side of the property selector can see a button localize:3, click the Localize button, if not done internationalization processing, the option is only Chinese, has done the internationalization processing will have many options.
4, click the Localize button, click the project root directory, and select Project, and then select the Info tab, at the bottom we see the localizations, click "+" to select a language.
5, at this time to see localizable.strings,6, in the corresponding add content first select Localizable.strings (English) file, add the following content:
"Language" = "中文版";
Then select the Localizable.strings (Chinese) file and add the following:
"Language" = " Chinese";
7. Use nslocalizedstring to get content
NSLog(@ "%@",nslocalizedstring(@ "Language", @ ""));
The system will recognize the use of Chinese or English based on the locale of the current device. Application name Internationalization
1, on the basis of the above operation, select Infoplist.strings.
Infoplist.strings (中文版):
Cfbundledisplayname="中文版";
Infoplist.strings (Chinese), add:
Cfbundledisplayname="Chinese";
2, why is Cfbundledisplayname?
Use the steps to view the key for the app name.
At this point, the internationalization of the app name and app content is complete.
IOS-Application Internationalization