How to add localized .strings files back to Xcode?

I have a .strings file that is localized in several languages. I would like to add it to my Xcode project. How do you get Xcode for the correct link to files? I tried

  • drag and drop the English version of the .strings file (located in English.lproj) into Xcode and hoping that it will automatically pick up other localized versions of the file - this is not so.
  • dragging and dropping all 5 localized versions of the .strings file (found in English.lproj, es.lproj, etc.), assuming that Xcode will create a single link to the file with different localized versions - it will work.
  • drag and drop each of the .lproj folders into Xcode, hoping that it turns out that the file in each of the folders is still the same file, but localized is nope
  • dragging the English version of the localized .strings file into Xcode, then adding the existing localization - Xcode warns that it will overwrite the file, but does not allow you to use the existing file.

UPDATE: Apple error message sent: # 10181468.

+6
source share
2 answers

Add the source file (only the file, not the .lproj folder), then make it localizable, add all the languages โ€‹โ€‹you want, xcode will create the .lproj folders and duplicate the source file for each language.

After you can overwrite each file duplicated by your already translated file (or a file if it has the same name or content).

Remember to set the source file format to UTF-16 when you add it.

+7
source

The simplest way to Xcode 4.6 is to drag the localization file (the .strings file, not the folder it is inside) from the Finder, into the Xcode project tree. Be precise and drag .strings to the top of the group, not the bottom or inside the group, since the latter causes Xcode to crash.

+13
source

Source: https://habr.com/ru/post/897902/


All Articles