Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Internationalization: Only key name is displayed instead of localized string in Simulator

Localization is working for other languages except of English pretty well. Every time I compile my app I see the key name instead of the localized string. Example:

NSLocalizedString(@"WelcomeKey", @"")

In Localizable.strings I have the corresponding entry:

"WelcomeKey" = "Welcome";

In the simulator I always get the key name WelcomeKey instead of Welcome. On the device this is working perfectly. In the simulator not!

I also found out that my EN Localizable.strings file was full of "???????" symbols. So I put in the old values and saved it in Xcode. I also added an entry manually instead of using genstrings. In the simulator the second language also works perfectly. Only English seems to make a problem. Perhaps I deleted English.lproj and created a EN.lproj folder?

I tried to:

  1. Empty Cache
  2. Clean all targets
  3. Delete "User/xxx/Library/Application Support/iPhone Simulator/User" folder
  4. Restart Mac
  5. Convert to UTF-16
  6. Created new Localizable.strings for EN
  7. Delete EN.lproj folder and files. Made localization completely new.

What I'm missing? I think the simulator hates English ...

Edit:

So I tried to compile this App on another Mac. There it works without problems in the simulator! So either it is a setting in Xcode or a cache problem.

like image 347
testing Avatar asked Nov 06 '22 08:11

testing


1 Answers

So you have to remove your application from iPhone/iPhone simulator first.

Press and hold on your mouse on an app in the simulator until it starts wiggling. Then hit the X. It will delete. Then press the home button to make the buttons stop wiggling.

like image 98
testing Avatar answered Nov 09 '22 13:11

testing