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 tutorials 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.
Creation of localization files To create a localization file, all pieces of displayable text are replaced with unique IDs in the code files. The text strings are then added to the localization file with their IDs.
Localization is the process of translating and adapting your app into multiple languages and regions. Localize your app to provide access for users who speak a variety of languages, and who download from different App Store territories.
Click on iOS->App/Single View App->Next. Name your project and select the language as Swift. Select a desired location and click on Create. To start with Localization, click on your Project Name -> go to Info Tab -> Under Localizations, click on the '+' button.
Right click your project folder, select 'New File' , then scroll down to find 'Strings', select it and click 'Next'. Then name the file as 'Localizable. strings' and click 'Create'.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With