I did it once and now I needed to do it again – and of course I forgot how to do it, so this time I’ll write it down how localisation of an iOS project works.
I don’t use nib files and all user facing strings are set in code with NSLocalizedStrings(…). If you are using nibs or need to translate strings in Storyboard and/or nib files approach might differ.
English is considered as the base language and Swedish as the translation.
1) This is the workflow if you added new NSLocalizedString(…) in your code:
- Have your project with NSLocalizedString
- run `genstrings -o en.lproj **/*.m` in the correct folder (zsh needed)
- start iLocalize
- “Project” -> “Update from files…” -> add the en.lproj/Localizable.strings -> “Update the project from a new version of these files”
- click “Update”
2) This is the workflow if you updated the sv.lproj/Localizable.strings files e.g. manually added them in vim or you had someone translate it for you
It might be always good idea to update your Base language first so you can directly see after important the Swedish Localizable.strings file which “Translation Keys” have changed and need updating or if the translator got everything.
- In iLocalize on the top left you choose (for this example) Swedish
- “Project” -> “Update from files…” -> select your sv.lproj/Localizable.strings file-> “Update a localised language from these files”
- Make sure in the box Swedish is selected
- Click “Update”