How to get Xcode 6 generated XLIFF files to import back into Xcode - renaming is not enough

北城余情 提交于 2019-12-03 14:43:22

问题


How to export a base development language XLIFF file from Xcode 6 and then re-import it to configure additional localizations. (E.g. export en.xliff file and use it to create fr.xliff file if you want to add French to an English development language project)


回答1:


I am posting this as an "answer your own question" because I spent hours trying to figure this out and as far as I can tell Apple hasn't documented it.

The Apple documentation implies it should be sufficient to rename an exported base language XLIFF with a language prefix to be able to import. I.e. if the base localization is English, you should be able to create a file that you can import for French localization just by renaming it from en.xliff to fr.xliff.

Renaming the file is not enough. You also need to add a target-language attribute to every file element.

From this:

<file original="MyApp/MyApp-Info.plist" source-language="en" datatype="plaintext">

To this:

<file original="MyApp/MyApp-Info.plist" source-language="en" datatype="plaintext" target-language="fr">

Now you can import the file to Xcode and it will create the new localization



来源:https://stackoverflow.com/questions/26346003/how-to-get-xcode-6-generated-xliff-files-to-import-back-into-xcode-renaming-is

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!