I'm building a version of an App I have already released, but with a few changes. It's not quite a lite/full version relationship, but they're similar enough that I'm using the same project with a different target.
I'd like to reword almost all of the strings I have used in the first version for the new version, and was wondering the best way to approach this. Rather than use #ifdef/#else statements before the declaration of each string, I was thinking of using NSLocalizedStrings. However, the actual language is still the same.
I read in this post that you can set the language yourself, so presumably I can invent my own language and set it to that. But I'm wondering if this is the best way to go about things? Any advice would be most welcome.
You can have multiple string tables for any given language (that is multiple
.strings
files). When you want a localised string, you can obtain it through:Since the table for this method can be variable, you can even switch it at runtime. The above assumes you have a
Full.strings
table and aLite.strings
table.Full.strings
Lite.strings
You may not want to ship them together, if that is the case, you can configure your Info.plist to contain the name of the table to use for a specific target (if you add an entry called
"TableToUse"
, you can get it via[[[NSBundle mainBundle] infoDictionary] objectForKey:@"TableToUse"]
)