2

I'm trying to localize my app and it seems to work, but it just does at the simulator. It's weird because I've tried cleaning the project, rebuilding and so but on the simulator shows the text in spanish but in my iPhone with a developer profile and configured in spanish it stills showing the strings in english.

I've also tried deleting the app, "forzing" the phone installing the new build but it doesn't seem to work.

Any thoughts? Thank you.

Images here: left phone is the simulated one and the right phone is the physical one showed with Reflector.

1 and 2

Gonzo345
  • 1,133
  • 3
  • 20
  • 42
  • Install devloper certificate. –  Apr 27 '14 at 18:27
  • I've already done that. In other case I wouldn't be able to even run the build on my phone. Thanks anyway. – Gonzo345 Apr 27 '14 at 18:30
  • After cleaning, does it work in the Simulator? Sounds like a missing ; in the strings file. Also, I'd check if the strings files exist in the bundle and have the right name and also the file encoding. – djromero Apr 27 '14 at 18:43
  • If you have localized string file in your project and your simulator is working fine with that then I guess that the iPhone caches the available localizations which is not replaced since your last build. Delete your application from the phone and re-install it from scratch. – Vacca Apr 27 '14 at 19:16
  • Thanks for the replies but yes, in the Simulator works like a charm but in my phone isn't showing the spanish strings. I've deleted the app on my phone (I did it before but I've tried again after cleaning and building) and is not working. Since it works on the Simulator it should work on "every device", but not on mine! I just want to be sure of this as you may guess. Thanks anyway. This is weird. – Gonzo345 Apr 27 '14 at 20:44
  • @Gonzo345 did you ever get this working? I'm having the same issue. – Josh Jan 21 '15 at 15:14
  • I barely remember this but I would say finally got it working. I used to autoreply even my own questions if I found the solution, but not at this case... Anyway, good luck (I'm still a n00b with Objective-C) – Gonzo345 Jan 22 '15 at 11:22

1 Answers1

0

I got the same problem and found an solid solution, although I cannot pinpoint why my simulator works while my device don't.

Check all localized files

Just check if all your localized files are localized for the device's language. They changed on iOS11 the way Locale works, and since them the localization language will be set to the device's language only if all localized files are present, as commented here. Else, it will default to the Base language.

My Case

In my case, I was only using .strings files to localize my framework, embed in my app. But the Main.storyboard and LaunchScreen.storyboard were Base localized by default. I added the device's language to this storyboards localization lists and everything start to work ok on the device.

Investigation

After that, to investigate further, I

  • Returned the localization of this files to the previous state;
  • Removed all localization with this method;

Either way, after the solution, even with this changes everything kept working as expected. I suppose the first setup change something in project.pbxproj stuff.

TL'DR

Any case, try to keep every localized file localizing all desired languages and everything should be fine. Nevertheless, it's a little bit mysterious how Locale settings are working these days.

luizv
  • 618
  • 1
  • 12
  • 22