支持文件类型 (Strings)

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

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

文件扩展名

.xlf, .xliff

API 扩展

xliff_2

导入

导出

复数形式支持

复数形式支持

格式选项

忽略源语言翻译,忽略目标语言翻译,覆盖文件语言,包含在CDATA中,包含翻译状态

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

它是一种基于 XML 的变体,使用标签如 <source>, <target> 来存储给定源文件的原文和翻译文本。此外,它提取非可翻译数据,包括变量、代码和注释,并将其保存在自定义元素中。  

与 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

说明 

将包含 HTML 标签的翻译封装在 CDATA 中。如果禁用,不支持的 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">标题</note>
        <note category="location">app/app.component.ts:2</note>
      </notes>
      <segment>
        <原文>你好</原文>
        <译文>你好</译文>
      </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.