管理翻譯¶
新增新字串¶
New strings can be made available for translation when they appear in the base file, called 新翻譯的範本 (see 組件配置). If your file format doesn't require such a file, as is the case with most monolingual translation flows, you can start with empty files.
Weblate can add new strings to existing files for most of the file formats. You can also specify Context for bilingual formats to distinguish same strings used in different context. Auto-adjust context when an identical string already exists. can be used to automatically adjust Context by adding a numeric suffix in case such a string already exist in the translation.
也參考
新增新的翻譯¶
在 Weblate 中,當使用者要求時新的語言可以立刻加入,或者新的通知會發送給專案管理員來同一或手動新增。這可以使用 組件配置 中的 加入新翻譯 來實現。
Some formats expect to start with an empty file and only translated strings to be included (for example Android 字串資源), while others expect to have all keys present (for example GNU gettext PO (Portable Object)). The document-based formats (for example OpenDocument 格式) start with a copy of the source document and all strings marked as needing editing. In some situations this really doesn't depend on the format, but rather on the framework you use to handle the translation (for example with JSON 檔案).
When you specify 新翻譯的範本 in 組件配置, Weblate uses this file to start new translations. Any existing translations is removed from the file when doing so.
When 新翻譯的範本 is empty and the file format supports it, an empty file is created where new strings are added once they are translated.
The 語言代碼類型 allows you to customize language code used in generated filenames. Additionally, any mappings defined in 語言別名 are applied in reverse.
備註
If you add a language file in connected remote repository, respective translation is added to the component when Weblate updates local repository.
More info on the repository update settings can be found on the 更新儲存庫.
移除現有的翻譯¶
Languages, components, or the projects they are in, can be removed (deleted from Weblate and remote repository if used) from the menu Operations ↓ Removal of each project, component, or language.
啟動刪除操作顯示要刪除的組件清單。您必須輸入物件的 slug 以確認刪除。slug 是,語言或組件的路徑名,因為它可以在 URL 中看到它。
如果要刪除一些特定字串,則有以下方法:
手動在來源檔案中。他們將從翻譯專案中刪除,以及 Weblate 的儲存庫更新。
在 4.5 版被加入.
In Weblate’s UI via button Operations ↓ Remove while editing the string. This has differences between file formats, see: 管理字串
備註
如果刪除已連線的遠端儲存庫中的語言檔案,則當 Weblate 更新本地儲存庫時將從組件中刪除相應的轉換。
More info on the repository update settings can be found on the 更新儲存庫.
字串變數¶
變體可以將幾個字串組合在一起,這樣翻譯人員就可以在一個地方看到字串的所有變體。
提示
縮寫(縮短表格,收縮)是變體的一個很好範例。
Automated key based variants¶
可以定義正規表達式,基於 組件配置 的單語言翻譯的鍵將字串分組:
如果 金鑰 匹配表達式,那麼匹配部分被刪除以產生變體的根鍵。然後,具有相同根鍵的所有字串將成為單個變體群組的一部分,也包括具有與根鍵完全匹配的鍵的字串。
後面的表格列出了一些使用範例:
用例 |
正規表達式變數 |
匹配的翻譯鍵 |
|---|---|---|
後綴標識 |
|
|
單行標識 |
|
|
手動變化¶
在 4.5 版被加入.
可以使用 variant:SOURCE 標記手動連接特定字串。對於沒有鍵將字串自動分組,或將鍵不匹配的字串分組的雙語言翻譯,這是有用的,但應在翻譯時一起考慮。
The additional variant for a string can also be added using the Tools while translating (when 管理字串 is turned on):
備註
The variant source string has to be at most 768 characters long.
翻譯時的變體¶
當翻譯時變數在後面分組:
字串標籤¶
在專案配置中通過文本和顏色將組件翻譯字串分類。