語言定義

為了恰當地呈現不同的翻譯,需要提供有關語言名稱、文本方向、複數定義和語言代碼的資訊。

Built-in language definitions

Definitions for about 650 languages are included in Weblate and the list is extended in every release. Whenever Weblate is upgraded (more specifically whenever migrate is executed, see 通用的升級說明) the database of languages is updated to include all language definitions shipped in Weblate.

This feature can be disabled using UPDATE_LANGUAGES. You can also enforce updating the database to match Weblate built-in data using setuplang.

解析語系碼

While parsing translations, Weblate attempts to map language code (usually the ISO 639-1 one) from the 檔案遮罩 to any existing language object.

您可以通過 語言別名 在項目層次來進一步調整這種映射。

如果無法找到精確的匹配,將嘗試把其融入一種現有的語言。已嘗試以下措施:

  • 大小寫不敏感的查詢。

  • Normalizing underscores and dashes.

  • Looking up built-in language aliases.

  • Looking up by language name.

  • 忽略給定語言的預設國家代碼 — 選擇 cs 而非 cs_CZ

如果這也失敗了,將使用預設值建立一個新的語言定義 (從左到右的文本方向,一個複數)。自動建立的帶有代碼 xx_XX 的語言將被命名為 xx_XX (generated)。您可能想稍後在管理界面中更改這個(見:ref:changing-languages),並將它報告給問題追蹤器(見:ref:contributing),這樣的話,正確的定義就可以新增到即將發佈的Weblate版本中。

提示

在您看到有些不想要的內容作為語言的情況下,您會想要調整 語言篩選,當分析翻譯時忽略這樣的文件。

改變語系定義

您可以在語言界面來更改語言定義( /languages/ URL )。

當編輯時,確認所有字段都是正確的(特別是複數和正文方向),否則譯者將不能正常編輯這些翻譯。

Ambiguous language codes and macrolanguages

In many cases it is not a good idea to use macrolanguage code for a translation. The typical problematic case might be Kurdish language, which might be written in Arabic or Latin script, depending on actual variant. To get correct behavior in Weblate, it is recommended to use individual language codes only and avoid macrolanguages.

也參考

宏語言定義 <https://iso639-3.sil.org/about/scope#Macrolanguages>宏語言列表 <https://iso639-3.sil.org/code_tables/macrolanguage_mappings/data>

語言定義

每種語言都包括後面的字段:

語言碼

Code identifying the language. Weblate prefers two letter codes as defined by ISO 639-1, but uses ISO 639-2 or ISO 639-3 codes for languages that do not have two letter code. It can also support extended codes as defined by BCP 47.

語言名稱

語言的可見名稱。還要根據使用者介面語言將 Weblate 中包括的語言名稱進行在地化。

文字方向

確定語言是從右向左還是從左向右書寫。對於多數語言這個屬性都能夠正確地自動監測。

語言使用者數量

Number of worldwide speakers of this language.

複數形定義

Weblate comes with a built-in set of plural definitions. These are based on file-format specifications, CLDR, and other sources.

警告

Doing changes to the built-in plural definitions will most likely won’t have desired effect, as these rules need to match underlying implementation.

Changing plural number or formula will affect only displaying of the strings, but not parsing and storing strings to the files. Should you think Weblate behaves incorrectly, please file a issue in our issue tracker.

複數數量

語言中使用的複數的數量。

複數公式

Gettxt 相容的複數公式,用於確定根據給定的數量使用哪種複數形式。