1

I try to localise my program. But it isn't going well.. I have Localizable.strings:

"News" = "Новости";

And my custom Tab Bar class where I put

[tabBarItem setTitle:NSLocalizedString(@"News", nil)];

And it doesn't work. "News" that all I see on the tab. I try to clear cache but it didn't help. Ok, I checked Localisable file is added to the target, I added NSLog(@"MY NEWS TAG: %@", NSLocalizedString(@"News", nil)) line to my code. It just prints "News". Then I added NSLog(@"localeIdentifier: %@", [[NSLocale currentLocale] localeIdentifier]); and it prints localeIdentifier: en_US!!! But iOS Simulator UI has different language. Looks like I get wrong localeIdentifier! Why so?

Cœur
  • 37,241
  • 25
  • 195
  • 267
user3742622
  • 1,037
  • 3
  • 22
  • 40
  • And if you change the code to `[tabBarItem setTitle:@"Bobby"]` what is the result? – Wain Feb 28 '15 at 12:32
  • Tab with "Bobby". Looks like it totally ignor my Localizable.strings. And I tried to do it in another places not only Tab Bar title - situation is same. – user3742622 Feb 28 '15 at 12:52
  • 1
    Localisable file is added to the target? Are there multiple localisable files? – Wain Feb 28 '15 at 13:16
  • Yes, looks like added https://dl.dropboxusercontent.com/u/1338320/Localizable.png Only one file - Localizable.strings I'm desperate ((( – user3742622 Feb 28 '15 at 14:46
  • I added NSLog(@"MY NEWS TAG: %@", NSLocalizedString(@"News", nil)); line to my code. It prints "News". – user3742622 Feb 28 '15 at 15:16
  • I added line NSLog(@"localeIdentifier: %@", [[NSLocale currentLocale] localeIdentifier]); It prints localeIdentifier: en_US. But iOS Simulator UI on another language. Looks like I get wrong localisation. Why? – user3742622 Feb 28 '15 at 15:28

1 Answers1

0

I found here: XCode 5/iOS 7 - localization not working in simulator

If you are using xcode 6.1.1 and iOS sdk 8.1,try this workaround.

It seems localization does not work with xCode 6.1 and 8.1 simulator. Workaround: Go to "edit schemes" >> "Run" (side bar) >> "Options" tab

"Application Language" Select the language you wish to run the app on the simulator. I got this workaround from Workaround by natanavra Thanks to him.

However I read on developer forum,that it is working in 6.2 beta version of Xcode. Hope it do.

Damn! It looks so!

Community
  • 1
  • 1
user3742622
  • 1,037
  • 3
  • 22
  • 40