A issue appears on my app when installing it on a iOS9 device. All strings are now translate in english instead of french on a french device.
NSString * temp = NSLocalizedString(key, @""); //<-- incorrect English translation
NSString * temp2 = [[NSBundle mainBundle] localizedStringForKey:key value:@"" table:nil]; //<-- incorrect English translation
NSString * frenchBundlePath = [[NSBundle mainBundle] pathForResource:@"fr" ofType:@"lproj"];
NSString * temp3 = [[NSBundle bundleWithPath:frenchBundlePath] localizedStringForKey:key value:@"" table:nil]; //<-- CORRECT
so my french localized string exist and is correct, but the [NSBundle mainBundle] seams to be the english one...
EDIT:
on iOS7 and iOS8 [[NSBundle mainBundle] preferredLocalizations] returns fr
on iOS9 [[NSBundle mainBundle] preferredLocalizations] returns base
so What should I do ?
EDIT 2 : I found a work around, but not really happy with it
NSString * preferedLanguage = [[[[NSLocale preferredLanguages] objectAtIndex:0] componentsSeparatedByString:@"-"] objectAtIndex:0];
NSString *preferedBundlePath = [[NSBundle mainBundle] pathForResource:preferedLanguage ofType:@"lproj"];
NSBundle *preferedBundle = [NSBundle bundleWithPath:preferedBundlePath];
NSString *preferedString = [preferedBundle localizedStringForKey:key value:fallbackString table:nil];