支持的文件格式
Weblate 支持 translate-toolkit 理解的大多數翻譯格式,但是每種格式都略有不同,可能會出現未經良好測試的格式問題。
備註
為您的應用程序選擇文件格式時,最好在您使用的工具箱/平台中保留一些公認的格式。這樣,您的翻譯人員可以額外使用他們習慣使用的任何工具,並且更有可能為您的項目做出貢獻。
雙語和單語格式
支持 monolingual 和 bilingual 格式。雙語格式在單個文件中存儲兩種語言 —— 源和翻譯(典型示例是 GNU gettext,XLIFF 或 蘋果 iOS 字串 字串)。另一方面,單語格式通過 ID 識別字串,每個語言文件僅包含那些語言到任何給定語言(通常是 Android字串資源)的映射。兩種變體都使用某些文件格式,請參見下面的詳細說明。
為了正確使用單語文件,Weblate 要求訪問一個包含完整字串列表的文件,以與其源一起翻譯—— 該文件在Weblate 中稱為:ref:component-template,儘管命名方式可能會有所不同。
另外,可以利用 中間語言檔案 擴展此工作流程,以包括開發人員提供的字串,但不要在最終的字串中使用。
自動偵測
Weblate 可以自動檢測幾種常用的文件格式,但是這種檢測會損害您的性能,並且會限制特定於給定文件格式的功能(例如,自動添加新翻譯)。
翻譯類型功能
Format |
語言能力 [1] |
複數 [2] |
Descriptions [3] |
語境 [4] |
位置 [5] |
標記 [8] |
附加狀態 [6] |
---|---|---|---|---|---|---|---|
bilingual |
yes |
yes |
yes |
yes |
是 [9] |
需要編輯 |
|
mono |
yes |
yes |
yes |
yes |
是 [9] |
需要編輯 |
|
both |
yes |
yes |
yes |
yes |
是 [10] |
需要編輯,已同意 |
|
both |
no |
yes |
no |
no |
no |
||
mono |
no |
yes |
no |
no |
no |
||
mono |
yes |
yes |
no |
no |
no |
||
mono |
no |
yes |
no |
yes |
no |
||
both |
yes |
yes |
no |
yes |
是 [10] |
需要編輯 |
|
mono |
yes |
是 [7] |
no |
no |
是 [10] |
||
both |
no |
yes |
no |
no |
no |
||
mono |
否 [11] |
yes |
no |
no |
no |
||
mono |
no |
no |
no |
no |
no |
||
mono |
yes |
no |
no |
no |
no |
||
mono |
yes |
yes |
no |
no |
no |
||
mono |
yes |
yes |
no |
yes |
no |
||
mono |
yes |
yes |
no |
no |
no |
||
mono |
yes |
yes |
no |
no |
no |
||
mono |
no |
yes |
no |
no |
是 [10] |
||
mono |
no |
no |
no |
no |
是 [10] |
||
both |
no |
yes |
yes |
yes |
no |
需要編輯 |
|
mono |
no |
yes |
no |
no |
no |
||
mono |
yes |
yes |
no |
no |
no |
||
mono |
no |
no |
no |
no |
no |
||
mono |
no |
no |
no |
no |
是 [10] |
||
mono |
no |
yes |
no |
no |
no |
||
mono |
no |
yes |
yes |
yes |
no |
需要編輯 |
|
mono |
no |
no |
no |
no |
no |
||
mono |
no |
no |
no |
yes |
no |
||
mono |
no |
no |
no |
no |
no |
||
mono |
no |
no |
no |
no |
no |
||
mono |
no |
no |
no |
no |
no |
||
mono |
no |
no |
no |
no |
no |
||
mono |
no |
no |
no |
no |
no |
||
bilingual |
no |
yes |
no |
no |
是 [10] |
||
mono |
no |
no |
no |
no |
no |
||
mono |
yes |
yes |
no |
no |
no |
||
mono |
no [12] |
yes |
no |
no |
no |
唯讀字串
在 3.10 版本新加入.
將包含來自翻譯文件的只讀字串,但不能在 Webleate 中編輯。此功能本功能僅由少量格式支持( xliff`和 :ref:`aresource),但可以通過添加一個 read-only
標記,參閱 使用標誌自定義行為。
GNU gettext
Most widely used format for translating libre software.
通過調整文件頭或鏈接到相應的源文件,可以支持存儲在文件中的語境信息。
雙語 gettext PO 文件通常如下所示:
#: weblate/media/js/bootstrap-datepicker.js:1421
msgid "Monday"
msgstr "Pondělí"
#: weblate/media/js/bootstrap-datepicker.js:1421
msgid "Tuesday"
msgstr "Úterý"
#: weblate/accounts/avatar.py:163
msgctxt "No known user"
msgid "None"
msgstr "Žádný"
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
Empty |
新翻譯的模板 |
|
檔案格式 |
Gettext PO file |
也參考
使用GNU gettext 來翻譯軟件, 使用 Sphinx 翻譯文件, Gettext 在 Wikipedia 的條目, PO Files, 更新「configure」檔案中的 ALL_LINGUAS 變數, 自訂 gettext 輸出, 更新 LINGUAS 檔案, 生成 MO 檔, 更新 PO 檔以符合 POT (msgmerge)
單語 gettext
一些項目決定使用 gettext 作為單語格式 —— 它們僅在原始碼中編碼 ID,然後將字串翻譯成所有語言,包括英語。支持此功能,儘管在將組件導入 Weblate 時必須明確選擇此文件格式。
單語言的 gettext PO 文件通常如下所示:
#: weblate/media/js/bootstrap-datepicker.js:1421
msgid "day-monday"
msgstr "Pondělí"
#: weblate/media/js/bootstrap-datepicker.js:1421
msgid "day-tuesday"
msgstr "Úterý"
#: weblate/accounts/avatar.py:163
msgid "none-user"
msgstr "Žádný"
基本語言文件將是:
#: weblate/media/js/bootstrap-datepicker.js:1421
msgid "day-monday"
msgstr "Monday"
#: weblate/media/js/bootstrap-datepicker.js:1421
msgid "day-tuesday"
msgstr "Tuesday"
#: weblate/accounts/avatar.py:163
msgid "none-user"
msgstr "None"
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
|
檔案格式 |
Gettext PO 文件(單語) |
XLIFF
創建基於 XML 的格式來標準化翻譯文件,但最終它是該領域中 許多標準 之一。
XML Localization Interchange File Format (XLIFF) 通常用作雙語言格式,但 Weblate 也支持其作為單語言格式。
Weblate supports XLIFF in several variants:
- XLIFF translation file
Simple XLIFF file where content of the elements is stored as plain text (all XML elements being escaped).
- XLIFF with placeables support
Standard XLIFF supporting placeables and other XML elements.
- XLIFF with gettext extensions
XLIFF enriched by XLIFF 1.2 Representation Guide for Gettext PO to support plurals.
也參考
XML Localization Interchange File Format (XLIFF) specification, XLIFF 1.2 Representation Guide for Gettext PO
翻譯狀態
在 3.3 版本變更: 3.3 版本前的 Weblate 忽略 state
屬性。
文件中的``state`` 屬性在Weblate 中被部分處理並映射為」Needs edit」 (需要編輯)的狀態(如果出現目標的話,後面的狀態用於將字串標記為需要編輯: new `` 、 ``needs-translation
、 needs-adaptation
、 needs-l10n
)。如果應該省略 state
屬性,只要 <target>
元素存在,那麼字串被認為需要翻譯。
如果翻譯字串具有``approved=」yes」``,那麼它還將被導入Weblate 作為」Approved」(同意的),任何其它內容被導入作為」Waiting for review」 (等待复核,這與XLIFF 規範匹配)。
當存儲時,Weblate 如無必要不會添加其它屬性:
state
屬性只在字串標記為需要編輯的情況下添加。approved
屬性只在字串已經被複查的情況下添加。在其它情況下不添加屬性,但在它們出現的情況下更新。
這表示當使用 XLIFF 格式時,強烈推薦打開 Weblate 審查過程,從而能看到並更改字串的審核狀態。
相似地在導入這樣的文件時(在上傳表格中),應該選擇 Processing of strings needing edit 之下的 Import as translated。
也參考
XLIFF 中的空白字符和新行符
在 XML 格式中不區分通常類型或量的空白字符。如果想要保留,必須將 xml:space="preserve"
標記添加到字串中。
例如:
<trans-unit id="10" approved="yes">
<source xml:space="preserve">hello</source>
<target xml:space="preserve">Hello, world!
</target>
</trans-unit>
指定翻譯標記
還可以通過使用 weblate-flags
屬性指定附加的翻譯標記(請參見 使用標誌自定義行為)。 Weblate 還理解來自 XLIFF 規範的 maxwidth
和 font
屬性:
<trans-unit id="10" maxwidth="100" size-unit="pixel" font="ubuntu;22;bold">
<source>Hello %s</source>
</trans-unit>
<trans-unit id="20" maxwidth="100" size-unit="char" weblate-flags="c-format">
<source>Hello %s</source>
</trans-unit>
解析 font
屬性用於字體集、尺寸和粗細,上面的示例顯示了全部,儘管只需要字符集。字符集中的任何空白字符被轉換為下劃線,所以 Source Sans Pro
變成 Source_Sans_Pro
,當命名字符集時請記住這些請參見 管理字型)。
String keys
Weblate 通過 resname
屬性在它出線的情況下識別 XLIFF 文件中的單元,並退回到 id
(如果出現的話與 file
標籤一起)。
resname
屬性被認為是人類友好的單元識別符,對 Weblate 比 id
更適於顯示。在整個 XLIFF 文件中 resname
具有一致性。這是 Weblate 需要的,並且不被 XLIFF 標準覆蓋——它不在這個屬性上放入任何獨特性限制。
用於雙語言 XLIFF 的典型 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
Empty |
新翻譯的模板 |
|
檔案格式 |
XLIFF 翻譯文件 |
用於單語言 XLIFF 的典型 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
|
檔案格式 |
XLIFF 翻譯文件 |
也參考
`xliff在wikipedia上<https://en.wikipedia.org/wiki/xliff>`_ ,: doc:tt:格式/ xliff,xliff中的`font屬性1.2 <http://docs.oasis-open。org / xliff / v1.2 / os / xliff-core.html#font>`_,maxwidth屬性在xliff 1.2
Java 屬性
用於翻譯的本地 Java 格式。
Java 屬性通常用作單語言翻譯。
Weblate 支持這個格式的 ISO-8859-1、UTF-8 和 UTF-16 變體。它們所有都支持存儲 Unicode 字符,只是編碼不同。在 ISO-8859-1 中,使用了 Unicode 轉義序列(例如 zkou\u0161ka
),所有其它編碼字符直接或者在 UTF-8 中或者在 UTF-16 中。
備註
加載轉義序列也在 UTF-8 模式中工作,因此請小心選擇正確的編碼組,與您應用的需要匹配。
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
Empty |
檔案格式 |
Java Properties (ISO-8859-1) |
mi18n lang files
在 4.7 版本新加入.
File format used for JavaScript localization by mi18n. Syntactically it matches Java 屬性.
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
Empty |
檔案格式 |
mi18n lang file |
GWT 屬性
用於翻譯的本地 GWT 格式。
GWT 屬性通常用作單語言翻譯。
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
Empty |
檔案格式 |
GWT 屬性 |
INI 翻譯
在 4.1 版本新加入.
用於翻譯的 INI 文件格式。
INI 翻譯通常用作單語言翻譯。
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
Empty |
檔案格式 |
INI File |
Inno Setup INI translations
在 4.1 版本新加入.
Inno Setup INI file format for translations.
Inno Setup INI translations are usually used as monolingual translations.
備註
唯一需要注意的差異是 INI 翻譯 支持 %n
和 %t
佔位符用於換行和製表符。
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
Empty |
檔案格式 |
Inno Setup INI File |
備註
當前只支持 Unicode 文件(.islu
),當前不支持 ANSI 變體(.isl
)。
Joomla 翻譯
在 2.12 版本新加入.
用於翻譯的本地 Joomla 格式。
Joomla 翻譯通常用作單語言翻譯。
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
Empty |
檔案格式 |
Joomla 語言文件 |
Qt Linguist .ts
基於 Qt 的應用中使用的翻譯格式。
Qt Linguist 文件既用作雙語翻譯,也用作單語翻譯。
用作雙語言時典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
Empty |
新翻譯的模板 |
|
檔案格式 |
Qt Linguist 翻譯文件 |
用作單語言時典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
|
檔案格式 |
Qt Linguist 翻譯文件 |
也參考
Android字串資源
用於翻譯應用的Android特定文件格式。
Android string resources are monolingual, the 單語的基底語言檔 is
stored in a different location from the other files – res/values/strings.xml
.
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
Empty |
檔案格式 |
Android字串資源 |
備註
當前不支持Android的 string-array 架構。為了解決這個問題,可以將字串數組分開:
<string-array name="several_strings">
<item>First string</item>
<item>Second string</item>
</string-array>
變為:
<string-array name="several_strings">
<item>@string/several_strings_0</item>
<item>@string/several_strings_1</item>
</string-array>
<string name="several_strings_0">First string</string>
<string name="several_strings_1">Second string</string>
指向 string 元素的 string-array 應存儲在不同文件中,並且不為翻譯所用。
這個腳本可以幫助預處理現有的 strings.xml 文件和翻譯:https://gist.github.com/paour/11291062
提示
To avoid translating some strings, these can be marked as non-translatable. This can be especially useful for string references:
<string name="foobar" translatable="false">@string/foo</string>
蘋果 iOS 字串
File format typically used for translating Apple iOS applications, but also standardized by PWG 5100.13 and used on NeXTSTEP/OpenSTEP.
Apple iOS strings are usually used as monolingual.
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
Empty |
檔案格式 |
iOS Strings (UTF-8) |
PHP 字串
PHP翻譯通常只包含一種語言,因此建議指定(最常見的)帶英語字串的模板文件。
範例檔案:
<?php
$LANG['foo'] = 'bar';
$LANG['foo1'] = 'foo bar';
$LANG['foo2'] = 'foo bar baz';
$LANG['foo3'] = 'foo bar baz bag';
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
|
檔案格式 |
PHP strings |
Laravel PHP 字串
在 4.1 版本變更.
Laravel PHP 本地化文件也支持複數:
<?php
return [
'welcome' => 'Welcome to our application',
'apples' => 'There is one apple|There are many apples',
];
也參考
JSON files
在 2.0 版本新加入.
在 2.16 版本變更: 自從 Weblate 2.16 和最早 2.2.4 版本的 translate-toolkit,也支持嵌套結構的 JSON 文件。
在 4.3 版本變更: 即使對於在之前發佈版本中中斷的複雜情況,JSON 文件的結構也適當保留。
JSON 格式主要用於翻譯 Javascript 中實施的應用。
Weblate 當前支持 JSON 翻譯的幾個變體:
簡單的鍵/值文件,由例如 vue-i18n 或 react-intl 使用。
具有嵌套鍵的文件。
JSON 翻譯通常是單語言的,因此推薦指定帶有(最經常使用的)英語字串的翻譯模板文件。
範例檔案:
{
"Hello, world!\n": "Ahoj světe!\n",
"Orangutan has %d banana.\n": "",
"Try Weblate at https://demo.weblate.org/!\n": "",
"Thank you for using Weblate.": ""
}
也支持嵌套文件(要求請參見上面),這樣的文件看起來像:
{
"weblate": {
"hello": "Ahoj světe!\n",
"orangutan": "",
"try": "",
"thanks": ""
}
}
提示
JSON file 和 JSON nested structure file 都可以處理相同類型的文件。翻譯時都保留現有的 JSON 架構。
它們之間的唯一區別是使用Weberate添加新字串時。嵌套結構格式會解析新添加的鍵並將新字串插入匹配結構。例如,“app.name`”鍵插入為:
{
"app": {
"name": "Weblate"
}
}
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
Empty |
檔案格式 |
JSON nested structure file |
JSON i18next files
在 2.17 版本變更: 由於WebLate 2.17和最少2.2.5的“翻譯 - 工具包”,因此還支持具有復數的I18Next JSON文件。
在 4.15.1 版本變更: Support for v4 variant of this format was added.
提示
In case you use plurals, it is recommended to use v4 as that aligned plural handling with CLDR. Older versions have different plural rules for some languages which are not correct.
`i18next <https://www.i18next.com/>`_是編寫的框架和javascript的國際化框架。Webleate支持其本地化文件,其中包含多個功能。
i18ext翻譯是單語,因此建議使用(最常見的)英語字串指定基本文件。
備註
Weblate supports the i18next JSON v3 and v4 variants. Please choose correct file format matching your environment.
The v2 and v1 variants are mostly compatible with v3, with exception of how plurals are handled.
範例檔案:
{
"hello": "Hello",
"apple": "I have an apple",
"apple_plural": "I have {{count}} apples",
"apple_negative": "I have no apples"
}
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
Empty |
檔案格式 |
i18next JSON file v3 |
go-i18n JSON files
在 4.1 版本新加入.
在 4.16 版本變更: Support for v2 variant of this format was added.
Go-i18n翻譯是單向的,因此建議使用(最常見的)英語字串指定基本文件。
備註
Weblate supports the go-i18n JSON v1 and v2 variants. Please choose correct file format matching your environment.
Typical Weblate 組件配置 for v1 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
Empty |
檔案格式 |
go-i18n v1 JSON file |
Typical Weblate 組件配置 for v2 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
Empty |
檔案格式 |
go-i18n v2 JSON file |
gotext JSON files
在 4.15.1 版本新加入.
gotext translations are monolingual, so it is recommended to specify a base file with (what is most often the) English strings.
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
Empty |
檔案格式 |
gotext JSON file |
ARB File
在 4.1 版本新加入.
ARB翻譯是單語,因此建議使用(最常見的)英語字串指定基本文件。
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
Empty |
檔案格式 |
ARB file |
WebExtension JSON
在 2.16 版本新加入: 自苯並2.16以來支持這一點,並且在最小2.2.4中使用`翻譯-Togrukit`_。
在翻譯Mozilla Firefox或Google Chromium的擴展時使用的文件格式。
備註
雖然這種格式稱為JSON,但其規範允許包括註釋,這些註釋不是JSON規範的一部分。WebLate目前不支持註釋。
範例檔案:
{
"hello": {
"message": "Ahoj světe!\n",
"description": "Description",
"placeholders": {
"url": {
"content": "$1",
"example": "https://developer.mozilla.org"
}
}
},
"orangutan": {
"message": "Orangutan has $coUnT$ bananas",
"description": "Description",
"placeholders": {
"count": {
"content": "$1",
"example": "5"
}
}
},
"try": {
"message": "",
"description": "Description"
},
"thanks": {
"message": "",
"description": "Description"
}
}
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
Empty |
檔案格式 |
WebExtension JSON 檔 |
.XML 資源檔
在 2.3 版本新加入.
一個.xml資源(.resx)文件使用Microsoft .NET應用程序中使用的單格式XML文件格式。它是“互換的.resw,在使用相同的語法到.resx <https://lingohub.com/developers/resource-files/resw-resx-localization>`_。
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
Empty |
檔案格式 |
.NET resource file |
ResourceDictionary files
在 4.13 版本新加入.
ResourceDictionary is a monolingual XML file format used to package localizable string resources for Windows Presentation Foundation (WPF) applications.
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
Empty |
檔案格式 |
ResourceDictionary file |
CSV 文件
在 2.4 版本新加入.
CSV 文件可以包含源和翻譯的簡單列表。 Weblate 支持以下文件:
帶有標頭定義字段(
location
,source
,target
,ID
,fuzzy
,context
,translator_comments
, ` developer_comments`)的文件。這是推薦的方法,因為它最不容易出錯。挑選 CSV file 作為一種文件格式。具有兩個字段的文件 —— 源和翻譯(按此順序),選擇 Simple CSV file 作為文件格式。
無標頭文件字段順序由`translate-toolkit`_:
location
、source
、target
、ID
、fuzzy
、context
、translator_comments
、developer_comments
所定義。選擇 CSV file 作為一種文件格式。請記住定義:ref:“組件 - 模板”(參見:ref:`Bimono)。
提示
By default, the CSV format does autodetection of file encoding. This can be unreliable in some corner cases and causes performance penalty. Please choose file format variant with encoding to avoid this (for example CSV file (UTF-8)).
警告
CSV 格式當前會自動檢測 CSV 文件的方言。在某些情況下,自動檢測可能會失敗,並且您會得到不同的結果。對於值中包含換行符的 CSV 文件尤其如此。作為一種解決方法,推薦省略引用的字符。
範例檔案:
Thank you for using Weblate.,Děkujeme za použití Weblate.
雙語 CSV 文件的典型Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
Empty |
新翻譯的模板 |
|
檔案格式 |
CSV 文件 |
單語 CSV 文件的典型 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
|
檔案格式 |
Simple CSV file |
Multivalue CSV file
在 4.13 版本新加入.
This variant of the CSV files allows storing multiple translations per string.
也參考
YAML files
在 2.9 版本新加入.
具有字串鍵和值的普通yaml文件。Webleate還從列表或詞典中提取字串。
yaml文件的示例:
weblate:
hello: ""
orangutan": ""
try": ""
thanks": ""
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
Empty |
檔案格式 |
YAML file |
也參考
Ruby YAML files
在 2.9 版本新加入.
Ruby i18N Yaml文件用語言作為根節點。
示例Ruby I18N Yaml文件:
cs:
weblate:
hello: ""
orangutan: ""
try: ""
thanks: ""
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
Empty |
檔案格式 |
Ruby YAML file |
也參考
DTD files
在 2.18 版本新加入.
Example DTD file:
<!ENTITY hello "">
<!ENTITY orangutan "">
<!ENTITY try "">
<!ENTITY thanks "">
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
Empty |
檔案格式 |
DTD file |
Flat XML files
在 3.9 版本新加入.
平面XML文件的示例:
<?xml version='1.0' encoding='UTF-8'?>
<root>
<str key="hello_world">Hello World!</str>
<str key="resource_key">Translated value.</str>
</root>
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
Empty |
檔案格式 |
Flat XML file |
也參考
Windows RC files
在 4.1 版本變更: 對Windows RC文件的支持已被重寫。
備註
對此格式的支持目前在Beta中,歡迎您的測試反饋。
Example Windows RC file:
LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
STRINGTABLE
BEGIN
IDS_MSG1 "Hello, world!\n"
IDS_MSG2 "Orangutan has %d banana.\n"
IDS_MSG3 "Try Weblate at http://demo.weblate.org/!\n"
IDS_MSG4 "Thank you for using Weblate."
END
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
|
檔案格式 |
RC file |
也參考
App store 中介資料檔
在 3.5 版本新加入.
可以翻譯用於在各種應用商店中發佈應用程序的應用程序的元數據。目前以下工具兼容:
元數據由多個TextFile組成,Web2將作為單獨的字串呈現要轉換。
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
|
檔案格式 |
App store metadata files |
提示
如果您不想翻譯某些字串(例如changelogs),則標記為只讀(請參閱:ref:“自定義檢查”)。這可以通過以下方式自動化:ref:“addon-webblate.flags.bulk`。
Subtitle files
在 3.7 版本新加入.
Weblate 可翻譯許多的字幕檔:
SubRip 字幕檔 (
*.srt
)MicroDVD 字幕檔 (
*.sub
)高級變電站alpha字幕文件(
* .ass
)變電站字母字幕文件(
* .ssa
)
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
|
檔案格式 |
SubRip subtitle file |
也參考
Excel Open XML
在 3.2 版本新加入.
Excel打開XML(.xlsx)文件可以導入和導出。
在上傳用於翻譯的XLSX文件時,請注意,只考慮活動工作表,並且必須至少包含一個名為“源字串”的列以及稱為“目標”(包含的列)譯文)。此外,應該有一個名為“context``的”列(其中包含翻譯字串的上下文路徑)。如果使用XLSX下載將翻譯導出到Excel工作簿中,則您已經獲得了具有正確文件格式的文件。
HTML files
在 4.1 版本新加入.
備註
對此格式的支持目前在Beta中,歡迎您的測試反饋。
可翻譯內容從HTML文件中提取,並為翻譯提供。
也參考
文字檔
在 4.6 版本新加入.
備註
對此格式的支持目前在Beta中,歡迎您的測試反饋。
可翻譯內容從純文本文件中提取,並為翻譯提供。每個段落都被翻譯為單獨的字串。
這格式有三種風格:
純文字檔案
DokuWiki 文本文件
MediaWiki 文本文件
OpenDocument Format
在 4.1 版本新加入.
備註
對此格式的支持目前在Beta中,歡迎您的測試反饋。
可翻譯內容從OpenDocument文件中提取,並為翻譯提供。
IDML Format
在 4.1 版本新加入.
備註
對此格式的支持目前在Beta中,歡迎您的測試反饋。
從Adobe Indesign標記語言文件中提取可翻譯內容,並為翻譯提供。
TermBase eXchange format
在 4.5 版本新加入.
TBX是術語數據交換的XML格式。
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
Empty |
新翻譯的模板 |
Empty |
檔案格式 |
TermBase eXchange file |
也參考
`tbx在wikipedia上<https://en.wikipedia.org/wiki/termbase_exchange>`_ ,: doc:tt:格式/ tbx詞彙表
Stringsdict format
在 4.8 版本新加入.
備註
對此格式的支持目前在Beta中,歡迎您的測試反饋。
XML based format used by Apple which is able to store plural forms of a string.
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
Empty |
檔案格式 |
Stringsdict file |
Fluent format
在 4.8 版本新加入.
備註
對此格式的支持目前在Beta中,歡迎您的測試反饋。
Fluent is a monolingual text format that focuses on asymmetric localization: a simple string in one language can map to a complex multi-variant translation in another language.
典型的 Weblate 組件配置 |
|
---|---|
文件掩碼 |
|
單語的基底語言檔 |
|
新翻譯的模板 |
Empty |
檔案格式 |
Fluent file |
Supporting other formats
支持序列化的大多數格式可以輕鬆支持支持序列化,但他們沒有(尚未)接收任何測試。在大多數情況下,Weberate需要一些薄層以隱藏不同`Translate-Toolkit`_ Storage的行為的差異。
要為新格式添加支持,首先要在“translate-toolkit`_中為其實現支持。