0
votes

I'm developing an App that needs Localization.

I've followed these steps:

  1. I've created the es.lproj, it.lproj, en.lproj folders in the root of the project with finder.

  2. I've created the Localizable.strings file in each folder with the key pair values corresponding to the target language.

  3. I've imported with Add Files To option from Xcode.

When I test the App in the iphone simulator all works fine. I configure the iphone to any localizaed language and the app is translated properly.

But when I run the App in the device, only shows the strings in english.

I've made a test following these steps.

  1. From Xcode 4 right button over Supporting Files Folder, New File.

  2. Create Localizable.strings file

  3. In file inspector, section Localization. I've added the rest of languages. Creating the file like a folder with all Localizable files in the tree.

  4. In the root folder of the project, the xcode created a folder for each language.

  5. After editing every file, I've executed in simulator and all works fine. I've tested in 3 different devices and the only language is English.

In the Project -> Info -> localization I've added every language. In the Build Phases I've observed that only is referenced the Localizable.string file in the en.lproj folder. I've tried to add the rest of files, but only accepts one more Localizable file. I've tested in device with the "extra" added language but doesn't works.

Can someone help me please?

Thanks in advance.

4

4 Answers

1
votes

Try this: Remove the app from the device, clean project, make sure that the files appear in Build Phases>Copy Bundle Resources and run again.

1
votes

Are you sure you are testing properly on your device ? I just tried making a simple localization test, just a Hello world in different languages, and when i

I used Xcode 4 and followed the same steps as you. Changed my device language, reloaded the app, and there it was.

You might need to do a clean install in order for this to work. Do the clean install after you changed your device language to "something you haven't seen yet" ;]

Maybe this tutorial can help you : Localization Tutorial with XCode

1
votes

Have you tried to delete the app from the device and then reinstalling?

EDIT: I have checked in a project of mine and the names I see are: English.lproj, French.lproj, etc.

Don't know if this could make a difference, but you could try it. Also, you can go to the app binary for the iPhone with the Finder and select Show package content to inspect its content and make sure the localization files are there This could help to pin down the problem...

0
votes

If it can be run in the simulator ok, but the device has a problem with the localization, then the link provided here by Nils Munch has the answer. In troubleshooting it says "Unlike the iPhone simulator, the iPhone only recognizes strings files that are formatted UTF-16. Always test your localizations on the device, as the simulator and the device do not always behave the same way."

I think the problem here might be the file is UTF-8. The simulator can handle that but the device can't.