Creating Localization Files for iOS
I would like to localize one of my apps. But I just CANNOT seem to figure it out. I have tried to read apple's docs, and I have looked at a bunch of tuto开发者_JS百科rials that I found by searching. I understand how to change all my strings to NSLocalizedStrings
, and how to edit those localized files one there created, but my problem is I can't figure out how to create those directories in the first place.
How do you make those folders en.lproj
and a spanish one. Also, how do you make the two string files that go inside them.
Step by step help would be greatly appreciated, or a link to a detailed tutorial on this part.
Thanks in advance.
Note: I've made countless attempts and an simply stuck.
you are nearly done with doing NSLocalizedStrings
. You open up terminal.app and change the dir to your project by changing dir. Type in cd
and drop in your project folder. Then tipe in: genstrings ./Classes/*.m
this will create a file with all strings you entered. Look in your project folder for Localizable.strings
and drag it into Xcode project. Uncheck the box that says "copy into destination group..." and change the text encoding to UTF-16! Then open the info window for that file and check "Make file localizable", switch to general tab and enter for ex: fr
for the new localization and click add. Now you can change the localization to french, where it says fr
(or whatever you have)
When selecting a file, in the Utility sidebar you will see the localization panel. There you can add languages.
Note that in Xcode 4.4 and up you have to go to the Project Info and add all the languages there, you can't add languages from any file info
精彩评论