Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Localization: Best Practices

What are your best practices regarding Localization for iOS? I have been working quite a lot with Localization but it feels like is not good enough and scalable. There needs to be some better way. This is my current approach:

Using .strings files + NSLocalizedString

  • This works well. Especially when splitting up the strings file into smaller pieces. But if it's to many small files. It can be tedious to add another language.

Using .stringsdict for zero, one, many, etc strings

  • This also works well. The downside is that is quite a lot "code" for one word.

Using .strings files for Storyboard

  • This is the most tricky part. Generating .string file from a storyboard itself is not hard. But for some reason it's not possible to update strings?? So. if you add more strings into the storyboard file it's not possible to get the new strings into the old strings without regenerating. That means all your old translations will be lost.
  • I've read and tested FileMerge. (Works ok, but seems like a long way to go)
  • I've read and testat some python scripts. (Don't work at all)

I have tried to create a xliff file from Xcode, but never got it to work. It always fails to export the file.

Error msg: Failed to read strings file ./..../Localizable.strings/ The data couldn’t be read because it isn’t in the correct format.

So.. How do you deal with Localizedstrings in iOS? Especially. What are your approaches around localizating storyboard files? I've seen people setting all the localizedstrings in code. But it feels like a unnecessary step to create a lot of IBOutlets for that cause.

like image 779
user023 Avatar asked Sep 14 '15 07:09

user023


1 Answers

What i did which is quite a mission initially, but worth it in the long run, is to put all your translations in an excel file, then save out your excel doc as a csv. Then i wrote a little parser that will spit out the csv file into the strings file format. Good for keeping strings aligned if you have an android project as well.

like image 163
Fonix Avatar answered Oct 14 '22 22:10

Fonix