Iphone – Adding localizable files to project on Xcode 4

addfileiphonelocalization

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.

Best Answer

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.

Related Topic