Is it possible to have multiple components that have their separate localizations in an app?
For example I want to localize strings in my app but also use ShareKit which is localized itself (so my bundle will contain 2 Localizable.strings in different locations). So, ShareKit contains folders like en.lproj and de.lproj that contain Localizable.strings files and I want to create the same for the rest of my project but keep them separate.
I have tried just keeping them separate and that resulted in the strings of my app not being used. Any ideas?
There is a way to do this that is quite simple.
There are several macros for localizing, one of which is NSLocalizedStringFromTable()
. This takes three parameters:
NSLocalizedString()
If you use a table name then you can have another strings file, i.e. if I do NSLocalizedStringFromTable(@"name", @"MyStrings", @"whatever");
then put my strings in MyStrings.strings
it will use that.
See Matt Gallagher's post about this.
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