支持文件类型 (Strings)

.XLIFF - XML Localization Interchange File Format V2 (Strings)

文本由 Phrase Language AI 从英语机器翻译而得。

文件扩展名

.xlf、.xliff

API 扩展

xliff_2

导入

导出

复数形式支持

复数形式支持

格式选项

ignore_source_translations, ignore_target_translations, override_file_language, enclosure_in_cdata, include_translation_state

XLIFF 2.0 是对更常用的 XLIFF 1.2 的更新。

这是一个基于 XML 的变体,使用 `原文<源语><译文>`等 tags 存储给定原文/源语文件的原文和译文。此外,它还提取变量、代码和备注等非译元素元素数据,并将其保存在自定义元素中。  

与 XLIFF 1.2 相比,XLIFF 2.0 的优点是简单,因为组织良好的 DOM 结构和应用了模块化。  

XLIFF 2.0 的 DOM 结构与 XLIFF 1.2 不同。这两种格式通常不兼容。

格式选项

标识符

ignore_source_translations

类型

布尔值

上传

下载

默认

false

说明

上传时忽略文件中的原文/源语翻译(避免意外更新原文/源语语言)

标识符

ignore_target_translations

类型

布尔值

上传

下载

默认

false

说明

上传时忽略文件中的译文(避免译文语言意外更新)

标识符 

override_file_language

类型 

布尔值

上传 

下载 

默认 

false

说明 

这种文件格式通常在文件本身中包含语言信息。使用此选项用您指定的语言覆盖语言。

标识符 

enclose_in_cdata

类型 

布尔值

上传 

下载 

默认 

false

说明 

包含 CDATA 中包含 html tags 的翻译。如果禁用,不支持的 HTML 实体将被替换为其解码值。例如:

  • &pound; 替换为 £

  • &trade; 替换为

代码示例

<?xml version="1.0" encoding="UTF-8" ?>
<xliff version="2.0" xmlns="urn:oasis:names:tc:xliff:document:2.0" srcLang="en" trgLang="de">
  <file original="ng.template" id="ngi18n">
    <unit id="key_name">
      <notes>
        <note category="meaning">header</note>
        <note category="location">app/app.component.ts:2</note>
      </notes>
      <segment>
        原文/源语>您好</原文/源语>
        <target>Hallo</target>
      </segment>
    </unit>
  </file>
</xliff>

复数形式

将使用以下语法导出复数键:

<unit id="plural_key">
  <segment>
    <source>{"one":"a plural","other":"some plurals"}</source>
    <target>{"one":"ein Plural","other":"einige Plurale"}</target>
  </segment>
</unit>
这篇文章有帮助吗?

Sorry about that! In what way was it not helpful?

The article didn’t address my problem.
I couldn’t understand the article.
The feature doesn’t do what I need.
Other reason.

Note that feedback is provided anonymously so we aren't able to reply to questions.
If you'd like to ask a question, submit a request to our Support team.
Thank you for your feedback.