The XLIFF format

Most professional translation tools support XLIFF. These files use the XML format and are supported by Symfony by default. Besides supporting all Symfony translation features, the XLIFF format also has some specific features.

ほとんどのプロの翻訳ツールは XLIFF をサポートしています。これらのファイルは XML 形式を使用し、デフォルトで Symfony によってサポートされています。すべての Symfony 翻訳機能をサポートするだけでなく、XLIFF 形式にはいくつかの特定の機能もあります。

Adding Notes to Translation Contents

Sometimes translators need additional context to better decide how to translate some content. This context can be provided with notes, which are a collection of comments used to store end user readable information. The only format that supports loading and dumping notes is XLIFF version 2.

翻訳者は、一部のコンテンツの翻訳方法をより適切に決定するために、追加のコンテキストを必要とする場合があります。このコンテキストには、エンド ユーザーが読み取り可能な情報を格納するために使用されるコメントのコレクションであるメモを付けることができます。メモのロードとダンプをサポートする唯一の形式は、XLIFF バージョン 2 です。

If the XLIFF 2.0 document contains <notes> nodes, they are automatically loaded/dumped inside a Symfony application:

XLIFF 2.0 ドキュメントにノードが含まれている場合、ノードは Symfony アプリケーション内で自動的にロード/ダンプされます。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?xml version="1.0" encoding="UTF-8" ?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.1" version="2.1"
    srcLang="fr-FR" trgLang="en-US">
    <file id="messages.en_US">
        <unit id="LCa0a2j" name="original-content">
            <notes>
                <note category="state">new</note>
                <note category="approved">true</note>
                <note category="section" priority="1">user login</note>
            </notes>
            <segment>
                <source>original-content</source>
                <target>translated-content</target>
            </segment>
        </unit>
    </file>
</xliff>