1

I have a problem with the localization, it must be in English and Italian. I'm using NSLocalizedString, but I have a problem.

If I set the language to Italian or English everything works correctly. If I set any other language it remains Italian. But if I first set the language to English and then to Spanish for example, at this point will remain in English. In the plist file "localized native development region" is set to English. thanks

Rafał Sroka
  • 39,540
  • 23
  • 113
  • 143
ArrowStark
  • 33
  • 4

1 Answers1

1

The fallback language is the first language in [NSLocale preferredLanguages] that is supported by the app. It is not always English. If you change the language in the Settings it will move to the top of the list.

Rafał Sroka
  • 39,540
  • 23
  • 113
  • 143
  • so i can't do anything for this? i'd like if the user isn't italian, run the application in english – ArrowStark Mar 01 '14 at 19:13
  • Not if you are using `NSLocalizedString`. You would need to implement a custom solution. This thread sheds some light: http://stackoverflow.com/questions/6593561/custom-nslocalizedstring – Rafał Sroka Mar 01 '14 at 19:16
  • ok thanks! i can get the language through NSUsersDefaults and set a condition, if language is equal to italian set italian word, else set english word. Could be a solution? – ArrowStark Mar 01 '14 at 19:26
  • Yes, correct. But to get current language just use `[[NSLocale preferredLanguages] objectAtIndex:0];` and not `NSUsersDefaults`. – Rafał Sroka Mar 01 '14 at 19:30