Reputation: 7079
In general I know how to do the Localization of iOS apps, the only thing is to choose between available ways and do it the right way. So I'd like to ask you about your l10n approach for your projects.
Here are my inputs:
I see two ways I could go:
Option A: localize each nib file by making XIBs localizable and adding language versions:
Option B: do the localization in the code by wiring up all needed outlets synthesizing them to properties and setting their labels/titles correctly:
I'd go for 2nd option as I see less cons to it and it can allow having everything in one place under control in each view controller, but I'd like to know what would be your choice? Which way works better for you?
EDIT: I know that that ibtool
could simplify the process in Plan A, but I'm still not convinced for it.
Upvotes: 9
Views: 798
Reputation: 7079
Well, I was expecting a little more feedback from SO users, but that's fine as after some research I've made my own decision to abandon option B and go for a modified version of option A.
I've heavily used ideas from a Compile-time approach by Philippe Casgrain. In general it uses ibtool
to automatically localize nibs when building. Philippe's approach keeps maintenance reasonably sane for now. All other strings that I use in the code are handled using NSLocalizedString
approach which was quite easy to implement in my case (just used genstrings
tool). The only issue that can potentially hit me in the future is adding new targets with different/modified UI layouts.
It's hard to say whether it was the best choice. Time will tell, so some day I'll update the question and share with you how the decision worked out for me. Maybe someone will benefit from it in the feature ;)
Upvotes: 1
Reputation: 15339
I am using Option B in all of my projects, since this also makes it easy for me to distribute the string files to the localizers. Testing is of course needed after that to make sure the strings fit into place. Also some projects do not use XIB files, so the process is always the same, no matter if XIB files are used or not. There is no memory issue with that option at all in my experience.
Upvotes: 3