Iphone – How to add localized .strings files back to Xcode

cocoa-touchiphonelocalizationxcode

I have a .strings file that is localized in a number of languages. I'd like to add it to my Xcode project. How do you get Xcode to correctly reference the files? I've tried

  • dragging the english version of the .strings file (found in English.lproj) to Xcode and hoping it would automatically pick up the other localized versions of the file — it doesn't.
  • dragging all 5 localized versions of the .strings file (found in English.lproj, es.lproj, etc.) assuming Xcode would create a single file reference with the various localized versions — it crashes.
  • dragging each of the .lproj folders to Xcode hoping it would figure out that the file in each of the folders is all the same file, but localized — nope
  • dragging the English version of the localized .strings file to Xcode, then add a localization that already exists — Xcode warns that it will overwrite the file, but doesn't give the option to use the existing file.

UPDATE: Submitted a bug report to Apple: #10181468.

Best Answer

The simplest way as of Xcode 4.6 is to drag localization file (.strings file, not the folder it's located inside of) from Finder to the Xcode project tree. Be accurate and drag to the top of .strings group, not to the bottom or inside of the group as the latter makes Xcode crash.