1

I created a Localizable.strings file in XCode and then 2 languages in it.(en and fr).

If I try something like:

self.title = NSLocalizedString(@"Shop", @"");

This works fine when I am running app and changing languages but when I am killing app and restarting the app then I am not able to get correct values for changed language. It is setting values for English language only.

Any idea ?

Mayur Prajapati
  • 5,454
  • 7
  • 41
  • 70
Reena
  • 41
  • 6
  • How do you change the languages when your app is running? – Larme Jan 22 '16 at 08:36
  • By using NSBundle method : + (void)setLanguage:(NSString *)language; – Reena Jan 22 '16 at 10:14
  • Isn't that a custom method? If YES, you just have to save your last language set? – Larme Jan 22 '16 at 10:29
  • Yes, I am saving last language selected and able to get selected language too. But not the correct values for keys. Getting strings values saved from default language. As - (NSString *)localizedStringForKey:(NSString *)key value:(NSString *)value table:(NSString *)tableName this method is not getting called. Why this is not getting called when application goes into background after changing the language to french. – Reena Jan 22 '16 at 10:45

0 Answers0