Friday, December 17, 2010

Loading localized strings into an NSDictionary

Get the path to the strings file.


NSString *pathToFile = [[NSBundle mainBundle] pathForResource:@"Localizable" ofType:@"strings"];


pathToFile now points to the correct localization of the Localizable.strings according to user prefs.


NSDictionary *dictionary = [NSDictionary dictionaryWithContentsOfFile: pathToFile];

No comments: