简体   繁体   English

Xcode:导入本地化时出错-缺少XLIFF原始属性

[英]Xcode: Error importing localizations - XLIFF original attribute missing

I'm having an issue when importing translated strings from XLIFF back to Xcode ( Editor > Import Localizations ... ) 将翻译后的字符串从XLIFF导入回Xcode时出现问题( 编辑器>导入本地化...

Xcode is giving me the following error message with no detailed description so It's difficult figuring out what is wrong. Xcode在没有详细描述的情况下给了我以下错误消息,因此很难找出问题所在。

在此处输入图片说明

I'm using Lokalise.co to translate texts and then export them to XLIFF (the texts were imported from XLIFF too). 我正在使用Lokalise.co来翻译文本,然后将其导出到XLIFF(这些文本也是从XLIFF导入的)。

It's possible that some keys were removed in localise so the XLIFF has fewer keys than the file exported from Xcode. 有可能在本地化中删除了一些密钥,因此XLIFF的密钥比从Xcode导出的文件少。 However, I have no idea what keys it might be. 但是,我不知道它可能是什么键。

Any ideas how to proceed on this problem? 任何想法如何解决这个问题?

I had the same error message when importing a XLIFF into XCode. 将XLIFF导入XCode时出现相同的错误消息。

You need to ensure in the file tag , the original attribute is not empty. 您需要确保在file标签中, original属性不为空。 It needs to point to the path of the string file. 它需要指向字符串文件的路径。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM