翻譯專案¶
翻譯組織¶
Weblate organizes translatable VCS content of project/components into a tree-like structure. You can additionally organize components within a project using categories.
底層對像是 專案配置,該專案配置應將所有翻譯歸在一起(例如,多個版本的應用程式翻譯和/或隨附的文件)。
The middle level is optionally created by 類別. The categories can be nested to achieve more complex structure.
在上面的級別上,組件配置 (實際上是要翻譯的組件),您定義要使用的版本控制系統(VCS )儲存庫以及要翻譯的文件的遮罩。
Above 組件配置 there are individual translations, handled automatically by Weblate as translation files (which match 檔案遮罩 defined in 組件配置) appear in the VCS repository.
Weblate 支援 Translate Toolkit 支援的多種翻譯格式(雙語言和單語言),請參閱 在地化檔案格式。
備註
您可以使用 Weblate 內部 URL 共享複製的版本控制系統(VCS )儲存庫。當您有許多共享同一版本控制系統(VCS )的組件時,強烈推薦使用此功能。它提高了效能並減少了所需的磁碟空間。
新增翻譯專案和組件¶
Based on your permissions, new translation projects and components can be created. It is always permitted for users with the Add new projects permission, and if your instance uses billing (e.g. like https://hosted.weblate.org/ see 帳單), you can also create those based on your plans allowance from the user account that manages billing. Projects can also be created in a workspace by users who have the Add projects to workspace permission in that workspace. Creating a project without selecting a workspace requires the site-wide Add new projects permission. See Project creation and moves for details.
提示
To grant every user permission to create new projects create new 自動團隊分派 for the Project creators team.
您可以在單獨的頁面上查看目前的結算方案:
您可以從此處開始建立專案,也可以使用導覽條中的選單來填寫翻譯專案的基本資訊以完成新增:
建立專案後,您將直接進入專案頁面:
只需單擊一次即可啟動建立新翻譯組件的操作。建立組件的過程是多階段的,並自動檢測大多數翻譯參數。有幾種建立組件的方法:
- 來自版本控制
從遠端版本控制儲存庫建立組件。
- 來自既有組件
通過選擇不同的文件為現有組件建立其他組件。
- 額外分支
僅針對不同分支,為現有組件建立其他組件。
- 上傳翻譯檔案
如果您沒有版本控制或不想將其與 Weblate 整合,則將翻譯文件上傳到 Weblate。您以後可以使用網路介面或 Weblate 的 REST API 更新內容。
- 翻譯文件
Upload single document or translation file and translate that.
- 從頭開始
建立空白翻譯專案並手動新增字串。
一旦有了現有的翻譯組件,就可以使用同一儲存庫輕鬆地為其他文件或分支新增新的組件。
首先,您需要填寫名稱和儲存庫位置:
在下一頁上,將顯示已發現的可翻譯資源的清單:
最後,您檢查翻譯組件資訊並填寫可選詳細資訊:
也參考
專案配置¶
建立一個翻譯專案,然後在其中新增一個新的翻譯組件。這個專案就像一個架子,裡面堆放著真正的翻譯。同一專案中的所有組件共享建議及其字典;翻譯也將自動傳播到單個專案中的所有組件(除非在組件配置中關閉),請參閱 翻譯記憶。
也參考
這些基本屬性被新增並通知翻譯人員專案:
專案名稱¶
詳細的專案名稱,用於顯示專案名稱。
URL slug¶
適用於 URL 的專案名稱。
專案網站¶
翻譯者可以在其中找到有關該專案的更多資訊的 URL。
This is a required parameter unless turned off by WEBSITE_REQUIRED.
翻譯指示¶
Text describing localization process in the project, and any other information useful for translators. Markdown can be used for text formatting or inserting links.
翻譯授權條款¶
Default translation license for components in this project.
貢獻者授權協議¶
Default contributor license agreement for components in this project. Markdown can be used for text formatting or inserting links.
自動清理翻譯記憶¶
在 5.13 版被加入.
Whether to replace older automatically created translation memory entries when a translation becomes active.
Matching is based on the same source string, component, context, and source/target language pair. Uploaded translation memory files are not affected.
存取控制¶
配置每個專案的存取控制,請參閱 專案存取控制 以取得更多詳細資訊。
可以透過 DEFAULT_ACCESS_CONTROL 修改預設值。
已經強制進行雙重要素身分驗證¶
在 5.7 版被加入.
Enforce 雙重要素身分驗證 for all contributors. Users won’t be allowed to perform any operations within the project without having it configured.
啟用檢閱¶
允許複核翻譯的工作流程,請參閱 專門的檢閱者。
啟用來源檢閱¶
啟用檢閱來源字串的工作流程,參閱 來源字串檢閱。
翻譯品質過濾器¶
在 5.13 版被加入.
The commit policy determines which translations are included when committing changes to the version control system. This setting is available at the project level and supports the following options:
Commit all translations regardless of quality: All translations will be committed, including those marked as needing editing or not reviewed.
Skip translations marked as needing editing: Only translations that don't have the "needs editing", "needs rewriting" or "needs checking" state will be committed.
Only include approved translations: Only translations that have been approved by a reviewer will be committed. This option requires 啟用檢閱 to be enabled.
啟用掛勾¶
是否將未經身分驗證的 通知掛勾 用於此儲存庫。
語言別名¶
將翻譯匯入到 Weblate 時定義語言代碼映射。當您的儲存庫中的語言代碼不一致,並且您希望在 Weblate 中獲得一致的檢視,或者如果您想使用翻譯檔案的非標準命名時,可以使用此方法。
典型的使用情況會是將 美國英語映射到英語:en_US:en
由逗號分隔的多個映射:en_GB:en,en_US:en
使用非標準編碼:ia_FOO:ia
提示
當匹配翻譯文件時映射語言代碼,並且映射是大小寫敏感的,所以您確保使用與檔案名稱中使用的形式相同的來源語言代碼。
加入新翻譯¶
Default behavior for requests to create new translations in components in this project.
語言代碼類型¶
Default language code style for translations created by Weblate in components in this project.
第二語言¶
在 5.11 版被加入.
翻譯時,在來源語言旁另外顯示的語言。
Optionally, it can be also used as a source for the machine translation.
翻譯旗標¶
在 5.11 版被加入.
品質檢查和其他 Weblate 行為的自訂,請參閱 使用旗標自訂行為。
Workspace, project, component, and translation flags are merged.
提交、新增、刪除、合併、附加元件與合併請求訊息¶
Default commit and merge request message templates for components in this project.
The default values can be changed by DEFAULT_ADD_MESSAGE,
DEFAULT_ADDON_MESSAGE, DEFAULT_COMMIT_MESSAGE,
DEFAULT_DELETE_MESSAGE, DEFAULT_MERGE_MESSAGE,
DEFAULT_PULL_MESSAGE.
The built-in defaults follow Conventional Commits and include Weblate links where available. Use Restore site default next to a message editor to restore the current installation default for that message; for inherited values, this also disables inheritance for that message.
組件配置¶
組件是用於翻譯的內容的分組。您輸入版本控制系統(VCS)儲存庫位置和想要翻譯那個檔案的遮罩,Weblate 會自動地從 這個版本控制系統(VCS)中取回,並找到所有匹配的可翻譯檔案。
也參考
您可以在 在地化檔案格式 中找到一些典型配置範例。
備註
推薦將翻譯文件保持在合理的大小——在您的案例中使用任何合理的工具(獨立的 app 或附加元件、書籍的章節或網站)來分割翻譯文件。
Weblate 能夠輕鬆處理 10000 個字串,但大的翻譯組件的分割工作和翻譯者之間的協調更困難。
如果翻譯的語言定義遺失,會新增一個空的定義,並且命名為 "cs_CZ (generated)"。您應該調整定義,並將其回饋給 Weblate 的作者,從而遺失的語言可以包括在下一次的發佈版本中。
使用版本控制系統(VCS)工作的所有重要參數都包含在組件中,並且從中取出翻譯:
組件名稱¶
冗長組件名稱,用於顯示組件的名稱。
組件標識串¶
適用於 URLs 的組件名稱。
組件專案¶
組件所屬的 專案配置。
版本控制系統¶
使用的版本控制系統(VCS),細節請參閱: 版本控制整合。
也參考
原始碼儲存庫¶
版本控制系統(VCS)儲存庫,用於拉取變更。
也參考
指定 URLs 的更多細節請參閱 存取儲存庫。
提示
這可以或者是真實的版本控制系統(VCS)的 URL, 或者是 weblate://project/component,指示了儲存庫應該與其它組件分享。更多細節請參閱 Weblate 內部 URL。
儲存庫推送 URL¶
Repository URL used for pushing. The behavior of this depends on 版本控制系統, and this is in more detail covered in 從 Weblate 推送變更.
For linked repositories, this is not used and setting from linked component applies.
也參考
See 存取儲存庫 for more details on how to specify a repository URL and 從 Weblate 推送變更 for more details on pushing changes from Weblate.
儲存庫瀏覽器¶
用於顯示來源檔案(已使用訊息的位置)儲存庫瀏覽器的 URL。當它為空白時,將不產生這樣的連結。您可以使用 範本標記。
例如在 GitHub 上,使用像: https://github.com/WeblateOrg/hello/blob/{{branch}}/{{filename}}#L{{line}} 那樣的一些東西
In case your paths are relative to different folder (path contains ..), you
might want to strip leading directory by parentdir filter (see
範本標記):
https://github.com/WeblateOrg/hello/blob/{{branch}}/{{filename|parentdir}}#L{{line}}
已匯出儲存庫 URL¶
由 Weblate 進行的變更被匯出的 URL。當不使用 持續在地化 時,或者當需要手動合併變更時,這是重要的。您可以為 Git 儲存庫使用 Git 匯出器 來將其自動化。
儲存庫分支¶
從版本控制系統(VCS)核實哪個分支,以及從哪裡尋找翻譯。
For linked repositories using Weblate 內部 URL, this setting is controlled by the linked component that owns the repository. Linked child components use the value from that component.
推送分支¶
用於推送變更的分支,留為空白來使用 儲存庫分支。
For linked repositories using Weblate 內部 URL, this setting is controlled by the linked component that owns the repository. Linked child components use the value from that component.
備註
This setting is ignored for Mercurial and Subversion.
For Gerrit, this selects the target branch for the review request. Leave it
empty to review against 儲存庫分支. Use the short branch name,
not refs/heads/<branch>, refs/for/<branch>, or Gerrit push options
such as %submit.
也參考
檔案遮罩¶
要翻譯的文件的遮罩,包括路徑。它應包含一個 "*" 替換語言代碼(有關處理方式的資訊,請參閱 語言定義)。如果您的儲存庫包含多個翻譯檔案(例如,多個 gettext 定義域),則您需要為每個檔案建立組件。
例如 po/*.po 或 locale/*/LC_MESSAGES/django.po。
In case your filename contains special characters such as [, ], these need
to be escaped as [[] or []].
螢幕擷圖檔案遮罩¶
This feature allows the discovery and updating of screenshots through screenshot file masks, using paths from the VCS repository. This operates at the component level and necessitates the use of an asterisk "*" to replace the screenshot file name.
Allowed formats are WebP, JPEG, PNG, APNG and GIF.
備註:
The file mask and screenshot file mask are not related. Configure them separately.
It is a manual job to link a discovered screenshot in a component to a specific translation key.
例如:
Let's assume your VCS repository has a structure like this:
component_A
└── docs
├── image1.png
└── image2.jpg
For component_A, you want to allow discovery and updates of PNG screenshots.
You'd set the screenshot file mask for component_A as component_A/docs/*.png.
This means any PNG images under docs in component_A can be discovered and updated.
So, if you want to update image1.png, the new screenshot you provide should be named image1.png,
matching the existing filename, and stored under component_A/docs/.
For Android projects using Fastlane metadata, a source-language screenshot mask
can point to the metadata screenshot folder, for example
fastlane/metadata/android/en-US/images/phoneScreenshots/*.png. Weblate will
discover matching screenshots on repository update. The discovered screenshots
still need to be associated with source strings in the screenshot management
interface; use OCR or source string search there to assign them in bulk.
單語言基底語言檔案¶
Base file containing string definitions for 單語言組件.
編輯基底檔案¶
Whether to allow editing strings in the 單語言基底語言檔案.
中間語言檔案¶
對於 單語言組件 的單一語言文件。在多數情況下,這是開發者提供的翻譯文件,並且在新增真正的來源字串時使用。
When set, the source strings are based on this file, but all other languages are based on 單語言基底語言檔案. In case the string is not translated into the source language, translating to other languages is prohibited. This provides 來源字串的品質閘道.
新翻譯的範本¶
Base file used to generate new translations.
Keep this field empty for most of the monoligual formats. Those are typically able to start from an empty file.
Choose
.potfile with GNU gettext PO files.Choose blank file without translations, if you have one.
Choose 單語言基底語言檔案 for monolingual formats that need a full set of keys present.
Choose 單語言基底語言檔案 for document translations.
Choose any translation file for others.
Template file can be the same as the base file in most cases.
提示
In many monolingual formats Weblate starts with empty file by default. Use this in case you want to have all strings present with empty value when creating new translation.
檔案格式¶
翻譯檔案格式,另請參閱 在地化檔案格式。
檔案格式參數¶
Parameters used to configure how translation files are processed, see also 檔案格式參數.
來源字串漏洞報告位址¶
用於匯報上游缺陷的電子郵箱地址。 Weblate 中做出的任何字串註釋的通知,也由這個地址接收。
With the GNU gettext PO (Portable Object) format, this address is also saved by Weblate in the Report-Msgid-Bugs-To header of the file.
不要顯示詞彙表符合專案¶
Hides the glossary panel and its matches in the translation editor for this component. When enabled, glossary suggestions for this component are not computed, and the Glossary panel (including its “Add term to glossary” action) is hidden in the editor.
備註
Glossary self-references are always excluded from matches even when this option is disabled.
允許翻譯重用¶
您可以關閉專案內從其它組件到這個組件的翻譯的傳播。這真正依賴於您在翻譯的是什麼,有時最好多次使用同一個翻譯。
對於單語言翻譯,除非您跨越整個專案中使用相同的 ID,通常關閉它是個好主意。
The default value can be changed by DEFAULT_TRANSLATION_PROPAGATION.
也參考
啟用建議¶
對於這個組件,建議的翻譯是否被接受。
也參考
建議投票¶
為建議打開投票,請參閱 建議投票。
也參考
自動接受建議¶
自動接收被投票的建議,請參閱 建議投票。
也參考
翻譯旗標¶
品質檢查和其他 Weblate 行為的自訂,請參閱 使用旗標自訂行為。
Workspace, project, component, and translation flags are merged.
強制檢查¶
不能忽略的檢查清單。
也參考
翻譯授權條款¶
License of the translation (does not need to be the same as the source code license).
貢獻者授權協議¶
使用者必須先同意貢獻者授權協議才能翻譯此組件。
Markdown can be used for text formatting or inserting links.
加入新翻譯¶
如何處理建立新語言的請求。可用選項:
- 聯絡維護者
使用者可以選取所需的語言,專案維護者將收到有關該語言的通知。由他們決定是否向儲存庫新增(或不新增)語言。
- 指向翻譯指示 URL
向使用者顯示的頁面連結描述了開始新翻譯的過程。如果需要更正式的流程(例如,在開始實際翻譯之前組成人員團隊),請使用此選項。
- 建立新語言檔案
使用者可以選擇語言,然後 Weblate 會自動為其新增文件並開始翻譯。
- 停用新增翻譯
使用者將無法選擇開始新的翻譯。
提示
The project admins can add new translations even if it is disabled here when it is possible (either 新翻譯的範本 or the file format supports starting from an empty file).
管理字串¶
在 4.5 版被加入.
配置 WebLate 中的使用者是否將被允許新增新字串並刪除現有字串。調整此項以匹配您的在地化工作流程 - 如何介紹新字串。
對於雙語言格式,通常會從原始碼中提取字串(例如,通過使用 xgettext)並停用在 Weblate 中新增字串(在下次更新翻譯檔案時將被丟棄)。在 Weblate 中,您可以為每個翻譯管理字串,並且它不會在所有翻譯中強制執行字串。
對於單晶格式,字串僅在來源語言上管理,並在翻譯中自動新增或刪除。一旦翻譯,字串會在翻譯文件中出現。
提示
You might want to turn on 編輯基底檔案 together with Manage strings for monolingual formats.
語言代碼類型¶
用來產生使用 Weblate 建立之翻譯檔案名稱的自訂語言代碼。
備註
Weblate recognizes any of the language codes when parsing translation files, following settings only influences how new files are created.
- 預設基於檔案格式
依賴於檔案格式,對於其中的多數使用 POSIX。
- POSIX 樣式,使用底線當作分隔符號
典型地由 gettext 和相關工具使用,產生像
pt_BR那樣的語言代碼。- POSIX 樣式,使用底線作為分隔符號,小寫
典型地由 gettext 和相關工具使用,產生像
pt_BR那樣的語言代碼。- POSIX 樣式,使用底線當作分隔符,包含地區碼
POSIX 風格的語言代碼即使不必要時也包括國家代碼;例如
cs_CZ)。- POSIX 樣式,使用底線作為分隔符號,包括國家代碼,小寫
POSIX style language code including the country code even when not necessary (lowercase) (for example
cs_cz).- BCP 樣式,使用連字號當作分隔符號
典型地在 web 平臺上使用,產生像
pt-BR那樣的語言編碼。- BCP 樣式,使用連字號當作分隔符號,包含地區碼
BCP 風格的語言代碼即使不必要時也包括國家代碼;例如
cs-CZ)。- BCP 樣式,使用連字號作為分隔符號、舊式語言代碼
Uses legacy codes for Chinese and BCP style notation.
- BCP 樣式,使用連字號作為分隔符號,小寫
BCP style notation, all in lower case (for example
cs-cz).- Apple App Store 詮釋資料樣式
Style suitable for uploading metadata to Apple App Store.
- Google Play 詮釋資料樣式
Style suitable for uploading metadata to Google Play Store.
- Android 樣式
只在Android apps 中使用,產生像
pt-rBR那樣的語言代碼。- Linux 樣式
Locales as used by Linux, uses legacy codes for Chinese and POSIX style notation.
- Linux 樣式,小寫
Locales as used by Linux, uses legacy codes for Chinese and POSIX style notation. Lower cased.
合併類型¶
您可以配置如何處理上游儲存庫的升級。實際實作取決於版本控制系統(VCS),請參閱 版本控制整合。
- 衍合
Rebases Weblate commits on top of upstream repository on update. This provides clean history without extra merge commits.
在複雜融合的情況下,變基可能使您產生麻煩,因此請仔細考慮是否允許它們。
You might need to enable force pushing by choosing Git 強制推送 as 版本控制系統, especially when pushing to a different branch.
- 合併
Upstream repository changes are merged into Weblate one. This setting utilizes fast-forward when possible. This is the safest way, but might produce a lot of merge commits.
- 不快轉合併
Upstream repository changes are merged into Weblate one with doing a merge commit every time (even when fast-forward would be possible). Every Weblate change will appear as a merge commit in Weblate repository.
The default value can be changed by DEFAULT_MERGE_STYLE.
提交、新增、刪除、合併、附加元件與合併請求訊息¶
Message used when committing a translation, see 範本標記.
The default value can be changed by DEFAULT_ADD_MESSAGE,
DEFAULT_ADDON_MESSAGE, DEFAULT_COMMIT_MESSAGE,
DEFAULT_DELETE_MESSAGE, DEFAULT_MERGE_MESSAGE,
DEFAULT_PULL_MESSAGE.
The built-in defaults follow Conventional Commits and include Weblate links where available. Use Restore site default next to a message editor to restore the current installation default for that message; for inherited values, this also disables inheritance for that message.
提交時一併推送¶
是否自動推送已提交的專案到上游儲存庫。啟用時,當 Weblate 將變更提交到其基礎儲存庫中,就會啟動推送。(請參閱 惰性提交)。為了能真正啟用推送功能,需配置 Repository push URL。
For linked repositories using Weblate 內部 URL, this setting is controlled by the linked component that owns the repository. Linked child components use the value from that component.
變更後提交的經過時間¶
Sets how old (in hours) changes have to be before they are committed by
background task or the commit_pending management command. All
changes in a component are committed once there is at least one change
older than this period.
For linked repositories using Weblate 內部 URL, this setting is controlled by the linked component that owns the repository. Linked child components use the value from that component.
The default value can be changed by COMMIT_PENDING_HOURS.
提示
There are other situations where pending changes might be committed, see 惰性提交.
有錯誤時鎖定¶
鎖定組件 (及關聯的組件,請參閱 Weblate 內部 URL ),觸發條件是第一個失敗的推送,合併到其上游儲存庫,或從中拉出。這樣可以避免新增其他衝突,這些衝突必須手動解決。
一旦儲存庫沒有錯誤留下來了,組件將會自動解鎖。
For linked repositories using Weblate 內部 URL, this setting is controlled by the linked component that owns the repository. Linked child components use the value from that component.
來源語言¶
用於來源字串的語言。如果您要翻譯的不是英語,請變更此選項。
提示
如果您正在從英語翻譯雙語言文件,但又希望能夠在英語翻譯中進行修復,選擇 English (Developer) 作為一種來源語言以避免來源語言和現有翻譯之間名稱上的衝突。
對於單語言翻譯,您可以使用這種情況下的中間翻譯,請參閱 中間語言檔案。
語言篩選¶
Regular expression used to filter the translation when scanning for file mask. It can be used to limit the list of languages managed by Weblate.
備註
單出現在檔案名稱中時,您需要列出語言代碼。
過濾的一些範例:
過濾器的描述 |
正規表達式 |
|---|---|
僅已選取的語言 |
|
排除的語言 |
|
只篩選兩個字母的代碼 |
|
排除非語言文件 |
|
包括所有文件(預設) |
|
鍵值篩選器¶
在 5.8 版被加入.
A regular expression that is used to filter units by their keys. It displays only those units whose keys match the regular expression that was set as the value of this field.
過濾的一些範例:
過濾器的描述 |
正規表達式 |
|---|---|
僅已選取的金鑰 |
|
Exclude app store changelogs |
|
Filter prefixed strings |
|
備註
This filter is only available for components with monolingual file formats.
變體的正規表達式¶
用於確定字串變體的正規表達式,請見 字串變數。
備註
Most of the fields can be edited by project owners or administrators, in the Weblate interface.
第二語言¶
在 5.11 版被加入.
翻譯時,在來源語言旁另外顯示的語言。
Optionally, it can be also used as a source for the machine translation.
備註
This setting can be inherited from the project.
優先度¶
較高優先度的組件會優先提供給翻譯者。
在 4.15 版的變更: This now also affects ordering of matched glossary terms.
受限制的存取¶
備註
此功能在 Hosted Weblate 上不可用。
組件預設對存取專案的任何人都可見,即使不能在組件中進行任何變更。這會容易地使翻譯在專案內保持一致。
無論專案級別權限如何,限制組件的存取或組件清單級別將接管到組件的存取權限。您必須明確授予對其的存取權限。這可以通過授予對新使用者群組的存取並將使用者放入其中,或使用預設的“自訂”或“私有”存取控制組。
預設設定可在 DEFAULT_RESTRICTED_COMPONENT 中變更。
提示
這也應用於專案管理員—請確認切換狀態後,您不會遺失對組件的存取。
當作詞彙表¶
在 4.5 版被加入.
Allows using this component as a glossary. Use when you want to manage terminology separately from normal translations.
Glossaries are best for:
Ensuring consistent use of terms (e.g., UI labels, product names).
Sharing preferred translations across multiple components or projects.
Supporting translators with definitions and context.
備註
Glossaries are not for regular translations—they are for managing terms only.
You can configure how it will be listed using 詞彙表色彩.
The glossary will be accessible in all projects defined by 分享專案.
It is recommended to enable 管理字串 on glossaries in order to allow adding new words to them.
也參考
詞彙表色彩¶
Color used when displaying terms from this glossary. Useful to distinguish glossaries when using more of them.
也參考
類別¶
Categories are there to give structure to components within a project. You can nest them to achieve a more complex structure.
Category settings¶
Categories can override the same inherited settings as projects and components, including translation license, contributor agreement, adding new translations, secondary language, translation flags, and commit messages.
Nested categories inherit from their parent category by default. Top-level categories inherit from the project. Components in a category inherit from that category by default.
範本標記¶
Weblate 在需要提供文本的幾個地方使用簡單的標記語言。它基於 The Django template language,因此能夠非常強大。
目前它用在:
Commit message formatting, see 組件配置
- 幾個附加元件
The following variables are available in the component templates:
{{ language_code }}語言代碼
{{ language_name }}語言名稱
{{ component_name }}組件名稱
{{ component_slug }}組件標識串
{{ project_name }}專案名稱
{{ project_slug }}專案 slug
{{ url }}翻譯 URL
{{ filename }}翻譯檔案名稱
{{ stats }}翻譯統計資料,這具有進一步的屬性,範例如下。
{{ stats.all }}總字串數量
{{ stats.fuzzy }}需要檢閱的字串數量
{{ stats.fuzzy_percent }}需要檢閱的字串數量百分比
{{ stats.translated }}已翻譯的字串數量
{{ stats.translated_percent }}已翻譯的字串百分比
{{ stats.allchecks }}檢查失敗的字串數量
{{ stats.allchecks_percent }}檢查失敗的字串百分比
{{ author }}目前提交的作者,只在提交範圍可用。
{{ addon_name }}Name of currently executed add-on, available only in the add-on commit message.
下面的變數在儲存庫瀏覽器或編輯器範本中可用:
{{branch}}目前的分支
{{line}}檔案中的列
{{filename}}檔案名稱,您也可以使用
parentdir過濾器,例如{{filename|parentdir}},來剝除前導部分
提示
In some places additional variables can be available, see 組件探索.
您可以將它們與過濾器結合:
{{ component|title }}
您可以使用條件:
{% if stats.translated_percent > 80 %}Well translated!{% endif %}
有另外的標籤用於替換字元:
{% replace component "-" " " %}
您可以將它與過濾器結合:
{% replace component|capfirst "-" " " %}
還有另外的過濾器來操作檔案名稱:
Directory of a file: {{ filename|dirname }}
File without extension: {{ filename|stripext }}
File in parent dir: {{ filename|parentdir }}
It can be used multiple times: {{ filename|parentdir|parentdir }}
…and other Django template features.
匯入速度¶
擷取版本控制系統(VCS)儲存庫,並將翻譯匯入到 Weblate,取決於您的翻譯的大小,這會是漫長的過程。這裡是一些提示:
最佳化配置¶
對於測試並除錯 Weblate,預設的配置是有用的,當用於生產設定時,您應該進行一些調整。它們中的很多都對形成具有巨大的衝擊。特別是,更多細節請查看 生產設定 :
配置 Celery 來執行背景工作(請參閱 使用 Celery 的背景工作)
檢查資源限制¶
如果匯入巨大的翻譯或儲存庫,您會遭到伺服器資源限制的打擊。
檢查空閒記憶體的量,通過作業系統來快取翻譯,將極大地提高效能。
如果有很多字串需要處理的話,磁碟操作會是瓶頸——磁碟被 Weblate 和資料庫施加壓力。
另外的 CPU 核心會幫助提高背景工作的效能(請參閱 使用 Celery 的背景工作)。
停用不必要的檢查¶
一些品質檢查可以使非常昂貴的,而如果不需要,在匯入時省略可以節省一些時間。配置的資訊請參閱 CHECK_LIST。
自動新增組件¶
In case your project has dozen of translation files (e.g. for different
gettext domains, or parts of Android apps), you might want to import them
automatically. This can either be achieved from the command-line by using
import_project or import_json, or by installing the
組件探索 add-on.
To use the add-on, you first need to create a component for one translation file (choose the one that is the least likely to be renamed or removed in future), and install the add-on on this component.
For the management commands, you need to create a project which will contain all
components and then run import_project or
import_json.