TermBase eXchange 格式

Added in version 4.5.

在 5.12 版本发生变更.

TBX 是一种用于交换术语数据的 XML 格式。

支持的功能

文件扩展名

.tbx

Linguality

双语

支持复数

No

支持描述

Yes

支持解释

Yes

支持上下文

Yes

支持位置

No

支持标记

Yes

API 标识符

tbx

支持只读字符串

No

解释

Weblate 加载并保存解释,这些来自 TBX 文件的解释将被展示在 术语表 中。

  • 翻译解释被存储为 <note from="translator"></note> 标签。

  • 源字符串解释被存储为 <descrip></descrip> 标签。

  • 源字符串解释存储为 <descrip type="Usage note"></descrip> 标签。

Glossary flags and read-only metadata

Weblate 将 <termNote type="administrativeStatus"> 中管理状态为 forbiddenobsolete 的术语导入为 禁止的译文

<descrip type="Translation needed">No</descrip> 的术语被导入为只读字符串,见 不可翻译的术语.

导入术语表文件

TBX can store multiple languages in one XML file, but Weblate still maps each component file to a translation language using the component file mask. For a TBX glossary component, the component source language is used for source terms and the language parsed from the file name is used as the target glossary language.

Avoid naming a TBX translation file with the same language code as the component source language, because the source language already exists in Weblate and the file can be detected as a duplicate language.

示例文件

示例文件:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE martif PUBLIC "ISO 12200:1999A//DTD MARTIF core (DXFcdV04)//EN" "TBXcdv04.dtd">
<martif type="TBX" xml:lang="en">
    <martifHeader>
        <fileDesc>
            <sourceDesc>
                <p>Translate Toolkit</p>
            </sourceDesc>
        </fileDesc>
    </martifHeader>
    <text>
        <body>
            <termEntry>
                <langSet xml:lang="en">
                  <tig>
                    <term>address bar</term>
                  </tig>
                </langSet>
                <langSet xml:lang="cs">
                  <tig>
                    <term>adresní řádek</term>
                  </tig>
                </langSet>
            </termEntry>
            <termEntry weblate-flags="terminology">
                <langSet xml:lang="en">
                  <tig>
                    <term>administrator</term>
                  </tig>
                </langSet>
                <langSet xml:lang="cs">
                  <tig>
                    <term>správce</term>
                  </tig>
                </langSet>
            </termEntry>
            <termEntry>
                <descrip>Example source string explanation text</descrip>
                <descrip type="Usage note">Example source string description text</descrip>
                <langSet xml:lang="en">
                  <tig>
                    <term>administrate</term>
                  </tig>
                </langSet>
                <langSet xml:lang="cs">
                  <tig>
                    <term>spravovat</term>
                    <note from="translator">Example translation string explanation text</note>
                  </tig>
                </langSet>
            </termEntry>
            <termEntry>
                <descrip type="Translation needed">No</descrip> <!-- mark as untranslateable -->
                <langSet xml:lang="en">
                  <tig>
                    <term>Weblate</term>
                  </tig>
                </langSet>
            </termEntry>
            <termEntry>
                <langSet xml:lang="en">
                  <tig>
                    <term>example forbidden term</term>
                    <termNote type="administrativeStatus">forbidden</termNote>
                  </tig>
                </langSet>
                <langSet xml:lang="cs">
                  <tig>
                    <term>příklad zakázaného výrazu</term>
                  </tig>
                </langSet>
            </termEntry>
        </body>
    </text>
</martif>

Weblate 配置

典型的 Weblate 部件配置

文件掩码

tbx/*.tbx

单语言译文模版语言文件

新语种的翻译模版

文件格式

TermBase eXchange 文件