Using the Settings app in the iPhone simulator to switch languages is a PITA way of testing localization tweaks. I'm trying to figure out a way to switch localizations (en/fr/es/etc) on the fly in my app with a debug setting without restarting the app.
NSBundle provides ways of requesting localized resources from an arbitrary localization, e.g.
- (NSString *)pathForResource:(NSString *)name ofType:(NSString *)extension inDirectory:(NSString *)subpath forLocalization:(NSString *)localizationName
But I find no equivalent for the string management subsystem. It sounds from these questions that you can override the registered defaults, which sounds goofy and requires an app restart.
Are there any other strategies here? If I wrapped NSLocalizedString with something that in debug builds did its own work, what's the shortest path to loading a given .strings
file? Is there a programmatic way to access those strings tables without going and parsing them raw myself?
Thanks.