翻譯記憶

Weblate comes with a built-in translation memory consisting of:

Content in the translation memory can be applied to strings in several ways:

  • User can accept suggestions from the 自動建議 tab while editing the string.

  • The selected strings can be processed using 自動翻譯 from the Operations menu.

  • 自動翻譯 add-on can automatically apply changes to new and existing strings.

For installation tips, see Weblate 翻譯記憶, which is turned on by default.

翻譯記憶體的範圍

The translation-memory scopes ensure privacy for different projects and users. Sharing of translations is also available.

已匯入的翻譯記憶

Importing arbitrary translation memory data using the import_memory command makes memory content available to all users and projects.

每個使用者的翻譯記憶

在每個單獨使用者的個人翻譯記憶庫中自動儲存使用者的翻譯。

The default value for new users is automatically adjusted based on the 自動清理翻譯記憶 configuration. If automatic cleanup is enabled, this is disabled by default to prevent reintroducing inconsistent translations.

每個專案的翻譯記憶庫

專案內的所有翻譯都自動儲存在專案翻譯記憶庫中,這個翻譯記憶庫只在專案內可用。

共用翻譯記憶庫

All translations within projects with shared translation memory turned on are stored in a shared translation memory available to all projects.

對於分享的 Weblate 安裝,請仔細考慮是否打開這個特性,因為可能導致嚴重的影響:

  • 翻譯可以被任何人使用。

  • 這會導致洩露秘密資訊。

  • Make sure the translations you share have good quality.

翻譯記憶庫狀態

在 5.13 版被加入.

Translation memory entries can have two different statuses: active and pending. Pending entries are included in suggestions, but with a quality penalty applied. If 自動清理翻譯記憶 is enabled, matching pending entries are removed when a translation becomes active.

自動清理翻譯記憶

在 5.13 版被加入.

When enabled for a project, Weblate replaces older automatically created translation memory entries when a translation becomes active:

  • With 啟用檢閱 enabled, cleanup happens when the translation is approved.

  • Without review, cleanup happens as soon as the translation reaches the translated state.

For the same source string, component, context, and source/target language pair, Weblate removes matching non-file entries from translation memory, including entries with a different target text. This applies across personal, project, and shared translation memory scopes. The current translation is then stored again as an active entry in the scopes that are enabled for that change.

Entries imported from external translation memory files are not cleaned up automatically. Entries with a different context are kept.

In the Docker container this can be configured using WEBLATE_DEFAULT_AUTOCLEAN_TM.

備註

Enabling automatic cleanup also changes the default for new user profiles to not contribute to personal translation memory. This prevents reintroducing inconsistent translations that were supposed to be cleaned up.

管理翻譯記憶

使用者介面

Translation memory can be managed from several places in the Weblate UI:

  • Open the user menu and choose Translation memory to manage your personal translation memory.

  • Open a project and choose Translation memory from the project menu to manage translation memory for that project.

  • Open Administration and choose Translation memory to manage uploaded translation memory for the whole Weblate instance.

The translation memory page shows entry counts for the selected scope. Depending on the scope, it also lists entries by origin, component, or language pair. The listed entries can be downloaded as JSON or TMX. Users with the required permissions can delete entries, and the project view can rebuild translation memory for the whole project or for individual components from the current translations.

The project view also shows whether shared translation memory and autoclean translation memory are enabled for the project, with a link to the project workflow settings when the user can edit the project.

Translation memory files can be imported on the same page. Uploaded files are stored in the selected scope:

  • Personal uploads are available in your personal translation memory.

  • Project uploads are available in the selected project's translation memory.

  • Administration uploads are available as uploaded shared entries for the whole Weblate instance.

提示

Translation memories in various formats can be imported into Weblate. The TMX format is provided for interoperability with other tools. All supported formats are TMX, JSON, XLIFF, PO, and CSV.

Source and target languages must be selected when uploading XLIFF, PO, or CSV files if the language information is not provided by the file itself.

../_images/memory.webp

You can search translation memory while editing strings from the 自動建議 tab.

管理介面

Administrative users have additional translation memory management controls. In Administration > Translation memory, the page lists uploaded shared entries, shared entries, and total entries for the Weblate instance. Depending on permissions, it can import uploaded shared memory, delete uploaded entries, and download uploaded, shared, or all entries as JSON or TMX.

在 4.12 版被加入.

The project translation memory view also allows rebuilding parts of or the entire project translation memory. Existing entries for the selected component or project are deleted, and the memory is populated again from the current translations in the background.

管理介面

Several management commands can manipulate translation memory content. These operate on the translation memory as a whole, unfiltered by scopes (unless requested by parameters):

dump_memory

將記憶庫匯入 JSON

import_memory

將 TMX 或 JSON 文件匯入翻譯記憶庫

cleanup_memory

Removes all entries with pending status from the translation memory

在 4.14 版被加入.

The Weblate API covers the translation memory. This allows automated manipulation for different purposes, or based on events in the translation cycle.