从Xcode导出的XLIFF文件中没有<target>

时间:2016-04-04 13:13:46

标签: ios xcode localization nslocalizedstring xliff

当我从Xcode导出我的XLIFF文件时,我用NSLocalizedString声明的所有字符串都没有&lt;目标&GT;元件。从我的故事板生成的字符串确实有一个&lt;目标&GT;元件。谁看过这个吗?谷歌没有透露任何信息。

字符串:

let oops = NSLocalizedString("Oops!", comment: "Alert box header")

产生的XLIFF:

  <trans-unit id="Oops!">
    <source>Oops!</source>
    <note>Alert box header</note>
  </trans-unit>

2 个答案:

答案 0 :(得分:2)

I don't know specifically about XCode's behavior, but <target> is optional, so this is legal (although possibly inconvenient) XLIFF. (source: xliff 1.2)

You should be able to create add a <target> element during translation without problem, and most translation environments that support XLIFF should be able to do this as well.

答案 1 :(得分:0)

您可以使用许多有用的工具来自动编写目标。在App Store上查找xliff ...其中一些工具也是免费的。

例如,XLiffy似乎很容易使用。