アドオン

アドオンを使用すると、翻訳ワークフローの変更および自動化ができます。管理者は、各翻訳プロジェクトまたはコンポーネントの 操作アドオン メニューからアドオンの追加と管理ができます。アドオンは、管理画面 からサイト全体にもインストールできます。

ヒント

また、APIDEFAULT_ADDONS または install_addon を使用してアドオンを設定できます。

手動トリガーに対応しているアドオンは、アドオン管理画面から、または API を使って実行できます。実行結果はアドオンの活動ログに記録されます。

../_images/addons.webp

アドオンをトリガーするイベント

アドオンのインストール

アドオンのインストール時にトリガーされます。

コンポーネントの更新

次のようなコンポーネントに変更が発生するたびにトリガーされます:

  • リポジトリ内の文字列が変更されます。

  • 文字列が追加されます。

  • 新しい翻訳が追加されています。

毎日

毎日トリガーされますが、アドオンは通常 BACKGROUND_TASKS に応じて毎日の負荷をコンポーネント間で分割します。

変更イベント

変更イベントが作成された後にトリガーされます。

Manual trigger

Triggered when an add-on is run manually from add-on management or the API.

リポジトリ追加後

新しい翻訳が追加され、コミットされた直後にトリガーされます。

リポジトリのコミット後

変更がコミットされた直後にトリガーされます。

リポジトリのプッシュ後

リポジトリが上流にプッシュされた直後にトリガーされます。

Repository post-remove

Triggered just after a translation is removed.

リポジトリの更新後

上流リポジトリから新しい変更がプルされるたびにトリガーされます。

リポジトリのコミット前

変更がコミットされる直前にトリガーされます。

リポジトリの事前プッシュ

リポジトリが上流にプッシュされる直前にトリガーされます。

リポジトリ更新前

リポジトリの更新が試行される直前にトリガーされます。

ユニット保存後

文字列が保存された直後にトリガーされます。

ユニット同期後

文字列が VCS と同期された後にトリガーされます。

ユニットの事前作成

新しく作成された文字列が保存された直後にトリガーされます。

付属のアドオン

自動翻訳

アドオン ID:

weblate.autotranslate.autotranslate

設定:

mode

自動翻訳モード

設定できる値:

suggest

提案として追加

translate

翻訳として追加

fuzzy

「要修正」として追加

q

検索文字列

すべての文字列を翻訳すると、既存の翻訳はすべて破棄されますのでご注意ください。

auto_source

自動翻訳の参照先

設定できる値:

others

その他の翻訳コンポーネント

mt

機械翻訳

component

コンポーネント

参照先として使用するコンポーネントのスラッグを入力します。現在のプロジェクト内のすべてのコンポーネントを使用する場合は、空白のままにします。

engines

機械翻訳エンジン

機械翻訳エンジン

threshold

スコアしきい値

トリガー:

アドオンのインストールコンポーネントの更新毎日変更イベント

機械翻訳または他のコンポーネントを使用して文字列を自動的に翻訳します。

JavaScript 現地語化 CDN

Added in version 4.2.

アドオン ID:

weblate.cdn.cdnjs

設定:

threshold

翻訳率のしきい値

翻訳を有効と見なすために必要な翻訳済み文字列の割合。

css_selector

CSS セレクタ

翻訳可能な要素を検出する CSS セレクタ。

cookie_name

言語 Cookie 名

言語設定を保存する Cookie の名前。

files

HTMLファイルから文字列を抽出

現在のリポジトリ内のファイル名のリスト、または翻訳可能な文字列を解析するリモート URL。

トリガー:

アドオンのインストール, 毎日, リポジトリのコミット後, Repository post-remove, リポジトリの更新後

JavaScript または HTML の現地語化用に、翻訳をコンテンツ配信ネットワークに公開します。

静的な HTML ページを現地語化したり、JavaScript コードで翻訳を読み込むために使用できます。

HTML のページに挿入して、翻訳を可能にするコンポーネント専用の URL を生成します。詳細については、Weblate CDN を使用した HTML と JavaScript の翻訳 を確認してください。

注釈

このアドオンには、Weblate サーバー上で追加の設定が必要です。 LOCALIZE_CDN_PATH は生成されたファイルが書き込まれる場所(ファイルシステム上)を設定し、 LOCALIZE_CDN_URL はファイルが提供される場所(URL)を定義します。ファイルの提供は Weblate によって行われないため、外部で設定することが必要です(通常は CDN サービスを使用します)。

このアドオンは Hosted Weblate で設定され、https://weblate-cdn.com/ 経由でファイルを提供します。

翻訳ファイルの CDN

Added in version 2026.5.

アドオン ID:

weblate.cdn.files

設定:

このアドオンには設定はありません。

トリガー:

アドオンのインストール, コンポーネントの更新, リポジトリのコミット後, Repository post-remove, リポジトリの更新後

翻訳ファイルをコンテンツ配信ネットワーク(CDN)に公開します。

Publishes translation files without converting them to another format. Files are written below the add-on specific CDN directory and served from LOCALIZE_CDN_URL/<add-on UUID>/. Single-file translations use the language code and original file extension, for example cs.json or de.po. Multi-file translations are served below the language code using paths relative to the translation directory. Monolingual components include the source language file, while bilingual components publish only target-language files. See CDN の現地化 for secure serving guidance.

空白文字列の削除

Added in version 4.4.

アドオン ID:

weblate.cleanup.blank

設定:

このアドオンには設定はありません。

トリガー:

アドオンのインストールリポジトリのコミット後リポジトリの更新後

翻訳ファイルから翻訳されていない文字列を削除します。

翻訳ファイルに空の文字列を含ませたくない場合使用します(例: 翻訳ライブラリにおいて原文に戻すのではなく、空の文字列が不足していると表示させる場合)。

翻訳ファイルのクリーンアップ

アドオン ID:

weblate.cleanup.generic

設定:

このアドオンには設定はありません。

トリガー:

アドオンのインストールリポジトリの更新後リポジトリのコミット前

すべての翻訳ファイルを、モノリンガル用の基礎となる翻訳ファイルと一致するように更新します。ほとんどのファイル形式で、基礎となる翻訳ファイルに存在しない、無効な翻訳キーは削除されます。

また、翻訳文字列以外の追加コンテンツを含む形式(HTML ファイルWindows RC ファイルOpenDocument 形式 など)の場合、クリーンアップにより翻訳ファイルが元のファイルに同期します。

不足している言語を追加

アドオン ID:

weblate.consistency.languages

設定:

このアドオンには設定はありません。

トリガー:

アドオンのインストール毎日リポジトリ追加後

プロジェクト内のすべてのコンポーネントで一貫した言語のセットが使用されるようにします。

注釈

他プロジェクトから共有されたコンポーネントは対象外です。

足りない言語は、24 時間ごとに 1 回、さらに新しい言語を Weblate に追加したときに確認します。

他のほとんどのアドオンとは異なり、このアドオンはプロジェクト全体に影響します。

ヒント

新しく追加した文字列を 自動翻訳 アドオンで翻訳します。

コンポーネントの検出

アドオン ID:

weblate.discovery.discovery

設定:

match

翻訳ファイルを照合する正規表現

正規表現では、コンポーネントと言語の名前付きグループを設定する必要があります。

file_format

ファイル形式

ファイル形式

name_template

コンポーネント名のカスタマイズ

Django テンプレート構文を使用してください。このテンプレートには {{ component }} を必ず含める必要があります。

base_file_template

モノリンガル用の、基礎となる翻訳ファイル名の設定

バイリンガル翻訳ファイルの場合は空のままにしてください。設定する場合、このテンプレートには {{ component }} を必ず含める必要があります。

new_base_template

新しい翻訳用の、基礎となる翻訳ファイルの設定

新しい翻訳を作成するために使用するファイル名です。gettext を使用する場合は .pot ファイルを指定してください。このテンプレートには {{ component }} を必ず含める必要があります。

intermediate_template

中間言語ファイル

中間翻訳ファイルのファイル名です。多くの場合、これは開発者が提供する翻訳ファイルで、実際の原文を生成する際に使用されます。このテンプレートには {{ component }} を必ず含めることが必要です。

language_regex

言語フィルター

ファイル マスクのスキャン時に、翻訳ファイルをフィルター処理する正規表現。

copy_addons

アドオンを、メイン コンポーネントから新しく作成したコンポーネントにクローンする

remove

存在しないファイルのコンポーネントの削除

トリガー:

アドオンのインストールリポジトリの更新後

バージョン管理システムのファイル変更に基づいて、プロジェクトコンポーネントを自動的に追加または削除します。

The matching is done using regular expressions enabling complex configuration, but some knowledge is required to do so. The regular expression to match translation files has to contain two named groups to match component and language. All named groups in the regular expression can be used as variables in the template fields.

Discovery requirements

To discover a component successfully, the configuration has to do all of the following:

  • The regular expression must define component and language named groups.

  • Template fields used to name or locate per-component files must include {{ component }}, so the rendered value actually changes for each discovered component.

  • For monolingual formats, the component must contain a file matching base_file_template and at least one translation file matching match.

Worked example: news_<lang>.md

This is a common filename-based language variant layout:

  • docs/news_en.md

  • docs/news_cs.md

  • docs/guide_en.md

Use the Filename-based language variants preset for a starting point, then choose the matching file format and review the populated values.

正規表現:

(?:(?P<path>.*/))?(?P<component>.+?)_(?P<language>[A-Za-z]{2,3}(?:[_-][A-Za-z0-9]+)*)\.(?P<extension>[^/.]+)

コンポーネント名:

{{ component }}

Discovered file masks:
  • docs/news_*.md

  • docs/guide_*.md

In this example, {{ component }} resolves to the basename before the language suffix, so docs/news_en.md, docs/news_pt_BR.md, and docs/news_pt-BR.md all become the news component.

すべてのファイル名フィールドで Django テンプレートのマークアップを使用できます。例:

{{ component }}

Component name parsed from the component match group

{{ component|title }}

先頭を大文字にしたコンポーネントファイル名

{{ path }}: {{ component }}

正規表現からのカスタム一致グループ

保存 をクリックすると、一致するコンポーネントの確認画面を表示し、設定が実際のニーズに合っているか確認する方法:

../_images/addon-discovery.webp

コンポーネント検出の例

The worked example above covers the most common filename-based variant layout. The following examples show other repository structures you can match.

言語ごとに 1 つのフォルダー

言語ごとに 1 つのフォルダがあり、その中に各コンポーネントの翻訳ファイルが含まれている場合。

正規表現:

(?P<language>[^/.]*)/(?P<component>[^/]*)\.po

一致するファイル:
  • cs/application.po

  • cs/website.po

  • de/application.po

  • de/website.po

Gettext 形式のロケールのレイアウト

gettext PO ファイルを保存する一般的な構造の場合。

正規表現:

locale/(?P<language>[^/.]*)/LC_MESSAGES/(?P<component>[^/]*)\.po

一致するファイル:
  • locale/cs/LC_MESSAGES/application.po

  • locale/cs/LC_MESSAGES/website.po

  • locale/de/LC_MESSAGES/application.po

  • locale/de/LC_MESSAGES/website.po

複雑なファイル名

コンポーネントと言語の両方がファイル名に入っている場合。

正規表現:

src/locale/(?P<component>[^/]*)\.(?P<language>[^/.]*)\.po

一致するファイル:
  • src/locale/application.cs.po

  • src/locale/website.cs.po

  • src/locale/application.de.po

  • src/locale/website.de.po

言語コードの反復

言語がパスにもファイル名にも入っている場合。

正規表現:

locale/(?P<language>[^/.]*)/(?P<component>[^/]*)/(?P=language)\.po

一致するファイル:
  • locale/cs/application/cs.po

  • locale/cs/website/cs.po

  • locale/de/application/de.po

  • locale/de/website/de.po

Android 文字列の

複数のファイルに分割された Android リソース文字列。

正規表現:

res/values-(?P<language>[^/.]*)/strings-(?P<component>[^/]*)\.xml

一致するファイル:
  • res/values-cs/strings-about.xml

  • res/values-cs/strings-help.xml

  • res/values-de/strings-about.xml

  • res/values-de/strings-help.xml

複数のパスの一致

Java プロパティの翻訳を備えたマルチモジュールの Maven プロジェクト。

正規表現:

(?P<originalHierarchy>.+/)(?P<component>[^/]*)/src/main/resources/ApplicationResources_(?P<language>[^/.]*)\.properties

コンポーネント名:

{{ originalHierarchy }}: {{ component }}

一致するファイル:
  • parent/module1/submodule/src/main/resources/ApplicationResources_fr.properties

  • parent/module1/submodule/src/main/resources/ApplicationResource_es.properties

  • parent/module2/src/main/resources/ApplicationResource_de.properties

  • parent/module2/src/main/resources/ApplicationResource_ro.properties

ヒント

コンポーネントを検出するアドオンは、Weblate の内部 URL を使用します。これは、複数のコンポーネント間で VCS 設定を共有するのに便利です。リンクされたコンポーネントは、各コンポーネントの ソースコードのリポジトリ フィールド(操作設定バージョン管理システム の中)に weblate://project/main-component を入力して、設定したメイン コンポーネントのローカル リポジトリを使用します。これにより、設定およびシステム リソースの時間をも節約できます。

ヒント

新しいコンポーネントに、翻訳可能な言語の全セットが含まれていることを 不足している言語を追加 を使って確認してください。

Fedora メッセージング

Added in version 5.15.

アドオン ID:

weblate.fedora_messaging.publish

設定:

amqp_url

AMQP broker URL

The AMQP broker URL to connect to.

publish_timeout

Publish timeout

How many seconds to wait for the broker delivery acknowledgement.

connection_attempts

Connection attempts

How many times to try connecting to the broker.

retry_delay

Retry delay

How many seconds to wait between connection attempts.

ca_cert

CA certificate bundle (PEM)

Paste only PEM certificate blocks, each starting with "-----BEGIN CERTIFICATE-----" and ending with "-----END CERTIFICATE-----".

client_key

Client private key (PEM)

Paste a single unencrypted PEM private key block. Encrypted private keys are not supported.

client_cert

Client certificate (PEM)

Paste only the PEM certificate block starting with "-----BEGIN CERTIFICATE-----"; do not paste the output from "openssl x509 -text".

event_filter

Change events to trigger

Choose which change events should trigger this add-on. Change events to trigger

events

Selected change events

Selected change events

トリガー:

変更イベント

Fedora Messaging 互換の AMQP Exchange に通知を送信します。

Fedora Messaging は AMQP ベースのパブリッシャーで、Weblate で発生するすべての変更に対応しています。これを使用して、Weblate で発生する変更に追加のサービスをフックします。

メッセージ トピック

All messages have topic weblate.<action>.<project>.<category...>.<component>.<translation>. The action is lowercase textual representation of action with underscores instead of space, for example resource_updated; see Selected change events for all action identifiers. The remaining parts match Weblate object path segments.

For example, a project backup event for the website project uses weblate.project_backed_up.website. A translation change in the website project, frontend component, and Czech translation uses weblate.translation_changed.website.frontend.cs. The same change in the frontend component inside the parent and child categories uses weblate.translation_changed.website.parent.child.frontend.cs.

メッセージ本文

本体は次のフィールドで構成されます(イベントに対して利用可能な場合):

change_id

変更の数値 ID

action

変更の詳細名。

timestamp

ISO 形式のタイムスタンプ

target

変更後の新しい値(例: 文字列の新しい翻訳)

old

変更前の値(例: 文字列の以前の翻訳)

source

原文。

url

関連オブジェクトを表示するための絶対 URL。

author

著者のユーザー名(たとえば、提案を承認する際にはユーザーとは異なる場合があります)

user

操作ユーザー名

project

プロジェクト スラッグ

component

コンポーネント スラッグ

translation

翻訳言語コード

メッセージ ヘッダー

ルーティングに利用できる追加のヘッダーが他にもあります:

action

変更の詳細名。

project

プロジェクト スラッグ

component

コンポーネント スラッグ

メッセージ例

リポジトリのマージイベント:

{
  "id": 1,
  "action": "Merged repository",
  "timestamp": "2017-06-15T11:30:47.325000+00:00",
  "url": "http://example.com/projects/test/test/",
  "component": "test"
}

新規原文文字列イベント:

{
  "id": 2,
  "action": "New source string",
  "timestamp": "2017-06-15T11:30:47.372000+00:00",
  "url": "http://example.com/translate/test/test/cs/?checksum=6412684aaf018e8e",
  "component": "test",
  "translation": "cs",
  "source": ["Hello, world!\n"]
}

リソース更新イベント:

{
  "id": 6,
  "action": "Resource update",
  "timestamp": "2017-06-15T11:30:47.410000+00:00",
  "url": "http://example.com/projects/test/test/cs/",
  "project": "test",
  "component": "test",
  "translation": "cs"
}
{
  "id": 7,
  "action": "Resource update",
  "timestamp": "2017-06-15T11:30:47.510000+00:00",
  "url": "http://example.com/projects/test/test/de/",
  "project": "test",
  "component": "test",
  "translation": "de"
}
{
  "id": 8,
  "action": "Resource update",
  "timestamp": "2017-06-15T11:30:47.595000+00:00",
  "url": "http://example.com/projects/test/test/it/",
  "project": "test",
  "component": "test",
  "translation": "it"
}

プロジェクト削除イベント:

{
  "id": 9,
  "action": "Removed project",
  "timestamp": "2019-10-17T15:57:08.559420+00:00",
  "target": "test",
  "user": "testuser"
}

新しい貢献者イベント:

{
  "id": 11,
  "action": "New contributor",
  "timestamp": "2019-10-17T15:57:08.759960+00:00",
  "url": "http://example.com/translate/test/test/cs/?checksum=6412684aaf018e8e",
  "author": "testuser",
  "user": "testuser",
  "project": "test",
  "component": "test",
  "translation": "cs",
  "source": ["Hello, world!\n"]
}

新規翻訳イベント:

{
  "id": 12,
  "action": "New translation",
  "timestamp": "2019-10-17T15:57:08.772591+00:00",
  "url": "http://example.com/translate/test/test/cs/?checksum=6412684aaf018e8e",
  "target": ["Ahoj svete!\n"],
  "author": "testuser",
  "user": "testuser",
  "project": "test",
  "component": "test",
  "translation": "cs",
  "source": ["Hello, world!\n"]
}

一括編集

アドオン ID:

weblate.flags.bulk

設定:

q

検索文字列

state

翻訳状態の設定

設定できる値:

-1

変更しない

10

要修正

11

要修正(要改稿)

12

要修正(要確認)

20

翻訳済み

30

承認済み

add_flags

追加する翻訳フラグ

remove_flags

削除する翻訳フラグ

add_labels

追加するラベル

remove_labels

削除するラベル

トリガー:

アドオンのインストールコンポーネントの更新

文字列のフラグ、ラベル、状態を一括編集します。

例:

新しい文字列に自動的にラベルを生成

検索クエリ

NOT has:label

追加するラベル

recent

アプリ ストアのメタデータ ファイル の変更履歴 エントリを、すべて翻訳禁止にする

検索クエリ

language:en AND key:changelogs/

追加する翻訳フラグ

read-only

特定の文字列を翻訳禁止にする

検索クエリ

source:r"^\`\`[.a-zA-Z0-9_-]*\`\`$" AND language:en

追加する翻訳フラグ

read-only

未翻訳の翻訳文に "要改稿" フラグを付ける

アドオン ID:

weblate.flags.same_edit

設定:

このアドオンには設定はありません。

トリガー:

ユニットの事前作成

VCS からインポートされた新しい翻訳可能な文字列が原文と同一のとき、Weblate は "要改稿" フラグを付けます。特に、未翻訳の文字列は原文で埋めるファイル形式では有用です。

ヒント

また、翻訳フラグstrict-same フラグを追加して、未翻訳の翻訳文 検査を強化できます。

新しい原文に "要確認" フラグを付ける

アドオン ID:

weblate.flags.source_edit

設定:

このアドオンには設定はありません。

トリガー:

ユニットの事前作成

新しい原文を VCS からインポートするときに、Weblate で "要確認" フラグを付けます。これにより、開発者が作成した原文を簡単に絞り込んで編集できます。

新しい翻訳に "要改稿" フラグを付ける

アドオン ID:

weblate.flags.target_edit

設定:

このアドオンには設定はありません。

トリガー:

ユニットの事前作成

新しい翻訳可能な文章を VCS からインポートするときに、Weblate で "要改稿" フラグを付けます。これにより、開発者が作成した翻訳文を簡単に絞り込んで編集できます。

リポジトリから更新された翻訳文に "要改稿" フラグを付ける

アドオン ID:

weblate.flags.target_repo_update

設定:

このアドオンには設定はありません。

トリガー:

ユニット同期後

VCS(バージョン管理システム)で文字列の翻訳文が変更されると、Weblate では "要改稿" フラグが付けられます。 翻訳ファイルを手動で更新したり、外部サービスで更新したりする場合に特に便利です.

読み取り専用の文字列を原文で埋める

Added in version 4.18.

アドオン ID:

weblate.generate.fill_read_only

設定:

このアドオンには設定はありません。

トリガー:

アドオンのインストールコンポーネントの更新毎日

文字列が編集禁止の場合は、原文を翻訳に代入します。

統計データの生成

アドオン ID:

weblate.generate.generate

設定:

filename

生成ファイルの名前

template

生成ファイルの内容

トリガー:

アドオンのインストールリポジトリのコミット前

翻訳状況の詳細情報ファイルを生成します。

Django テンプレートは、ファイル名とコンテンツの両方で使用できます。マークアップの詳細については、テンプレート用のマークアップ を確認してください。

例えば、各翻訳の概要ファイルの生成:

生成ファイルの名前

locale/{{ language_code }}.json

内容
{
   "language": "{{ language_code }}",
   "strings": "{{ stats.all }}",
   "translated": "{{ stats.translated }}",
   "last_changed": "{{ stats.last_changed }}",
   "last_author": "{{ stats.last_author }}",
}

事前に原文を翻訳に代入

Added in version 4.11.

アドオン ID:

weblate.generate.prefill

設定:

このアドオンには設定はありません。

トリガー:

アドオンのインストールコンポーネントの更新毎日

初期値として原文を翻訳に代入する。

All untranslated strings in the component will be filled with the source string, and marked as needing edit. Use this when you can not have empty strings in the translation files. .. AUTOGENERATED START: weblate.generate.pseudolocale .. This section is automatically generated by ./manage.py list_addons. Do not edit manually.

疑似ロケールの生成

Added in version 4.5.

アドオン ID:

weblate.generate.pseudolocale

設定:

source

原文

target

翻訳先

この言語の翻訳は全て上書きされます

prefix

先頭に追加する定型文

var_prefix

先頭に追加する可変文言

suffix

末尾に追加する定型文

var_suffix

末尾に追加する可変文言

var_multiplier

可変文言を繰り返す回数

原文の文字列の長さに応じて、可変文言を繰り返す回数。

include_readonly

翻訳禁止の文字列を含める

トリガー:

アドオンのインストールコンポーネントの更新毎日

原文に接頭辞と接尾辞を自動的に追加して、翻訳を生成します。

疑似ロケールは、翻訳対象になっていない文字列を探すのに便利です。すべての翻訳可能な原文を変更したあと、アプリケーションを疑似ロケールで実行して、置き換えられていない文字列を簡単に見つけることができます。

また、現地語化したときにレイアウトが崩れるかもしれない文字列も発見できます。

可変部分を使用すると、原文の長さに基づいてテキストが拡張し、現地語化の後にユーザー インターフェイスに収まらないことがある文字列を探せます。可変文字列は、テキストの長さに係数を掛けた回数繰り返します。たとえば、可変文字列が _ で係数が 1 だと Hello world は、Hello world___________ になります。 — この文字列は、原文の文字ごとに 1 回繰り返します。

文字列の生成に使用されるパターン:

先頭に追加する固定文字列 先頭に追加する可変文字列 原文 末尾に追加する可変文字列 末尾に追加する固定文字列

ヒント

テストには実際の言語を使用できますが、 Weblate には専用の疑似ロケール( en_XAar_XB )が用意されています。

ヒント

このアドオンを使用して、既存の言語または類似の言語の新しい言語への翻訳を開始できます。コンポーネントに翻訳を追加したら、アドオンに従います。例: fr があり、fr_CA の翻訳を開始する場合、ソースに fr、ターゲットには fr_CA を設定し、接頭辞と接尾辞を空白にするだけです。

コピー後に作成した翻訳を Weblate に変更されないように、新しい翻訳が入力されたらアドオンをアンインストールしてください。

コメント内の貢献者情報

アドオン ID:

weblate.gettext.authors

設定:

このアドオンには設定はありません。

トリガー:

リポジトリのコミット前

PO ファイルヘッダーのコメントを更新し、貢献者名と貢献した西暦を追加します。

PO ファイルヘッダーは次のようになる:

# Michal Čihař <michal@weblate.org>, 2012, 2018, 2019, 2020.
# Pavel Borecki <pavel@example.com>, 2018, 2019.
# Filip Hron <filip@example.com>, 2018, 2019.
# anonymous <noreply@weblate.org>, 2019.

configure ファイルの ALL_LINGUAS 変数の更新

アドオン ID:

weblate.gettext.configure

設定:

このアドオンには設定はありません。

トリガー:

アドオンのインストール, 毎日, リポジトリ追加後, Repository post-remove

翻訳が追加または削除された場合に、"configure"、"configure.in"、または "configure.ac" 内の ALL_LINGUAS 変数を更新します。

Updates the ALL_LINGUAS variable in configure, configure.in or any configure.ac files, when a translation is added or removed.

gettext 出力のカスタマイズ

Removed in version 5.13: ファイル形式パラメータ に置き換えられました。

gettext テンプレートの更新(Django)

Added in version 5.17.

アドオン ID:

weblate.gettext.django

設定:

interval

更新間隔

コンポーネントの更新時に、アドオンが POT ファイルを更新する間隔。

設定できる値:

daily

毎日

weekly

毎週

monthly

毎月

normalize_header

POT ヘッダーの正規化

gettext ヘッダーを更新し、POT 内のプレースホルダーのコメントを置き換えます。

トリガー:

アドオンのインストール, Manual trigger, リポジトリの更新後

Django の組み込みコマンドである makemessages を使用して、gettext テンプレート(POT ファイル)を更新します。

This add-on updates the template configured in 新しい翻訳のテンプレート. It is available for gettext PO components, and the component must define a template for new translations.

The selected update frequency applies to automatic runs after repository refreshes. Installing or reconfiguring the add-on runs it immediately, and manual runs from add-on management or the API also bypass the frequency schedule. After a successful update, Weblate commits the changed template and reloads source strings.

The template update does not update translation PO files by itself. Keep POT に合わせて PO ファイルを更新 (msgmerge) installed when translation files should follow template changes automatically. The install form for this add-on can install that add-on, but existing add-on settings do not show that installation option again.

Django requirements

This add-on requires xgettext and msguniq. It runs Weblate's internal extraction wrapper for Django messages instead of invoking a project's manage.py makemessages, so it does not load project Django settings or applications.

The template for new translations must use the django or djangojs domain. Supported template names are django.pot, djangojs.pot, django.po, and djangojs.po. Weblate infers the source directory from the template path and skips repository locale directories while extracting.

LINGUAS ファイルの更新

アドオン ID:

weblate.gettext.linguas

設定:

このアドオンには設定はありません。

トリガー:

アドオンのインストール, 毎日, リポジトリ追加後, Repository post-remove

翻訳者が追加または削除された場合、LINGUASファイルを更新します。

POT ファイルの更新(Meson)

Added in version 5.17.

アドオン ID:

weblate.gettext.meson

設定:

interval

更新間隔

コンポーネントの更新時に、アドオンが POT ファイルを更新する間隔。

設定できる値:

daily

毎日

weekly

毎週

monthly

毎月

normalize_header

POT ヘッダーの正規化

gettext ヘッダーを更新し、POT 内のプレースホルダーのコメントを置き換えます。

comment_mode

コードコメント

xgettext がコメントを抽出しない、すべて抽出する、または特定のタグ付きコメントのみ抽出するかを選択します。

設定できる値:

off

コメントを抽出しません

all

すべてのコメントを抽出します

tagged

指定したタグ付きのコメントを抽出します

comment_tag

コメントタグ

タグ付きコメント モードで抽出する際に xgettext に渡すタグです。

checks

xgettext 検査

抽出されたメッセージに対して有効にする追加の xgettext 検証です。

設定できる値:

ellipsis-unicode

ellipsis-unicode

space-ellipsis

space-ellipsis

quote-unicode

quote-unicode

bullet-unicode

bullet-unicode

keyword

追加キーワード

xgettext に --keyword で渡す任意の追加キーワードです。

preset

Meson プリセット

Meson の gettext 連携に対応した、組み込みの xgettext 引数プリセットです。GLib プリセットは、Meson の gettext ヘルパーが使用する keyword オプションや format-flag オプションを追加します。

設定できる値:

glib

GLib

トリガー:

アドオンのインストール, Manual trigger, リポジトリの更新後

Meson の gettext 規約に従って、gettext テンプレート(POT ファイル)を更新します。

This add-on updates the template configured in 新しい翻訳のテンプレート. It is available for gettext PO components, and the component must define a template for new translations.

The selected update frequency applies to automatic runs after repository refreshes. Installing or reconfiguring the add-on runs it immediately, and manual runs from add-on management or the API also bypass the frequency schedule. After a successful update, Weblate commits the changed template and reloads source strings.

The template update does not update translation PO files by itself. Keep POT に合わせて PO ファイルを更新 (msgmerge) installed when translation files should follow template changes automatically. The install form for this add-on can install that add-on, but existing add-on settings do not show that installation option again.

Meson requirements

This add-on requires xgettext; it does not invoke Meson. It follows Meson gettext conventions by reading POTFILES or POTFILES.in from the gettext directory and passing the GLib keyword and format-flag preset to xgettext.

The gettext directory is the directory containing the template configured in 新しい翻訳のテンプレート. It must contain meson.build and POTFILES or POTFILES.in. A Meson project meson.build must be present in that directory or one of its parent directories. If both POTFILES and POTFILES.in exist, POTFILES is used. An adjacent POTFILES.skip excludes listed source files from extraction.

Configure this add-on from the existing Meson gettext setup. In most Meson projects, the gettext directory is po/, the template is named after the gettext domain, and po/meson.build calls Meson's gettext helper. Use the same template path in 新しい翻訳のテンプレート, for example po/example.pot, and keep POTFILES or POTFILES.in next to that meson.build file.

Weblate does not read the source file list from meson.build. It uses POTFILES or POTFILES.in, matching Meson's gettext convention. When the Meson project uses a non-default gettext directory or domain, mirror that layout in the component template path.

MO ファイルの生成

アドオン ID:

weblate.gettext.mo

設定:

path

生成された MO ファイルのパス

指定しない場合は、PO ファイルの場所を使用します。

fuzzy

要修正な文字列を含める

要修正(あいまい)な文字列は、通常、翻訳として使用できる状態ではありません。

トリガー:

リポジトリのコミット前

変更された PO ファイルごとに自動的に MO ファイルを生成します。

MO ファイルが生成される場所はカスタマイズでき、フィールドは テンプレート用のマークアップ を使用します。

注釈

翻訳が削除されると、その PO ファイルはリポジトリから削除されますが、このアドオンによって生成された MO ファイルは削除されません。 MO ファイルは、上流リポジトリから手動で削除してください。

POT に合わせて PO ファイルを更新 (msgmerge)

バージョン 5.13 で変更: Settings 設定は ファイル形式パラメータ に移動しました。

アドオン ID:

weblate.gettext.msgmerge

設定:

このアドオンには設定はありません。

トリガー:

アドオンのインストールリポジトリの更新後

msgmerge を使用して、すべての PO ファイル(「ファイルマスク」の設定内容)を、POT ファイル(「新しい翻訳用テンプレート」の設定内容)と整合するように更新します。

このアドオンは、gettext の PO ファイルを扱う際に不可欠です。POT(テンプレート)ファイルに新しい文字列の追加や既存文字列の変更があった場合、リポジトリ内の POT ファイルが更新されると、このアドオンがすべての言語の PO ファイルに対して自動的に変更をマージし、次のことを保証します:

  • 新しい翻訳対象文字列を、すべての言語に表示します

  • 削除された文字列は廃止としてマークします

  • 変更した文字列を査読(あいまい)が必要とマークします

Most msgmerge command-line options can be set up through file format parameters configuration. Enable the po_remove_obsolete parameter to remove obsolete #~ entries when PO files are saved.

POT ファイルの更新(Sphinx)

Added in version 5.17.

アドオン ID:

weblate.gettext.sphinx

設定:

interval

更新間隔

コンポーネントの更新時に、アドオンが POT ファイルを更新する間隔。

設定できる値:

daily

毎日

weekly

毎週

monthly

毎月

normalize_header

POT ヘッダーの正規化

gettext ヘッダーを更新し、POT 内のプレースホルダーのコメントを置き換えます。

filter_mode

絞り込み

オプションで、Sphinx による抽出後、翻訳に不要な文字列を削除します。

設定できる値:

none

なし

weblate_docs

Weblateのドキュメント

トリガー:

アドオンのインストール, Manual trigger, リポジトリの更新後

Sphinx の gettext ビルダーをプロジェクト設定を読み込まずに実行し、gettext テンプレート(POT ファイル)を更新します。

This add-on updates the template configured in 新しい翻訳のテンプレート. It is available for gettext PO components, and the component must define a template for new translations.

The selected update frequency applies to automatic runs after repository refreshes. Installing or reconfiguring the add-on runs it immediately, and manual runs from add-on management or the API also bypass the frequency schedule. After a successful update, Weblate commits the changed template and reloads source strings.

The template update does not update translation PO files by itself. Keep POT に合わせて PO ファイルを更新 (msgmerge) installed when translation files should follow template changes automatically. The install form for this add-on can install that add-on, but existing add-on settings do not show that installation option again.

Sphinx requirements

This add-on requires sphinx-build, provided by the sphinx installation extra. The template for new translations must be a .pot file below a locales directory. The directory before locales is used as the Sphinx source directory and must contain conf.py.

Extraction uses Weblate's bundled Sphinx configuration and does not load the project configuration. Weblate runs the Sphinx gettext builder, normalizes source references to paths relative to the source directory, and copies the generated template back to the configured template path.

POT ファイルの更新(xgettext)

Added in version 5.17.

アドオン ID:

weblate.gettext.xgettext

設定:

interval

更新間隔

コンポーネントの更新時に、アドオンが POT ファイルを更新する間隔。

設定できる値:

daily

毎日

weekly

毎週

monthly

毎月

normalize_header

POT ヘッダーの正規化

gettext ヘッダーを更新し、POT 内のプレースホルダーのコメントを置き換えます。

comment_mode

コードコメント

xgettext がコメントを抽出しない、すべて抽出する、または特定のタグ付きコメントのみ抽出するかを選択します。

設定できる値:

off

コメントを抽出しません

all

すべてのコメントを抽出します

tagged

指定したタグ付きのコメントを抽出します

comment_tag

コメントタグ

タグ付きコメント モードで抽出する際に xgettext に渡すタグです。

checks

xgettext 検査

抽出されたメッセージに対して有効にする追加の xgettext 検証です。

設定できる値:

ellipsis-unicode

ellipsis-unicode

space-ellipsis

space-ellipsis

quote-unicode

quote-unicode

bullet-unicode

bullet-unicode

keyword

追加キーワード

xgettext に --keyword で渡す任意の追加キーワードです。

input_mode

入力ソース

xgettext が原文ファイルを、glob パターンから読み込むか、POTFILES / POTFILES.in マニフェストから読み込むかを選択します。

設定できる値:

patterns

原文ファイルのパターン

potfiles

POTFILES マニフェスト

language

xgettext の言語

Programming language passed to xgettext, for example Python or C. Leave blank to let xgettext guess the language from file extensions.

source_patterns

原文ファイルのパターン

xgettext で抽出するファイルを指定する、リポジトリ相対の glob パターンを改行区切りで入力します。

potfiles_path

POTFILES のパス

POTFILES または POTFILES.in へのリポジトリ相対パスを指定します。エントリはリポジトリのルートを基準に決定します。マニフェストと同じ場所に POTFILES.skip が存在する場合、記載されたファイルは抽出対象から除外します。

トリガー:

アドオンのインストール, Manual trigger, リポジトリの更新後

選択したソース ファイルに対して xgettext を実行し、gettext テンプレート(POT ファイル)を更新します。

This add-on updates the template configured in 新しい翻訳のテンプレート. It is available for gettext PO components, and the component must define a template for new translations.

The selected update frequency applies to automatic runs after repository refreshes. Installing or reconfiguring the add-on runs it immediately, and manual runs from add-on management or the API also bypass the frequency schedule. After a successful update, Weblate commits the changed template and reloads source strings.

The template update does not update translation PO files by itself. Keep POT に合わせて PO ファイルを更新 (msgmerge) installed when translation files should follow template changes automatically. The install form for this add-on can install that add-on, but existing add-on settings do not show that installation option again.

xgettext requirements

This add-on requires xgettext. Configure either source file patterns or a POTFILES / POTFILES.in manifest. Source file patterns are repository-relative glob patterns and only matching repository files are passed to xgettext.

Entries in POTFILES or POTFILES.in are resolved relative to the repository root. They must be relative paths, stay inside the repository, and point to existing files. Blank lines and lines starting with # are ignored. If a POTFILES.skip file exists next to the manifest, its entries are excluded from extraction.

Automatic repository refresh runs are skipped unless the changed files match the configured source patterns, match files listed in the manifest, change a watched manifest, or change the add-on configuration.

Start from the build-system extraction setup when configuring this add-on. Autotools projects usually keep gettext inputs in po/POTFILES.in and options such as the gettext domain and xgettext flags in po/Makevars or related Makefile.am files. Use manifest mode with the same POTFILES.in when its entries are plain repository-relative source paths, and copy relevant extraction behavior into the add-on settings, for example the language, comment extraction, checks, and additional keyword.

For other build systems, use the source list or extraction command they already run as the source of truth. CMake, custom Makefiles, npm scripts, or project specific extraction scripts often call xgettext directly or generate an intermediate file list. Configure source patterns for simple layouts, or use manifest mode when the project maintains a plain file list. If a build-system manifest contains transformations or prefixes that are not file paths, convert it to plain repository-relative paths before using it as POTFILES.

Git コミットのスカッシュ

アドオン ID:

weblate.git.squash

設定:

squash

コミットのスカッシュ

設定できる値:

all

すべてのコミットを 1 つに統合

language

言語別

file

ファイル別

author

翻訳者別

append_trailers

スカッシュしたコミット メッセージに翻訳者情報を追加する

トレーラ行とは、RFC 822 のメール ヘッダーに似た "Co-authored-by: …" のような行のことで、コミットメッセージの自由形式部分の末尾につきます。

commit_message

コミットメッセージ

このコミットメッセージは、スカッシュしたコミットのコミットメッセージを結合する代わりに使用されます。

トリガー:

アドオンのインストールリポジトリのコミット後

変更をプッシュする前に、Git コミットをスカッシュします。

ヒント

不要な競合を避けるために、Webhook や API を使用して上流の変更を自動的に受信するよう設定してください。参照: リポジトリの更新

変更をプッシュする前に Git コミットの内容を簡略化するモードの種類:

  • すべてのコミットを 1 つに統合

  • 言語別

  • ファイル別

  • 翻訳者別

元々のコミット メッセージは保持されますが、翻訳者別 を選択するか、コミット メッセージに含めるようカスタマイズしない限り、翻訳者の情報は失われます。

元々のコミット メッセージは、オプションを使用すると独自のコミット メッセージに書き換えられます。

オプションを使用して、元のコミット メッセージからトレーラー(Co-authored-by: のような行)を切り取り、スカッシュコミットのコミットメッセージの末尾に追加できます。これにより、共同翻訳者全員が、Co-authored-by: として、適切にクレジットされます。

JSON 出力形式のカスタマイズ

バージョン 5.12 で変更: Avoid spaces after separators オプションが追加されました。

Removed in version 5.13: ファイル形式パラメータ に置き換えられました。

リポジトリを上流にリセット

Added in version 5.17.

アドオン ID:

weblate.hosted.reset

設定:

このアドオンには設定はありません。

トリガー:

アドオンのインストール毎日

毎晩、Weblate リポジトリ内のすべての変更を破棄します。

Java プロパティ ファイルの整形

アドオン ID:

weblate.properties.sort

設定:

case_sensitive

大文字と小文字を区別したキーの並べ替えを有効にする

トリガー:

リポジトリのコミット前

Java プロパティ ファイルを整形およびソートします。

  • 改行を Unix の改行コードに統一する。

  • Unicode エスケープ シーケンスを大文字に整形する(存在する場合)。

  • 空白行とコメントを削除する。

  • 文字列をキーでソートする。

  • 重複する文字列を削除する。

古いコメントの削除

アドオン ID:

weblate.removal.comments

設定:

age

保存日数

トリガー:

アドオンのインストール毎日

コメントを削除するまでの期間を設定します。

これは、古くなった可能性のある古いコメントを削除する場合に便利です。コメントが古いからといって、その重要性が失われたわけではないので、注意して使用してください。

古い提案の削除

アドオン ID:

weblate.removal.suggestions

設定:

age

保存日数

votes

投票数のしきい値

削除のしきい値です。空欄の場合、投票数に関係なく提案を削除します。投票が無効になっている場合、この項目は効果がありません。

トリガー:

アドオンのインストール毎日

提案を削除するまでの期間を設定します。

与えられた時間枠内に必要な賛成票を獲得できなかった提案への投票(参照: 相互評価)を削除するのに大変便利です。

RESX ファイルの更新

アドオン ID:

weblate.resx.update

設定:

このアドオンには設定はありません。

トリガー:

アドオンのインストールリポジトリの更新後

すべての翻訳ファイルを、上流にあるモノリンガル用の基礎となる翻訳ファイルと整合するように更新します。使われない文字列は削除され、新しい文字列は原文をコピーして追加されます。

ヒント

古い翻訳キーのみを削除する場合は、翻訳ファイルのクリーンアップ を使用します。

Slack 用 Webhook

Added in version 5.12.

アドオン ID:

weblate.webhook.slack

設定:

webhook_url

ウェブフック URL

event_filter

Change events to trigger

Choose which change events should trigger this add-on. Change events to trigger

events

Selected change events

Selected change events

トリガー:

変更イベント

選択したイベントに基づいて Slack チャンネルに通知を送信します。

警告

通知に HTML タグが表示されることがあります。問題は把握しており、まもなく修正できる見込みです。参照: https://github.com/WeblateOrg/weblate/issues/15056

ヒント

Webhook URLを取得するには、Slack 着信 Webhook ドキュメント に記載されている手順に従ってください

Webhook

Added in version 5.11.

バージョン 5.15 で変更: シークレットの長さが仕様に準拠しているかどうかが検証されるようになりました。

アドオン ID:

weblate.webhook.webhook

設定:

webhook_url

ウェブフック URL

secret

Webhook シークレット

標準の Webhooks シークレットは、Base64 でエンコードされた文字列です。

event_filter

Change events to trigger

Choose which change events should trigger this add-on. Change events to trigger

events

Selected change events

Selected change events

トリガー:

変更イベント

Standard Webhooks 仕様に準拠して、選択したイベントに基づいて外部サービスに通知を送信します。

The request payload complies with the Weblate Messaging schema. The action field uses the action name listed in Selected change events. The OpenAPI description can also be found at /api/docs/. Sample request body:

{
   "change_id": 99,
   "action": "Translation changed",
   "timestamp": "2019-08-24T14:15:22Z",
   "target": "Nazdar svete!",
   "old": "Nazdar!",
   "source": "Hello, world",
   "url": "/translate/project-slug/component-slug/cs/?checksum=46add148a53cab6f",
   "author": "author-username",
   "user": "user-username",
   "project": "project-slug",
   "component": "component-slug",
   "translation": "cs"
}

カテゴリを含むリクエスト本文の例:

{
   "change_id": 8910,
   "action": "Component renamed",
   "timestamp": "2025-06-11T07:15:09Z",
   "target": ["new-name"],
   "old": ["component-slug"],
   "url": "/projects/project-slug/parent-category/child-category/sub-category/component-slug/",
   "user": "testuser",
   "project": "project-slug",
   "component": "component-slug",
   "category": [
      "sub-category",
      "child-category",
      "parent-category"
   ]
}

リクエスト ヘッダーの例:

{
   "webhook-id": "7f1c5477f6275a69af7b83236c20cb1a",
   "webhook-timestamp": "1748505623.044281",
   "webhook-signature": "v1,Ceo5qEr07ixe2NLpvHk3FH9bwy/WavXrAFQ/9tdO6mc="
}

webhook-signature は、secret 文字列、リクエストペイロード、webhook-timestampwebhook-id を用いて生成された HMAC 署名のスペース区切りリストです。これにより、Webhook リクエストの認証と整合性が保証されます。

提供される シークレット は、24 バイト(192 ビット)から 64 バイト(512 ビット)までの base64 エンコードされた文字列です。識別を容易にするため、whsec_ を接頭辞として付けることができます。

リクエストの検証には、standardwebhooks ライブラリの Webhook.verify メソッド、または「Standard Webhooks Specification」の実装を使用します。

廃止されたアドオン

XML 出力形式のカスタマイズ

Added in version 4.15.

Removed in version 5.13: ファイル形式パラメータ に置き換えられました。

YAML 出力形式のカスタマイズ

Removed in version 5.13: ファイル形式パラメータ に置き換えられました。

共通のアドオンパラメータ

機械翻訳エンジン

設定できる値:

alibaba

Alibaba

aws

Amazon Translate

anthropic

Anthropic

apertium-apy

Apertium APy

microsoft-translator

Azure AI Translator

azure-openai

Azure OpenAI

baidu

Baidu

cyrtranslit

CyrTranslit

deepl

DeepL

glosbe

Glosbe

google-translate-api-v3

Google Cloud Translation Advanced

google-translate

Google Cloud Translation Basic

ltengine

LTEngine

libretranslate

LibreTranslate

mistral

Mistral

modernmt

ModernMT

mymemory

MyMemory

netease-sight

Netease Sight

ollama

Ollama

openai

OpenAI

sap-translation-hub

SAP Translation Hub

systran

シストラン

weblate

Weblate

weblate-translation-memory

Weblate 翻訳メモリ

yandex

Yandex

yandex-v2

Yandex v2

youdao-zhiyun

Youdao Zhiyun

tmserver

tmserver

ファイル形式

設定できる値:

apple-xliff

Apple 拡張付き XLIFF 1.2

appstore

アプリ ストアのメタデータ ファイル

arb

ARB ファイル

aresource

Android 文字列リソース

asciidoc

AsciiDoc ファイル

ass

Advanced Substation Alpha 字幕ファイル

catkeys

Haiku の catkeys

cmp-resource

Compose Multiplatform リソース

csv

CSV ファイル

csv-multi

複数値 CSV ファイル

csv-simple

シンプルな CSV ファイル

dokuwiki

DokuWiki テキスト ファイル

dtd

DTD ファイル

flatxml

Flat XML ファイル

fluent

Fluent ファイル

formatjs

Format.JS JSON ファイル

go-i18n-json

go-i18n v1 JSON ファイル

go-i18n-json-v2

go-i18n v2 JSON ファイル

go-i18n-toml

go-i18n TOML ファイル

gotext

gotext JSON ファイル

gwt

GWT プロパティ

html

HTML ファイル

i18next

i18next JSON v3 ファイル

i18nextv4

i18next JSON v4 ファイル

idml

IDML ファイル

ini

INI ファイル

islu

Inno Setup INI ファイル

joomla

Joomla 言語ファイル

json

JSON ファイル

json-nested

JSON ネスト構造ファイル

laravel

Laravel PHP 文字列

markdown

Markdown ファイル

mdx

MDX ファイル

mediawiki

MediaWiki テキスト ファイル

mi18n-lang

@draggable/i18n lang ファイル

moko-resource

モバイル Kotlin リソース

nextcloud-json

Nextcloud JSON ファイル

odf

OpenDocument ファイル

php

PHP 文字列

plainxliff

XLIFF 1.2 翻訳ファイル

po

gettext PO ファイル

po-mono

gettext PO ファイル(モノリンガル)

poxliff

gettext 拡張機能に対応した XLIFF 1.2

properties

Java プロパティ

rc

RC ファイル

resjson

RESJSON ファイル

resourcedictionary

ResourceDictionary ファイル

resx

.NET リソース ファイル

ruby-yaml

Ruby YAML ファイル

srt

SubRip 字幕ファイル

ssa

Substation Alpha 字幕ファイル

strings

iOS の文字列

stringsdict

Stringsdict ファイル

sub

MicroDVD 字幕ファイル

tbx

TermBase eXchange ファイル

toml

TOML ファイル

ts

Qt Linguist 翻訳ファイル

txt

プレーン テキスト ファイル

webextension

WebExtension JSON ファイル

wxl

WixLocalization ファイル

xliff

placeables に対応した XLIFF 1.2

xliff2

XLIFF 2.0 翻訳ファイル

xliff2-placeables

XLIFF 2.0 翻訳ファイル(プレースホルダー対応)

xlsx

Excel Open XML

xwiki-fullpage

XWiki フルページ

xwiki-java-properties

XWiki の Java プロパティ

xwiki-page-properties

XWiki ページのプロパティ

yaml

YAML ファイル

Change events to trigger

設定できる値:

content

Translation content events

all

All change events

custom

Selected change events

Selected change events

The following change actions can appear in notification payloads. Fedora Messaging uses the identifier column in message topics, while webhook payloads use the name column in the action field.

設定できる値:

ID

Identifier

名前

0

resource_updated

リソース更新

1

translation_completed

翻訳完了

2

translation_changed

翻訳の変更

3

comment_added

コメントの追加

4

suggestion_added

提案の追加

5

translation_added

翻訳追加

6

automatically_translated

自動翻訳された文字列

7

suggestion_accepted

提案の採用

8

translation_reverted

翻訳の差し戻し

9

translation_uploaded

翻訳のアップロード

13

source_string_added

原文追加

14

component_locked

コンポーネントのロック

15

component_unlocked

コンポーネントのアンロック

17

changes_committed

変更のコミット

18

changes_pushed

変更のプッシュ

19

repository_reset

リポジトリのリセット

20

repository_merged

リポジトリ統合

21

repository_rebased

リポジトリのリベース

22

repository_merge_failed

リポジトリのマージに失敗

23

repository_rebase_failed

リポジトリのリベースに失敗

24

parsing_failed

解析に失敗

25

translation_removed

翻訳の削除

26

suggestion_removed

提案の削除

27

translation_replaced

翻訳の置換

28

repository_push_failed

リポジトリのプッシュに失敗

29

suggestion_removed_during_cleanup

クリーンアップ処理での提案の削除

30

source_string_changed

原文の変更

31

string_added

文字列追加

32

bulk_status_changed

状態の一括変更

33

visibility_changed

アクセス制御の変更

34

user_added

ユーザー追加

35

user_removed

ユーザー削除

36

translation_approved

翻訳の承認

37

marked_for_edit

要修正としてマーク

38

component_removed

コンポーネント削除

39

project_removed

プロジェクト削除

41

project_renamed

プロジェクト名変更

42

component_renamed

コンポーネント名変更

43

moved_component

コンポーネントの移動

45

contributor_joined

貢献者加入

46

announcement_posted

お知らせ掲載

47

alert_triggered

警告が発生しました

48

language_added

言語追加

49

language_requested

言語追加要求

50

project_created

プロジェクト作成

51

component_created

コンポーネント作成

52

user_invited

ユーザー招待

53

repository_notification_received

リポジトリ通知受信

54

translation_replaced_file_by_upload

ファイルアップロードによる翻訳置き換え

55

license_changed

ライセンスの変更

56

contributor_license_agreement_changed

貢献者ライセンス同意書の変更

57

screenshot_added

スクリーンショット追加

58

screenshot_uploaded

スクリーンショット アップロード

59

string_updated_in_the_repository

リポジトリでの文字列の更新

60

add-on_installed

アドオンのインストール

61

add-on_configuration_changed

アドオンの設定変更

62

add-on_uninstalled

アドオンのアンインストール

63

string_removed

文字列削除

64

comment_removed

コメント削除

65

comment_resolved

コメント解決

66

explanation_updated

解説の更新

67

category_removed

カテゴリー削除

68

category_renamed

カテゴリー名変更

69

category_moved

カテゴリー移動

70

saving_string_failed

文字列の保存失敗

71

string_added_in_the_repository

リポジトリに文字列の追加

72

string_updated_in_the_upload

アップロードでの文字列の更新

73

string_added_in_the_upload

アップロードでの文字列の追加

74

translation_updated_by_source_upload

原文アップロードによる翻訳更新

75

component_translation_completed

コンポーネント翻訳完了

76

applied_enforced_check

検査の強制を適用

77

propagated_change

変更の反映

78

file_uploaded

ファイルアップロード

79

extra_flags_updated

追加フラグの更新

80

font_uploaded

ファイルをアップロードしました

81

font_changed

フォントを変更しました

82

font_removed

フォントを削除しました

83

forced_synchronization_of_translations

翻訳の強制同期

84

forced_rescan_of_translations

翻訳の強制再読込

85

screenshot_removed

スクリーンショットが削除されました

86

label_added

ラベルが追加されました

87

label_removed

ラベルが削除されました

88

repository_cleanup

リポジトリのクリーンアップ

89

source_string_added_in_the_upload

アップロードで追加された原文

90

source_string_added_in_the_repository

リポジトリで追加された原文

91

project_backed_up

プロジェクトをバックアップしました

92

project_restored

プロジェクトを復元しました

93

component_restored

コンポーネントを復元しました

94

user_edit_reverted

ユーザーの編集を元に戻しました

95

project_setting_changed

Project setting changed

96

component_setting_changed

Component setting changed

97

user_access_changed

User access changed

98

workspace_created

Workspace created

99

workspace_setting_changed

Workspace setting changed

100

project_moved

Project moved

アドオン一覧のカスタマイズ

アドオンの一覧は WEBLATE_ADDONS で設定します。アドオンを追加するには、設定に絶対クラス名を含めるだけです。

アドオンの作成

独自のアドオンも作成できます。サブクラス weblate.addons.base.BaseAddon を作成してアドオンのメタデータを定義し、処理を行うコールバックを実装します。

アドオンから実行するスクリプト

アドオンは、外部スクリプトを実行するためにも使用できます。以前は Weblate に統合されていましたが、現在はスクリプトをアドオンでラップするコードの記述が必要です。

# Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later

"""Example pre commit script."""

from __future__ import annotations

from typing import ClassVar

from django.utils.translation import gettext_lazy

from weblate.addons.events import AddonEvent
from weblate.addons.scripts import BaseScriptAddon


class ExamplePreAddon(BaseScriptAddon):
    # Event used to trigger the script
    events: ClassVar[set[AddonEvent]] = {
        AddonEvent.EVENT_PRE_COMMIT,
    }
    # Name of the addon, has to be unique
    name = "weblate.example.pre"
    # Verbose name and long description
    verbose = gettext_lazy("Execute script before commit")
    description = gettext_lazy("This add-on executes a script.")

    # Script to execute
    script = "/bin/true"
    # File to add in commit (for pre commit event)
    # does not have to be set
    add_file = "po/{{ language_code }}.po"

インストールの方法は 品質検査、アドオン、自動提案、自動修正のカスタマイズ を確認してください。

スクリプトは、指定したコンポーネントの VCS リポジトリのルートを、カレント ディレクトリとして実行されます。

さらに利用可能な環境変数:

WL_VCS

使用中のバージョン管理システム。

WL_REPO

上流リポジトリの URL。

WL_PATH

VCS リポジトリへの絶対パス。

WL_BRANCH

現在のコンポーネントに設定したリポジトリのブランチ。

WL_FILEMASK

現在のコンポーネントのファイルマスク。

WL_TEMPLATE

モノリンガル翻訳用のテンプレートのファイル名(空欄でも可)。

WL_NEW_BASE

新しい翻訳の作成用のファイル名(空欄でも可)。

WL_FILE_FORMAT

現在のコンポーネントで使用するファイル形式。

WL_LANGUAGE

現在実行中の翻訳言語(コンポーネント レベルのフックでは使用できません)。

WL_PREVIOUS_HEAD

更新前の HEAD(更新後のフックを実行した後にのみ利用可能)。

WL_COMPONENT_SLUG

コンポーネント URL の設定時に使用するスラッグ。

WL_PROJECT_SLUG

プロジェクト URL の設定時に使用するスラッグ。

WL_COMPONENT_NAME

コンポーネント名。

WL_PROJECT_NAME

プロジェクト名。

WL_COMPONENT_URL

コンポーネント URL。

WL_ENGAGE_URL

プロジェクト参加 URL。

リポジトリを更新後の処理

VCS の上流ソースが変更されたときに翻訳ファイルを更新するために使用できます。これを実現するには、 Weblate は VCS にコミットされたファイルだけを確認するので、スクリプトの一部として変更をコミットすることが必要であることに注意してください。

Gulp による実行例:

#! /bin/sh
gulp --gulpfile gulp-i18n-extract.js
git commit -m 'Update source strings' src/languages/en.lang.json

翻訳のコミット前処理

コミット スクリプトを使用して、翻訳文をリポジトリにコミットする前に、翻訳文を自動的に変更します。

これには、唯一の引数として現在の翻訳のファイル名が渡されます。

アドオン活動ログの記録

アドオン活動ログは、アドオンの実行を記録し、アドオンの活動を追跡するために使用できます。

ログは、ADDON_ACTIVITY_LOG_EXPIRY を設定して、一定の時間経過後に削除できます。