Typically, you interact with the NSBundle . You use a line to read a localized version of a line (which is loaded from a file with a localized line).
There are also some macros that some people use to facilitate the syntax, prefixed with NSLocalizedString . NSLocalizedString uses an NSBundle .
imo, you should use string constants to identify the localized string you are reading (for example, you should with dictionaries and object keys).
you can declare your constants using this form (suppose objc):
extern NSString* const MONAppString_Download;
and define it like this:
NSString* const MONAppString_Download = @"Download";
then access it using:
NSString * tableName = nil;
sometimes it helps to create wrapper functions to reduce noise, especially when you use them in many places:
// @return what set to the above variable named 'localized'. NSString * MONLocalized_Download();
then you customize your line files, such as a map, one for each localization you support.
therefore, whenever you need to read a line that is visible to the user, you use the form above. also think that there are other localization resources (nibs, images, pdfs, etc.) that you can link to your application. most of the work here is also abstracted from NSBundle, CFBundle, if you prefer.
luck
justin
source share