【问题标题】:Xcode 6.1.1 import localisations error "XLIFF id attribute missing"Xcode 6.1.1 导入本地化错误“缺少 XLIFF id 属性”
【发布时间】:2015-03-30 02:03:48
【问题描述】:

我最近使用 Xcode 的本地化工具导出 XLIFF 文件。这些文件已翻译,然后我尝试导入它们,但我不断收到错误“XLIFF id 属性丢失”。我想可能是其中一位翻译弄乱了文件,所以作为测试,我重新导出了 XLIFF 文件并尝试在不对其进行任何更改的情况下导入它们,但仍然收到错误“XLIFF id attribute missing”。

有什么想法吗?

【问题讨论】:

  • 同样的问题...想通了吗?

标签: ios xcode localization xliff


【解决方案1】:

对我来说,这与这个问题有关:Xcode 6 localization. export .xliff file will cut the string when the string is like “this is sample \”text\“”

我的字符串文件如下所示:

"some english \"text\"" = "some english \"text\""

在 XLIFF 中导出,如下所示:

<trans-unit id="">
    <target>some english \</target>
    <source>some english \</target>
    <note></note>
</trans-unit>

我的翻译忠实地翻译了它:(模拟)

<trans-unit id="">
    <target>some english \</target>
    <source>xyz abcdefg \</source>
    <note></note>
</trans-unit>

在尝试导入翻译后的 XLIFF 时,我收到了 XLIFF id attribute missing 错误。

为了解决这个问题,我进入了我的字符串文件并将条目更改为:

"some english 'text'" = "some english 'text'"

还有 xliff...

<trans-unit id="some english 'text'">
    <target>some english 'text'</target>
    <source>xyz abcdefg</source>
    <note></note>
</trans-unit>

...然后导入,它工作。显然此时该字符串的翻译是错误的,需要重做,但至少导入了其余文本。


编辑:

我一直在寻找解决方案。我发现使用大引号确实可以正确导出,因此字符串:some english “text” 会生成 xliff:

<trans-unit id="some english “text”">
    <source>some english “text”</source>
</trans-unit>

这是我目前知道的唯一方法。

【讨论】:

  • 这正是问题所在!谢谢。你有没有找到在你的字符串中包含双引号的方法?
  • @DarrenFindlay 好吧,使用花引号似乎可行。希望这对于您正在做的事情是可以接受的。
猜你喜欢
  • 2018-04-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-10-07
  • 1970-01-01
  • 2014-12-16
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多