XLIFF 2.0

在 5.15 版被加入.

備註

Support for this format is under development. Some features might not yet be available and the behavior can change between releases. Feedback from testing is welcome.

備註

XLIFF 1.1 與 1.2 is a different format and is not compatible with XLIFF 2.0.

建立基於 XML 的格式來標準化翻譯文件,但最終它是該領域中 許多標準 之一。

XML Localization Interchange File Format (XLIFF) 2.0 is currently only supported as bilingual.

Weblate supports XLIFF in several variants:

XLIFF 2.0 翻譯檔案

Simple XLIFF file where content of the elements is stored as plain text (all XML elements being escaped).

XLIFF 2.0 with placeables support

Standard XLIFF supporting placeables and other XML elements.

範例檔案

典型 XLIFF 檔案:

<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="en" trgLang="cs">
  <file id="translation">
    <unit id="hello">
      <segment>
        <source xml:space="preserve">Hello, world!
</source>
        <target xml:space="preserve">Ahoj světe!
</target>
      </segment>
    </unit>
    <unit id="orangutan">
      <segment>
        <source xml:space="preserve">Orangutan has %d banana.
</source>
      </segment>
    </unit>
    <unit id="weblate">
      <segment>
        <source xml:space="preserve">Try Weblate at &lt;https://demo.weblate.org/&gt;!
</source>
      </segment>
    </unit>
    <unit id="thanks">
      <segment>
        <source>Thank you for using Weblate.</source>
      </segment>
    </unit>
  </file>
</xliff>
支援的功能

副檔名

.xlf, .xliff

語言能力 ⓘ

雙語言

支援複數 ⓘ

Yes

支援描述 ⓘ

Yes

支援解釋 ⓘ

No

Supports context ⓘ

Yes

支援位置 ⓘ

Yes

支援旗標 ⓘ

Yes

Additional states ⓘ

Approved, Needs editing

API 識別碼

xliff2, xliff2-placeables

支援唯讀字串 ⓘ

Yes

Supports removing obsolete strings ⓘ

No

Weblate 配置

典型的 Weblate 組件配置

檔案遮罩

localizations/*.xliff

單語言基底語言檔案

空白

新翻譯的範本

localizations/en-US.xliff

檔案格式

XLIFF 2.0 翻譯檔案