Gianni Costanzi
Gianni Costanzi

Reputation: 6104

Adding localized files to a new IOS 7 app

I'm starting to studying app localizations and I'm stuck at the very beginning.. I've created a new project called LocalizedStrings2:

new project settings

I click the plus button to add Italian Language and it offers me to localize 2 InfoPlist.strings files:

add italian localization

Is this correct? BTW, I add the italian language:

two InfoPlist.strings files

Then I've wrote the following code in the English InfoPlist.strings file:

"ERR_MSG" = "Error Message!"

The following line has been entered in the Italian version of the file:

"ERR_MSG" = "Messaggio d'errore!"

When I compile I receive the following error (I have the same error even if the two files are empty:

Error message

Any hint or good reference for up-to-date How To Localize my IOS App documentation?

Thanks in advance for any help!

Gianni

Upvotes: 3

Views: 4136

Answers (3)

coco
coco

Reputation: 4970

I guess the second InfoPlist.strings file derives trom your tests. Check out the "Supporting Files-Folder" in your apps test target.

Upvotes: 0

dreamdev
dreamdev

Reputation: 91

I was facing the same problem for many days. Then I figured it out… Just put a ; at the end of the line and it's fixed! :D

Upvotes: 9

Tommie C.
Tommie C.

Reputation: 13181

Recommendation

I don't think you should have two English references to your file in the UI. Change one to italian and verify that the files are in the proper location in your finder folder.

I would then consider removing the file references from the project and re-add them. I've noticed some peculiar behaviors when using localization for older versions of the SDK in Xcode 5+. BTW - If you are planning to support a deployment target of iOS5 you will need to remove the Base localization setting and just create the localization folders manually (inside the project folder in Finder). After you re-add the files I would check the Build Phases > Copy Bundle Resources > search for plist to verify that ProjectName/(localization).lproj is found.

NOTE Please check out the updated documentation and let me know if that is a sufficient answer.

Internationalizing Your App

Upvotes: 1

Related Questions