
Weblate は、Web ベースのサービスを連携して動作する翻訳システムであり、コピーレフトで保護された Libre ソフトウェアです。2500 件以上の Libre プロジェクトや、165 か国以上の企業で使用されています
インストールするか、Weblate のホストサービス weblate.org を利用してください。
サポート¶
Weblate は、有料のプロフェッショナル サポートとクラウド ホスティング サービスを備えた Libre ソフトウェアです。詳細については、https://weblate.org/hosting/ を確認してください。
ドキュメント¶
ソース コードは docs
ディレクトリ、もしくは https://docs.weblate.org/ にてオンラインで閲覧できます。
ライセンス¶
Copyright © 2012–2021 Michal Čihař michal@cihar.com
このプログラムはフリーソフトウェアです: あなたは、FreeSoftware Foundation によって発行された GNU General Public License のバージョン 3 または(ユーザーの選択により)それ以降のバージョンのいずれかの条件のもとで、プログラムの再配布または変更ができます。
このプログラムは有用であることを願って配布していますが、いかなる保証もありません。商品性や特定目的への適合性の暗黙の保証もありません。詳細は GNU General Public License を確認してください。
あなたは、このプログラムと共に、GNU General Public License のコピーを受け取っているはずです。そうでない場合は、 https://www.gnu.org/licenses/ を確認してください。
Weblate の基本¶
プロジェクトとコンポーネントの構造¶
Weblate では、翻訳はプロジェクトとコンポーネントで構成されています。各プロジェクトには複数のコンポーネントを含めることができ、コンポーネントには個々の言語への翻訳を含めることができます。コンポーネントは、翻訳可能な 1 つのファイル(例: GNU gettext や Android string resources)に対応します。プロジェクトは、コンポーネントを論理的なまとまりに分類(例えば、1 つのアプリケーション内で使用するすべての翻訳をグループ化)するのに便利です。
内部ではデフォルトで、各プロジェクトごとに、共通する文字列の翻訳はプロジェクト内の他のコンポーネントに自動反映させます。これにより、反復や複数バージョンの翻訳の負担を軽減します。コンポーネント独自の翻訳が望ましい場合は、翻訳の反映を Component configuration ごとに無効にできます。
登録とユーザー情報¶
登録¶
デフォルトでは、誰もがプロジェクトの閲覧、翻訳の表示、翻訳の提案ができます。実際に変更を保存できるのは、登録ユーザーのみであり、翻訳するたびに翻訳者名を自動的に署名します。
簡単に登録できる数ステップの手順:
登録フォームに資格情報を入力する。
受信したメールのリンクをクリックして、登録を有効にする。
必要に応じて、プロファイルを設定し、理解している言語を選択する。
ダッシュボード¶
サインインすると、各翻訳の進行状況とともに、プロジェクトとコンポーネントの概要が表示されます。
バージョン 2.5 で追加.
デフォルトでは、監視中のプロジェクトのコンポーネントと登録した言語がセットで表示されます。
ヒント
ナビゲーション タブから、別の表示に切り替えられます。

メニュー内のオプション:
メイン メニューの プロジェクト > すべてのプロジェクトの閲覧 に、Weblate インスタンスの各プロジェクトの翻訳状況を表示する。
メイン メニューの 言語 で言語を選択して、すべてのプロジェクトの翻訳状況に、設定した翻訳言語の状況を表示する。
ダッシュボードの 監視中の翻訳 に、設定した翻訳言語のみを監視中のプロジェクトの翻訳状況に表示する。
また、このドロップダウンには、Weblate 管理者が事前設定したプロジェクトのコンポーネントのセットである コンポーネント リストのセット を複数表示できます。参照: コンポーネント リスト。
個人用のデフォルトのダッシュボード画面は、ユーザー情報の 環境設定 セクションで設定できます。
注釈
settings.py
ファイル(参照: 設定)で SINGLE_PROJECT
を使用して Weblate を単一のプロジェクト用に設定している場合、ダッシュボードは表示されません。これは、ユーザーが単一のプロジェクトまたはコンポーネントにリダイレクトされるためです。
ユーザー情報¶
ユーザー情報にアクセスするには、トップメニューの右上にあるユーザー アイコンをクリックし、設定 メニューをクリックします。
ユーザー情報には、ユーザーの環境設定が含まれています。VCS コミットでは名前とメールアドレスを使用するため、この情報は正確に登録してください。
注釈
すべての言語の選択では、現在翻訳されている言語のみが提供されます。
ヒント
ボタンをクリックして、翻訳する他の言語をリクエストまたは追加し、使用可能にします。
言語¶
表示言語¶
UI を表示する言語を選択します。
環境設定¶
デフォルトのダッシュボード画面¶
環境設定 タブで、デフォルトで表示するダッシュボード画面を選択できます。コンポーネント リスト を選択した場合、デフォルトのコンポーネント リスト ドロップダウンから表示するコンポーネント リストを選択してください。
参考
エディタ リンク¶
ソース コードのリンクは、デフォルトでは Component configuration で設定した Web ブラウザに表示します。
ヒント
エディタ リンク を設定すると、ローカル エディターを使用して、翻訳した文字列の VCS ソース コードのファイルを表示します。テンプレート用のマークアップ を使用できます。
一般的には editor://open/?file={{filename}}&line={{line}}
が良い選択です。
参考
エディタの独自 URL プロトコルの登録の詳細は、Nette documentation を確認してください。
通知¶
通知 タブから複数の通知を受け取れます。監視中または管理中のプロジェクトで選択したイベントの通知は、メールで送信されます。
通知の中には、ユーザーの言語のイベントに対してのみ送信されるもの(例: 新しく翻訳した文字列)と、コンポーネントから起動するイベント(マージ エラーなど)があります。この 2 つの通知グループは、設定では見やすく分かれています。
監視中のプロジェクトと管理中のプロジェクトの通知を切り替えたり、プロジェクトやコンポーネントごとに詳細に設定(非通知など)にできます。コンポーネントの概要ページにアクセスし、監視中 メニューから適切な項目を選択します。
貢献したプロジェクトは自動的に監視する を有効にしていると、文字列を翻訳時に自動的にプロジェクトの監視を開始します。デフォルト値は DEFAULT_AUTO_WATCH よって異なります。
注釈
自分自身が行った操作は通知されません。

アカウント¶
アカウント タブでは、基本的なアカウントの詳細の設定、Weblate へのサインインに使用する複数の外部サービスへの接続設定、アカウントの完全削除、個人情報(参照: Weblate ユーザー データのエクスポート)のダウンロードなどができます。
注釈
外部サービスの一覧は Weblate の設定によって異なりますが、 GitLab や GitHub、Google、Facebook、Bitbucket といった人気サイトや、その他の OAuth 2.0 プロバイダなども利用可能に設定できます。

ユーザー情報¶
このページのすべてのフィールドはオプションであり、いつでも削除できます。入力すると、あなたのユーザー情報が表示されるすべての場所で、そのデータが共有されることに同意したとみなされます。
アバターはユーザーごとに表示できます(ENABLE_AVATARS
の使用)。イメージは、https://gravatar.com/ を使用して取得します。
ライセンス¶
API アクセス¶
API アクセス トークンは、ここで取得またはリセットできます。
監査ログ¶
監査ログは、アカウントで実行された作業を記録します。重要な作業ごとに、IP アドレスとブラウザをアカウントに記録します。重要な作業では、デフォルトのメールアドレスへの通知も行います。
Weblate を使用した翻訳¶
Weblate を使用した翻訳に関心をお寄せいただきありがとうございます。プロジェクトは、直接翻訳するように設定することも、アカウントを持たないユーザーからの提案を受け入れるように設定することもできます。
すべてに対する、2 つの翻訳モード:
翻訳を直接受け付けるプロジェクト
提案のみを受け入れるプロジェクト。提案は、指定した投票数に達すると自動的に検証される
翻訳のワークフローの詳細については、翻訳ワークフロー を確認してください。
翻訳プロジェクトの表示オプション:
一般に公開し、誰でも貢献可能
特定のグループの翻訳者のみ閲覧可能
翻訳リンク¶
コンポーネントでは、翻訳の編集画面に移動できるリンクの一覧があります。さらに翻訳は、次のような個別の検査結果に分類されています、例えば 未翻訳の文字列 または 作業が必要な文字列。プロジェクト全体で不合格とならずに翻訳できた場合であっても、すべての文字列 が使用できます。また、検索フィールドを使用して、特定の文字列または用語の検索もできます。

提案¶
注釈
実際の権限は、Weblate の構成によって異なります。
匿名のユーザーは、(デフォルトでは)候補の提案しかできません。サインインしているユーザーは、 翻訳が適切でない場合は、他の翻訳者に翻訳を確認してもらうためにも使用できます。
提案は、現在の翻訳と一致する重複や提案を削除するために、毎日スキャンされます。
コメント¶
投稿可能な 3 種類のコメント: 翻訳、原文、または、原文の査読の有効化 で有効にした場合の原文のバグの報告。議論する内容に合わせたものを選択します。原文へのコメントは、たとえば、原文の言い換えや原文に対する質問など、元の文字列へのフィードバックを提供するのに適しています。
Markdown 構文はすべてのコメントに使用でき、@mention
を使用して他のユーザーに言及できます。
異なる表記¶
異なる表記は、同じ意味の単語ではあるが短縮したりしなかったりする、文字列の長さが異なる表記をグループ化するために使用します。フロントエンドでは、画面またはウィンドウのサイズに応じて異なる文字列を使用できます。
翻訳¶
翻訳ページでは、原文と翻訳のための編集入力枠が表示されます。翻訳が複数形である場合、複数形の原文および編集入力枠が表示され、それぞれが翻訳された言語の複数形の数で説明およびラベル付けされます。
すべての特殊な空白文字には、赤い下線が引かれ、灰色の記号で示されます。後続の複数のスペースにも赤い下線が引かれ、翻訳者にフォーマット上の問題が発生したことを警告します。
このページには、さまざまな追加情報が表示されます、そのほとんどはプロジェクトのソースコードからのものです(コンテキスト、コメント、メッセージを使用している場所など)。環境設定で選択した参考言語の翻訳入力枠は、原文の上に表示されます(参照: 参考言語)。
翻訳者は翻訳文の下で、他の翻訳者からの提案の採用 (✓) 、採用して編集 (🖉) 、削除 (🗑) することができます。
複数形¶
数字の指定に合わせて形を変える単語は、複数形と呼ばれています。weblate で複数形は、言語ごとに定義されています。例えば、英語は 1 つの複数形に対応します。例えば、単数形に定義した "car" は、暗黙的に 1 つの車を参照し、複数形に定義した "cars" は、2 台以上の車を参照します(車という概念の名詞化)。チェコ語やアラビア語などの言語では、複数形の数が多く、複数形の規則も異なります。
Weblate は、それぞれの言語に対して、これらの形式に完全に対応しています(すべての複数形を別々に翻訳する方法を採用)。形式の数と、それが翻訳するアプリケーションやプロジェクトでどのように使用するのかは、複数形の設定によって異なります。形式の種類と、翻訳するアプリケーションまたはプロジェクトで形式をどのように使用するのかは、複数形よって異なります。Weblate には簡単な説明しかありませんが、Unicode コンソーシアムの Language Plural Rules には詳細な説明があります。
参考

キーボード ショートカット¶
バージョン 2.18 で変更: キーボード ショートカットは 2.18 で刷新し、ブラウザやシステムのデフォルトと衝突する可能性が低くなりました。
翻訳中に利用できるキーボード ショートカット:
キーボード ショートカット |
解説 |
---|---|
Alt+Home |
検索結果の、先頭の翻訳に移動する。 |
Alt+End |
検索結果の、末尾の翻訳に移動する。 |
Alt+PageUp or Ctrl ↑ or Alt ↑ or Cmd ↑ |
検索結果の、1 つ前の翻訳に移動する。 |
Alt+PageDown or Ctrl+↓ or Alt+↓ or Cmd+↓ |
検索した、次の翻訳に移動する。 |
Alt+Enter or Ctrl+Enter or Cmd+Enter |
現在の翻訳を保存する。 |
Ctrl+Shift+Enter or Cmd+Shift+Enter |
翻訳の要編集フラグを解除して送信する。 |
Ctrl+E or Cmd+E |
翻訳入力欄にフォーカスを移動する。 |
Ctrl+U or Cmd+U |
コメント入力欄にフォーカスを移動する。 |
Ctrl+M or Cmd+M |
自動提案 タブの表示。参照: 自動提案。 |
Ctrl+1 to Ctrl+9 or Cmd+1 to Cmd+9 |
番号を指定して、原文に設定されたプレースホルダを、翻訳にコピーする。 |
Ctrl+M+1 to 9 or Cmd+M+1 to 9 |
番号を指定して、機械翻訳を翻訳にコピーする。 |
Ctrl+I+1 to 9 or Cmd+I+1 to 9 |
番号を指定して、検査不合格の 1 項目を除外する。 |
Ctrl+J or Cmd+J |
前後の文字列 タブの表示。 |
Ctrl+S or Cmd+S |
翻訳メモリの検索にフォーカス移動。 |
Ctrl+O or Cmd+O |
原文を、翻訳に複製する。 |
Ctrl+Y or Cmd+Y |
要編集 フラグを付ける。 |
ビジュアル キーボード¶
翻訳入力枠のすぐ右上に、複数の小さな記号文字を並べて表示します。これは、翻訳言語の句読点を明確にし(並ぶ記号文字は翻訳言語と一致)、文字を入力するのが困難な場合に使用します。
3 つのカテゴリに分類した表示記号:
ユーザー情報 で定義したユーザー設定文字
Weblate が提供する言語ごとの文字(引用符や RTL 固有の文字など)
SPECIAL_CHARS
で設定した文字

翻訳コンテキスト¶
このコンテキストの説明は、現在の文字列に関する関連情報を提供します。
- 文字列属性
メッセージ ID、コンテキスト(
msgctxt
)、原文の参照など。- スクリーンショット
スクリーンショットを Weblate にアップロードして、文字列がどこでどのように使用されているかを翻訳者に伝えることができます。参照: Visual context for strings。
- 前後の文字列
翻訳ファイルの前後の文字列を表示します。これらは通常、同様のコンテキストで使用されるので、翻訳の一貫性の維持に便利です。
- その他の出現箇所
メッセージが複数の場所で表示される場合(複数のコンポーネントなど)、一貫性がないと判断されると(参照: 一貫性の欠如)、このタブにすべてのメッセージを表示します。どれを使用するかは選択できます。
- 翻訳メモリ
過去に翻訳した同様の文字列を確認します。参照: 翻訳メモリ。
- 用語集
現在のメッセージで使用しているプロジェクトの用語集の用語を表示します。
- 最近の更新
Weblate を使用して最近このメッセージを変更したユーザーの一覧です。
- プロジェクト
翻訳者への指示や、プロジェクトが使用しているバージョン管理システムの、リポジトリ内の文字列へのディレクトリやリンクなどのプロジェクト情報。
直リンクが必要な場合は、翻訳形式での対応が必要です。
翻訳履歴¶
すべての変更はデフォルトで(コンポーネントの設定で無効にしていない限り)データベースに保存され、元に戻すことができます。必要に応じて、基になるバージョン管理システムの任意の項目を元に戻すこともできます。
翻訳した文字列の長さ¶
Weblate では、翻訳した文字列の長さを制限するために、複数の方法で翻訳の長さを設定できます。
デフォルトの翻訳文の長さ制限は、原文の 10 倍です。無効にするには、
LIMIT_TRANSLATION_LENGTH_BY_SOURCE_LENGTH
を設定します。制限の影響を受けた場合、間違ってバイリンガルとして設定した単一言語の翻訳が原因であり、Weblate が翻訳キーを実際の原文と間違えたことも考えられます。詳細については、Bilingual and monolingual formats を確認してください。翻訳ファイルまたはフラグによって定義した文字の最大長。参照: 翻訳の最大文字数。
フラグで定義するピクセル単位の最大表示サイズ。参照: 翻訳の文字の最大サイズ。
自動提案¶
設定と翻訳した言語に基づいて、Weblate は複数の機械翻訳ツールと 翻訳メモリ からの提案を提供します。すべての機械翻訳は、各翻訳ページの 1 つのタブの中から使用できます。
参考
対応するツールの一覧の検索。参照: 機械翻訳。
自動翻訳¶
自動翻訳を使用して、他の原文の既存の翻訳を取り込み、翻訳を加速できます。このツールは 自動翻訳 として、コンポーネントと言語を選択して ツール メニューから操作できます。

選択できる 2 つの操作モード:
他の Weblate コンポーネントを翻訳のソースとして使用する。
品質を厳選して選んだ機械翻訳サービスを使用する。
自動翻訳する文字列の選択もできます。
警告
すべての文字列 などの範囲が大きいフィルターを使用すると、既存の翻訳が上書きされてしまうことに注意してください。
異なるコンポーネント間の翻訳を統合する場合(例: アプリケーションおよびその WEB サイト)や、既存の翻訳を使用して新しいコンポーネントの翻訳を加速させる場合(翻訳メモリ)に便利です。
接続制限¶
インターフェイスの不正使用を避けるため、検索、連絡先フォームの送信、翻訳などの一部の操作に接続制限を適用しています。制限の影響を受けた場合、操作を再開できるまで、一定期間接続を遮断します。
デフォルトの制限値と最適な設定については、管理者ドキュメントを確認してください。参照: 接続制限。
検索と置換¶
用語を素早く適切に変更するしたり、文字列の一括修正をするには、 ツール メニューから 検索と置換 を使用します。
ヒント
文字列が破壊されるかどうかの心配をする必要はありません。変更は 2 段階で行われ、実際に変更を確定する前にプレビュー表示で確認をします。
一括編集¶
一括編集では、複数の文字列に対して 1 つの操作をまとめて実行できます。検索する文字列を設定し、一致するすべての文字列を更新します。対応する操作:
文字列の状態の変更(例: 査読待ちのすべての文字列の承認)。
翻訳フラグの変更(参照: フラグを使用した動作の設定)
文字列ラベルの変更(参照: String labels)
ヒント
このツールは 一括編集 と呼ばれ、それぞれのプロジェクト、コンポーネント、または翻訳の ツール メニューから操作します。
翻訳のダウンロードとアップロード¶
翻訳のファイルをエクスポートし、変更を加えて、再度インポートできます。これにより、オフラインで作業してから、変更内容を既存の翻訳にマージできます。マージするまでに変更があっても機能します。
注釈
Available options might be limited by access control settings.
翻訳のダウンロード¶
プロジェクトまたはコンポーネントのダッシュボードから、翻訳可能なファイルを ファイル メニューからダウンロードできます。
The first option is to download the file in the original format as it is stored in the repository. In this case, any pending changes in the translation are getting committed and the up-to-date file is yield without any conversions.
また、一般的な翻訳形式などに変換した翻訳のダウンロードもできます。変換したファイルには、追加のコンテキスト、コメント、フラグなど、Weblate が提供するデータが追加されます。多くのファイル形式は、ファイル ↓ ダウンロードのカスタマイズ メニューから入手できます。
gettext PO
gettext 拡張付きの XLIFF
XLIFF 1.1
TermBase eXchange
Translation Memory eXchange
gettext MO
CSV
Excel Open XML
JSON
Android 文字列リソース
iOS の文字列

翻訳のアップロード¶
ファイルに変更を加えたら、ファイル メニューの 翻訳のアップロード を実行します。

対応するファイル形式¶
対応しているファイル形式のファイルはすべてアップロードできますが、翻訳に使用するファイル形式と同じファイル形式を使用することを推奨します。ファイル形式が異なると、一部の内容が正しく翻訳されないことがあります。
参考
アップロードしたファイルは翻訳の更新のためにマージされ、デフォルトで既存のエントリが上書きされます(アップロードのオプション画面で上書き する/しない を選択できます)。
インポート方法¶
翻訳ファイルをアップロードするときに表示される選択項目:
- 翻訳として追加(
translate
) インポートした翻訳を翻訳として追加します。これは最も一般的な使用例であり、デフォルトの動作です。
- 提案として追加(
suggest
) インポートした翻訳を候補として追加します。アップロードした文字列を確認するには、この操作を行ってください。
- 翻訳を要編集として追加(
fuzzy
) インポートした翻訳を要編集の翻訳として追加します。これは、翻訳や査読もできて便利です。
- 既存の翻訳ファイルの置き換え(
replace
) 既存のファイルを新しいコンテンツで置き換えます。既存の翻訳を失うことがあるので使用に注意してください。
- 原文の更新(
source
) 対訳ファイルの原文を更新します。これは POT に一致する PO ファイルの更新(msgmerge) と似ています。
このオプションは、一部のファイル形式でのみ対応しています。
- 新しい文字列の追加 (
add
) 翻訳に新しい文字列を追加します。既に存在する文字列は除外します。
新しい文字列の追加、および既存の翻訳の更新の両方を行う場合は、Add as translation を使用してファイルを 2 回アップロードします。
このオプションは、文字列の管理 を有効にした場合のみ使用できます。
コンフリクト処理¶
すでに翻訳されているアップロード済みの文字列の処理方法を定義します。
要編集の文字列¶
また、インポートしたファイルで編集が必要な文字列を処理するオプションもあります。文字列は、「インポートしない」、「要編集として文字列をインポート」、「翻訳済みとしてインポート」の三択から 1 つを選んで処理します。
翻訳者の変更¶
管理者権限で、アップロードしたファイルの翻訳者を設定できます。これは、他の方法でファイルを受け取り、本来の翻訳者に明記しなおして、既存の翻訳にマージする場合に便利です。
用語集¶
Each project can include one or more glossaries as a shorthand for storing terminology. Glossary easify maintaining consistency of the translation.
各言語の用語集は単独で管理できますが、プロジェクト管理者と多言語翻訳者が言語間の一貫性を維持するのに役立つ単一のコンポーネントとしてまとめて保存されます。翻訳エディタのサイドバーに、現在翻訳済みの文字列の単語を含む用語集の用語が表示されます。
用語集の管理¶
バージョン 4.5 で変更: 用語集は、通常の翻訳コンポーネントになり、すべての Weblate 機能を使用できるようになりました(コメント、リモート リポジトリへの格納、説明の追加など)。
用語集として使用 を有効にすることで、どのコンポーネントでも用語集として使用できます。1 つのプロジェクトに複数の用語集を作成できます。
プロジェクトの作成時に、プロジェクトには空の用語集が自動的に作成されます。用語集は同じプロジェクトのすべてのコンポーネントで共有します。必要に応じて、それぞれの用語集コンポーネントから プロジェクトで共有 を使用すると、別のプロジェクトと共有します。
The glossary component looks like any other component in Weblate with added colored label:

閲覧できる用語集のすべての用語:

または、翻訳として編集します。
用語集の用語¶
用語集の用語は、通常の翻訳と同じ方法で翻訳します。各用語に対して Tools メニューから機能を追加できます。

翻訳不可の用語¶
バージョン 4.5 で追加.
Flagging certain glossary term translations read-only
by bulk-editing, typing in the flag, or
by using Tools ↓ Mark as read-only means they can not
be translated. Use this for brand names or other terms that should not be changed in other languages.
Such terms are visually highlighted in the glossary sidebar.
翻訳禁止¶
バージョン 4.5 で追加.
Flagging certain glossary term translations as forbidden
, by bulk-editing,
typing in the flag, or by using Tools ↓ Mark as forbidden translation
means they are not to be used. Use this to clarify translation when some words are
ambiguous or could have unexpected meanings.
専門用語¶
バージョン 4.5 で追加.
Flagging certain glossary terms as terminology
by bulk-editing, typing in the flag,
or or by using Tools ↓ Mark as terminology adds entries for them
to all languages in the glossary. Use this for important terms that should
be well thought out, and retain a consistent meaning across all languages.
検査と修正¶
品質検査は、一般的な翻訳ミスを発見しやすくして、翻訳が整形された状態であることを保証します。誤検出の場合は、その検査を除外にできます。
保存した翻訳が検査で不合格となった場合、すぐにユーザーに警告を表示します。

品質検査¶
Weblate では、文字列に対してさまざまな品質検査をしています。次のセクションでは、すべての検査項目について詳しく説明します。言語固有の検査もあります。誤検出が起こる場合はバグを報告してください。
翻訳時の検査¶
翻訳文を変更するたびに検査をするため、翻訳者は高品質な翻訳を維持できます。
BBcode マークアップ¶
翻訳文の BBcode が原文と不一致
BBCode は、メッセージの重要な部分を太字フォントや斜体で強調するなどの表示を、単純なマークアップで記述します。
この検査は、BBCode が翻訳文にも含まれているかどうかを確認します。
注釈
現在、BBcode を検出する方法は非常に単純であり、この検査では誤検知が発生することがあります。
重複単語の連続¶
翻訳文で同じ単語が 2 回連続している
バージョン 4.1 で追加.
翻訳文に重複する単語が連続してないか検査します。通常は、翻訳ミスです。
ヒント
この検査には、誤検出を避けるための言語固有の規則が含まれています。お客様のケースで誤作動した場合はお知らせください。参照: Weblate の問題の報告。
用語集に従っていない¶
バージョン 4.5 で追加.
翻訳文は用語集に定義された用語に従っていない。
この検査は、check-glossary
フラグを使用して有効にします(参照: フラグを使用した動作の設定)。有効にする前に、考慮が必要な項目:
完全な文字列の一致を行います。用語集には、用語の異なる表記はすべて含まれていることが前提です。
各文字列を用語集と照合して検査するのは大変な作業です。Weblate のすべての操作、文字列のインポートや翻訳などの検査が遅くなります。
連続スペース¶
翻訳文に連続したスペースが含まれている
翻訳文の中でスペースが連続しているかどうかを検査し、ほかのスペース関連の検査での誤検出を防ぎます。
原文で、スペースが連続していれば、検査で不合格になりません。スペースを意図的に連続させているからです。
書式指定文字列¶
原文から翻訳文に文字列の書式指定が複製されているか検査します。翻訳文で書式指定文字列を省略すると、通常は深刻な問題が発生するので、文字列の書式指定は、通常は原文と一致していなければなりません。
Weblate では、複数の言語での書式指定文字列の検査に対応しています。検査は、文字列に適切なフラグが設定されている場合にのみ自動的に有効になります(例: C 形式の 'c-format')。Gettext はこれを自動的に追加しますが、他のファイル形式や PO ファイルが xgettext で生成されていない場合は、手動で追加することが必要です。
これは、ユニットごとに行うこともできますし(参照: Additional info on source strings)、Component configuration で行うこともできます。コンポーネントごとに定義する方が簡単ですが、文字列が書式指定文字列として解釈されず、書式指定文字列の構文がすでに使用されている場合は、誤検出が発生することがあります。
ヒント
Weblate で指定した書式指定の検査ができない場合は、汎用の プレースホルダー を使用できます。
検査に加えて、書式指定文字列をハイライトで表示して、翻訳文字列に簡単に挿入する方法:

AngularJS 補間文字列¶
AngularJS 補間文字列が原文と不一致
名前付き書式文字列 |
|
有効にするフラグ |
angularjs-format |
C 言語書式¶
C 言語形式の文字列が原文と不一致
単純な書式指定文字列 |
|
書式指定文字列の位置 |
|
有効にするフラグ |
c-format |
ECMAScript テンプレート リテラル¶
ECMAScript テンプレート リテラルが原文と不一致
代入 |
|
有効にするフラグ |
es-format |
i18next 補間¶
i18next 補間が原文と不一致
バージョン 4.0 で追加.
代入 |
|
ネスティング |
|
有効にするフラグ |
i18next-interpolation |
Java 形式¶
Java 形式の文字列が原文と不一致
単純な書式指定文字列 |
|
書式指定文字列の位置 |
|
有効にするフラグ |
java-format |
Java MessageFormat¶
Java メッセージ フォーマット文字列が原文と不一致
書式指定文字列の位置 |
|
有効にするフラグ |
java-messageformat は無条件に検査を有効にします |
auto-java-messageformat 原文に書式指定文字列がある場合のみ検査を有効にします |
パーセントのプレースホルダー¶
パーセントのプレースホルダーが原文と不一致
バージョン 4.0 で追加.
単純な書式指定文字列 |
|
有効にするフラグ |
percent-placeholders |
Perl 形式¶
Perl 書式指定文字列が原文と不一致
単純な書式指定文字列 |
|
書式指定文字列の位置 |
|
有効にするフラグ |
perl-format |
PHP 形式¶
PHP 形式の文字列が原文と不一致
単純な書式指定文字列 |
|
書式指定文字列の位置 |
|
有効にするフラグ |
php-format |
Python ブレース書式¶
Python ブレース形式文字列が原文と不一致
単純な書式指定文字列 |
|
名前付き書式文字列 |
|
有効にするフラグ |
python-brace-format |
Python 形式¶
Python 形式の文字列が原文と不一致
単純な書式指定文字列 |
|
名前付き書式文字列 |
|
有効にするフラグ |
python-format |
Ruby 形式¶
Ruby 書式指定文字列が原文と不一致
単純な書式指定文字列 |
|
書式指定文字列の位置 |
|
名前付き書式文字列 |
|
名前付きテンプレート文字列 |
|
有効にするフラグ |
ruby-format |
Vue I18n 書式¶
Vue I18n 書式が原文と不一致
名前付きフォーマット |
|
Rails i18n 書式 |
|
リンクする言語メッセージ |
|
有効にするフラグ |
vue-format |
一貫性の欠如¶
この原文の文字列は、このプロジェクト内で異なる翻訳が複数あるか、一部のコンポーネントには翻訳がありません。
Weblate は、同一の文字列の翻訳が一貫性を維持できるように、プロジェクト内のすべての翻訳を検査します。
1 つの文字列についてプロジェクト内で異なる翻訳がある場合、検査では不合格となります。この場合、検査結果には一貫性の欠如と表示されます。この文字列の他の翻訳は その他の出現箇所 タブで確認できます。
注釈
この検査は、文字列があるコンポーネントでは翻訳されていて、別のコンポーネントでは翻訳されていない場合にも発生します。これは、その他の出現箇所 タブの各行に表示される この翻訳を使う ボタンをクリックするだけで、一部のコンポーネントで翻訳されていない文字列を手動で処理する簡単な方法として使用できます。
自動翻訳 アドオンを使用して、別のコンポーネントですでに翻訳されている、新しく追加された文字列の翻訳を自動化できます。
Kashida 文字の使用¶
装飾用の Kashida 文字は使用しないでください
バージョン 3.5 で追加.
Kashida の装飾文字は翻訳に使用しないでください。これは Tatweel とも呼ばれます。
翻訳の最大文字数¶
翻訳文は、設定した文字数を超えてはいけない
翻訳文が使用可能なスペースに収まる文字列数かどうかを検査します。これは、翻訳文の文字列数のみの検査です。
他の検査とは違い、フラグは max-length:100
のような key:value
ペアとして設定が必要です。
ヒント
この検査では文字数を確認するので、プロポーショナル フォントを使用してテキストを表示する場合は適さないかもしれません。翻訳の文字の最大サイズ 検査は、テキストの実際の表示結果を検査します。
replacements:
フラグは、文字列を検査する前にプレースホルダを展開する場合にも便利です。
翻訳の文字の最大サイズ¶
表示した翻訳のテキストは、設定した文字サイズを超えてはいけない
バージョン 3.7 で追加.
表示した翻訳のテキストは、設定した文字サイズを超えないようにしてください。行折り返しでテキストを表示し、設定した境界に収まるかどうかを確認します。
この検査には、最大幅と最大行数の 1 つまたは 2 つのパラメータが必要です。行数を指定しない場合は、1 行のテキストと判断されます。
使用するフォントは font-*
ディレクティブ(参照: フラグを使用した動作の設定)でも設定できます。次は、ubuntu のフォント サイズ 22 で表示するテキストを、2 行 500 ピクセルに収める翻訳フラグの設定方法:
max-size:500:2, font-family:ubuntu, font-size:22
ヒント
Component configuration 内の font-*
ディレクティブを設定して、コンポーネント内のすべての文字列に同じフォントを設定できます。文字列ごとに設定することが必要な場合に備えて、文字列ごとにこれらの値を上書きできます。
replacements:
フラグは、文字列を検査する前にプレースホルダを展開する場合にも便利です。
\n の不一致¶
翻訳文の \n の数が原文と不一致
通常、エスケープされた改行はプログラムの出力をフォーマットする際に重要です。翻訳の \n
リテラルの数が原文と一致しない場合、検査で不合格となります。
コロンの不一致¶
原文と翻訳文の一方の末尾がコロンではない
原文から翻訳にコロンが複製されているか検査します。コロンの有無は、それが属していないさまざまな言語についても検査されます(中国語または日本語)。
省略記号の不一致¶
原文と翻訳の一方が省略記号で終わっていない
原文から翻訳文に末尾の省略記号が複製されているか検査します。これは、3 つのドット (…
) ではなく、実際の省略記号 (...
) のみを検査します。
省略記号は通常、印刷では 3 つのドットよりも綺麗に表示され、音声合成ではよりよく聞こえます。
感嘆符の不一致¶
原文と翻訳文の一方が感嘆符で終わっていない
原文から翻訳に感嘆符が複製されているか検査します。感嘆符の有無は、感嘆符を持たないさまざまな言語についても検査されます(中国語、日本語、韓国語、アルメニア語、リンブ語、ミャンマー語、またはンコ語)。
終止符の不一致¶
原文と翻訳文の一方が終止符で終わっていない
原文から翻訳に終止符止が複製されているか検査します。終止符の有無は、その終止符が属していない複数の言語(中国語、日本語、デーヴァナーガリー文字またはウルドゥー語)について検査します。
疑問符の不一致¶
原文と翻訳文の一方が疑問符で終わっていない
原文から翻訳文に疑問符が複製されているか検査します。疑問符の有無は、疑問符を持たない複数の言語(アルメニア語、アラビア語、中国語、韓国語、日本語、エチオピア語、ヴァイ語またはコプト語)についても検査します。
セミコロンの不一致¶
原文と翻訳文の一方がセミコロンで終わってない
原文から翻訳に末尾のセミコロンが複製されているか検査します。これは、デスクトップ ファイルなどのエントリの書式を維持する場合に便利です。
複数形の不足¶
一部の複数形は翻訳されていない
原文のすべての複数形が翻訳されているか検査します。各複数形の使用方法の詳細については、文字列の定義で確認できます。
複数形を記入しないと、複数形が使用されているときに何も表示されないことがあります。
プレースホルダー¶
翻訳文にはいくつかのプレースホルダーが足りない
バージョン 3.9 で追加.
バージョン 4.3 で変更: 正規表現をプレースホルダーとして使用できる。
一部のプレースホルダーが翻訳に欠けています。これらは翻訳ファイルから抽出されるか、placeholders
フラグを使用して手動で定義します。フラグはコロンで区切り、スペースを含む文字列は引用符で囲んで使用します。
placeholders:$URL$:$TARGET$:"some long text"
プレースホルダに構文がある場合の、正規表現の使用方法:
placeholders:r"%[^% ]%"
句読点のスペース¶
句読点記号の前にノーブレークスペースがない
バージョン 3.9 で追加.
句読点記号(感嘆符、疑問符、セミコロン、コロン)の前に改行できないスペースがあるか検査します。このルールは、フランス語やブルトン語などの、句読点記号の前のスペースはタイポグラフィの規則に準じる一部の言語でのみ使用されます。
正規表現¶
翻訳文は正規表現に一致しない
バージョン 3.9 で追加.
翻訳文は正規表現に一致しません。正規表現は、翻訳ファイルから抽出するか、regex
フラグを使用して手動で定義します。
regex:^foo|bar$
文末の空白¶
原文と翻訳文の文末のスペースが不一致
原文から翻訳に末尾のスペースが複製されているか検査します。
末尾のスペースは、通常、隣接する要素をスペースに入れるため、削除するとレイアウトが壊れることがあります。
未翻訳の翻訳文¶
原文と翻訳文は同一です
原文と対応する翻訳文字列が、複数の形式の少なくとも 1 つまで同一である場合に発生します。すべての言語に共通する一部の文字列は無視され、さまざまなマークアップが除去されます。これにより、誤検出の数が減ります。
この検査は、誤って翻訳されていない文字列を見つけるのに便利です。
この検査のデフォルトの動作では、標準搭載されたブラックリストから単語を検査対象から除外します。これは頻繁に翻訳されない単語です。これは、複数の言語で同じ 1 つの単語だけで構成される短い文字列での誤検出を避けるために便利です。このブラックリストを無効にするには、文字列またはコンポーネントに strict-same
フラグを追加します。
安全でない HTML¶
翻訳文には安全でない HTML マークアップが含まれている
バージョン 3.9 で追加.
翻訳には、安全でない HTML マークアップが含まれています。この検査は safe-html
フラグ(参照: フラグを使用した動作の設定)を使用して有効にしなければなりません。マークアップを自動的にサニタイズできる autofixer も付属しています。
参考
HTML の検査は、Mozilla が開発した Bleach library によって行われます。
URL¶
翻訳文に URL が含まれていない
バージョン 3.5 で追加.
翻訳文に URL が含まれていません。これは、ユニットが URL を含むとマークされている場合にのみ起動します。その場合、翻訳は有効な URL であることが必要です。
XML マークアップ¶
翻訳文の XML タグが原文と不一致
これは通常、出力結果が異なることを意味します。ほとんどの場合、これは翻訳の変更による望ましい結果ではありませんが、場合によっては変更されることもあります。
原文から翻訳文に XML タグが複製されているか検査します。
ゼロ幅スペース¶
翻訳文には余分なゼロ幅のスペース文字が含まれている
単語内でのメッセージの改行(ワードラッピング)には、半角スペース(<U+200B>)文字を使用します。
通常は誤って挿入するため、この検査は翻訳中に検出した時点で起動します。この文字を使用すると、一部のプログラムで問題が発生することがあります。
原文検査¶
原文検査は、開発者が原文の品質を向上させるため便利です。
省略記号¶
文字列では、省略記号 (…) の代わりに 3 つのドット (...) が使われています
これは、文字列で省略記号 (…
) を使用すべきところで、3 つのドット (...
) を使用すると不合格となります。
ほとんどの場合、Unicode 文字を使用する方が適切な方法であり、表示の品質も高くなります。また、音声合成を使用する方が適切な場合もあります。
複数の検査で不合格¶
複数の言語の翻訳は、検査で不合格となっている
この文字列の翻訳の多くは、品質検査で不合格となっています。これは通常、原文を改善する方法が何かあるという意味です。
この検査の不合格は、文字列の末端の終止符の欠落、または翻訳者が翻訳で修正する傾向がある同様のささいな問題によって引き起こされることが多いが、原文で修正することを推奨します。
複数の無名変数¶
文字列には複数の無名の変数があり、翻訳者がそれらを並べ替えることはできない
バージョン 4.1 で追加.
文字列内に複数の名前のない変数があるため、翻訳者がそれらを並べ替えることはできません。
代わりに名前付き変数を使用して、翻訳者が変数の順序を変更できるように検討してください。
複数形の除外¶
文字列を複数形として解釈するが、複数形のつづりは使用しない
文字列を複数形として解釈するが、複数形のつづりは使用しない。翻訳システムがこれに対応している場合は、複数形を認識するつづりを使用することが必要です。
Python の Gettext 使用例:
from gettext import ngettext
print ngettext("Selected %d file", "Selected %d files", files) % files
検索¶
バージョン 3.9 で追加.
ブール演算、かっこ、またはフィールド固有のルックアップを使用した高度なクエリを使用して、必要な文字列を検索できます。
フィールドが定義されていない場合は、原文、翻訳文 および コンテキスト フィールドで検索されます。

単純な検索¶
検索ボックスに入力した語句を単語に分割します。いずれかの単語を含んだ文字列が表示されます。完全に一致する語句を検索するには、「検索語句」を引用符(一重引用符 (') および二重引用符 (") に対応)で囲む: 使用例: "this is a quoted string"
または 'another quoted string'
。
検索方法¶
source:TEXT
原文の大文字と小文字を区別しない検索。
target:TEXT
対象文字列の大文字と小文字を区別しない検索。
context:TEXT
コンテキスト文字列の大文字と小文字を区別しない検索。
key:TEXT
キー文字列の大文字と小文字を区別しない検索。
note:TEXT
コメント文字列の大文字と小文字を区別しない検索。
location:TEXT
ロケーション文字列の大文字と小文字を区別しない検索。
priority:NUMBER
文字列の優先順位。
added:DATETIME
文字列が Weblate に追加されたときのタイムスタンプ。
state:TEXT
状態検索(
approved
,translated
,needs-editing
,empty
,read-only
)。フィールド演算子 に対応。pending:BOOLEAN
VCS へのフラッシュのために保留中の文字列。
has:TEXT
属性がある文字列の検索 -
plural
,context
,suggestion
,comment
,check
,dismissed-check
,translation
,variant
,screenshot
,flags
,explanation
,glossary
,note
。is:TEXT
文字列の状態の検索(
pending
,translated
,untranslated
)。language:TEXT
翻訳対象の言語。
component:TEXT
コンポーネントのスラッグ。参照: コンポーネントのスラッグ。
project:TEXT
プロジェクトのスラッグ。参照: URL スラッグ。
changed_by:TEXT
指定したユーザー名の翻訳者が変更した翻訳文。
changed:DATETIME
文字列の内容が変更された日付。フィールド演算子 に対応。
change_time:DATETIME
文字列の内容が変更された日付。フィールド演算子 に対応。
changed
とは異なり、これには内容が変更されないイベントを含み、変更をした操作change_action
を使用して独自の絞り込みができます。change_action:TEXT
変更をした操作を指定する絞り込み。
change_time
とセットで使用すると便利です。 変更をした操作の英語表記を、スペースで区切って引用符で囲む、もしくは小文字に置き換えスペースをハイフンに置換した形式、に変換して指定します。例は、変更の検索 を確認してください。check:TEXT
検査に不合格となった文字列。
dismissed_check:TEXT
検査を除外した文字列。
comment:TEXT
ユーザー コメントの検索。
comment_author:TEXT
コメントした翻訳者を指定した絞り込み。
suggestion:TEXT
提案の検索。
suggestion_author:TEXT
提案した翻訳者を指定した絞り込み。
explanation:TEXT
説明の検索。
ブール演算子¶
「AND」、「OR」、「NOT」、および括弧を使用して検索を組み合わせると、複雑なクエリを作成できます。使用例: state:translated AND (source:hello OR source:bar)
フィールド演算子¶
日付または数値検索の演算子、範囲または部分参照を指定できます。使用例:
state:>=translated
状態は
translated
か、より良い(approved
)。changed:2019
2019 年に変更。
changed:[2019-03-01 to 2019-04-01]
開始日と終了日の期間内の変更。
完全一致の演算子¶
=
演算子を使用して、異なる範囲の文字列に対して完全一致クエリを実行できます。例えば、hello world
と完全に一致する語句をすべての原文から検索するには、source:="hello world"
を使用します。単語 1 つを検索する場合は、引用符を省略できます。例えば、hello
に一致するすべての原文を検索するには、source:=hello
と入力します。
変更の検索¶
バージョン 4.4 で追加.
履歴イベントの検索は、change_action
および change_time
演算子を使用して実行できます。
例えば、2018 年に要編集とマークされた文字列を検索するには、change_time:2018 AND change_action:marked-for-edit
または change_time:2018 AND change_action:"Marked for edit"
と入力します。
翻訳ワークフロー¶
Weblate を使用すると、翻訳者との距離を近づけ、ユーザーとの距離を縮めます。機能をどこまで利用するかはあなた次第です。
以下の項目は、Weblate の完璧な設定方法ではありません。記載している最も一般的な例をもとに、他のワークフローを作成できます。
翻訳にアクセス¶
access control は、そのオプションのほとんどは、どのワークフローにも適用できるので、ワークフロー全体として詳細な説明はありません。翻訳画面への接続や管理の方法については、それぞれのドキュメントを確認してください。
以降の章では、すべてのユーザー とは翻訳にアクセスできるユーザーのことです。プロジェクトを公開している場合は認証済みのユーザー、または 翻訳 権限があるユーザーを指定できます。
Translation states¶
各文字列の翻訳後に移行する状態のすべて:
- 未翻訳
翻訳は空です、保存するかしないかはファイル形式によります。
- 要編集
編集が必要な翻訳です。通常、原文の変更、あいまい一致、または翻訳者の操作があった場合に設定されます。翻訳はファイルに保存されますが、ファイル形式によっては、編集が必要と設定されます(例: Gettext ファイルでは
fuzzy
(あいまい)フラグがつく)。- 査読待ち
翻訳はできますが、査読はされません。有効な翻訳としてファイルに保存されます。
- 承認済み
査読で翻訳が承認されました。翻訳者は変更できませんが、査読の担当者のみが変更できます。翻訳者は提案の追加しかできません。
- 提案
提案は Weblate にのみ保存され、翻訳ファイルには保存されません。
可能な限り、翻訳ファイルに状態を表示します。
ヒント
In case file format you use does not support storing states, you might want to use 未翻訳の翻訳文に "要編集" フラグを付ける addon to flag unchanged strings as needing editing.
直接翻訳¶
これは、小規模なチームのための最も一般的な設定であり、誰でも直接翻訳できます。これは Weblate のデフォルトの設定です。
すべてのユーザー が翻訳できます。
提案とは、翻訳者が変更に確信を持てない場合に、変更を提案する選択方法です。
設定 |
Value |
備考 |
---|---|---|
査読の有効化 |
off |
プロジェクト レベルで設定済み。 |
提案の有効化 |
on |
ユーザーが確信が持てない場合に提案できると便利。 |
提案への投票 |
off |
|
提案の自動採用 |
0 |
|
翻訳者グループ |
ユーザー |
または per-project access control で 翻訳 。 |
査読者グループ |
該当なし |
未使用。 |
相互評価¶
このワークフローを使用すると、すべてのユーザーが提案を追加でき、翻訳の承認には認証ユーザーの承認が必要です。
すべてのユーザー が提案を追加できる。
すべてのユーザー が提案に投票できる。
事前設定の票数に達すると、提案は翻訳に置き換わる。
設定 |
Value |
備考 |
---|---|---|
査読の有効化 |
off |
プロジェクト レベルで設定済み。 |
提案の有効化 |
on |
|
提案への投票 |
off |
|
提案の自動採用 |
1 |
より多くの相互評価を必要とする高い値を設定できます。 |
翻訳者グループ |
ユーザー |
または per-project access control で 翻訳 。 |
査読者グループ |
該当なし |
未使用、すべての翻訳者が査読できる。 |
専任の査読者¶
バージョン 2.18 で追加: 適切な査読ワークフローは Weblate 2.18 から対応。
専用の査読者には、2 つのユーザー グループがあります、1 つは翻訳を保存できて、もう 1 つは翻訳の一貫性と品質が良好かを確認するために査読できます。
すべてのユーザー は、未承認の翻訳を編集できる。
査読者 は、文字列の承認/非承認ができる。
査読者 は、すべての翻訳(承認済みを含む)を編集できる。
提案は、承認済み文字列の変更の提案もできる。
設定 |
Value |
備考 |
---|---|---|
査読の有効化 |
on |
プロジェクト レベルで設定済み。 |
提案の有効化 |
off |
ユーザーが確信が持てない場合に提案できると便利。 |
提案への投票 |
off |
|
提案の自動採用 |
0 |
|
翻訳者グループ |
ユーザー |
または per-project access control で 翻訳 。 |
査読者グループ |
査読者 |
または、 per-project access control して 査読 。 |
査読の有効化¶
査読は、プロジェクトの設定で有効にできます、場所はプロジェクトの設定の ワークフロー サブページ( 管理 → 設定 メニューにある):

注釈
Weblate の設定によっては、設定を使用できないことがあります。例えば、Hosted Weblate では、無料でホストするプロジェクトでは使用できません。
原文の品質ゲートウェイ¶
多くの場合、開発者がコードを作成して初期の文字列を提供するため、開発者から原本の原文の言語が提供されます。しかし、開発者は原文の言語を母国語としていないことが多く、原文に求められる品質を提供できません。中間翻訳は、この問題の解決に役立ちます - 開発者と翻訳者とユーザーとの間に、追加の文字列用の品質ゲートウェイがあります。
中間言語ファイル を設定すると、このファイルは文字列の原文として使用しますが、原文の言語で磨いて編集します。文字列が原文の言語で用意されると、翻訳者は他の言語に翻訳できます。
よくある質問¶
設定¶
自動化したワークフローを作成する方法は?¶
Weblate は翻訳に関するすべての作業を半自動的に処理できます。あなたのリポジトリへのプッシュ権限を与えれば、マージの競合が発生しない限り、操作なしで翻訳が反映されます。
変更があれば Weblate に通知するように Git リポジトリを設定します、方法は 通知フック を確認してください。
Weblate の Component configuration でプッシュ URL を設定します。これにより、Weblate は変更をリポジトリにプッシュできます。
Weblate の Component configuration で コミット時にプッシュする を有効にすると、Weblate で変更が行われるたびに Weblate によりリポジトリに変更がプッシュされます。
翻訳のマージの競合を修正する方法は?¶
マージの競合は、Weblate と upstream リポジトリの両方で翻訳ファイルが同時に変更されたとき、たまに発生します。通常、翻訳ファイルに変更を加える前に(msgmerge を実行する前)Weblate 翻訳をマージすることで、これを回避できます。Weblate に、保留中の翻訳をすべてコミットして(管理 メニューの リポジトリのメンテナンス から操作)、リポジトリをマージするように指示するだけです(自動プッシュが無効のとき)。
マージの競合が既に発生している場合、最も簡単な方法は、ワークステーションのローカルですべての競合を解決することです - Weblate をリモート リポジトリとして追加し、それを upstream にマージして、競合を修正するだけです。変更をプッシュ バックすると、Weblate はそのままでマージされたバージョンを使用できます。
注釈
設定によっては、Weblate リポジトリへの接続に認証が必要になることあります。Weblate に標準搭載されている Git exporter を使用すると、ユーザー名と API キーで認証されます。
# Commit all pending changes in Weblate, you can do this in the UI as well:
wlc commit
# Lock the translation in Weblate, again this can be done in the UI as well:
wlc lock
# Add Weblate as remote:
git remote add weblate https://hosted.weblate.org/git/project/component/
# You might need to include credentials in some cases:
git remote add weblate https://username:APIKEY@hosted.weblate.org/git/project/component/
# Update weblate remote:
git remote update weblate
# Merge Weblate changes:
git merge weblate/main
# Resolve conflicts:
edit …
git add …
…
git commit
# Push changes to upstream repository, Weblate will fetch merge from there:
git push
# Open Weblate for translation:
wlc unlock
Weblate で複数のブランチを使っている場合に、すべてのブランチに対して同じ操作をする方法:
# Add and update Weblate remotes
git remote add weblate-one https://hosted.weblate.org/git/project/one/
git remote add weblate-second https://hosted.weblate.org/git/project/second/
git remote update weblate-one weblate-second
# Merge QA_4_7 branch:
git checkout QA_4_7
git merge weblate-one/QA_4_7
... # Resolve conflicts
git commit
# Merge main branch:
git checkout main
git merge weblates-second/main
... # Resolve conflicts
git commit
# Push changes to the upstream repository, Weblate will fetch the merge from there:
git push
gettext PO ファイルの場合に、競合を半自動でマージする方法:
Weblate Git リポジトリのローカル クローンを取得して保持します。また、upstream の Git リポジトリの新しいローカル クローンも取得します(つまり、upstream の Git リポジトリのコピーが 2 つ必要。例: 完全なコピーと作業用コピー)手順:
# Add remote:
git remote add weblate /path/to/weblate/snapshot/
# Update Weblate remote:
git remote update weblate
# Merge Weblate changes:
git merge weblate/main
# Resolve conflicts in the PO files:
for PO in `find . -name '*.po'` ; do
msgcat --use-first /path/to/weblate/snapshot/$PO\
/path/to/upstream/snapshot/$PO -o $PO.merge
msgmerge --previous --lang=${PO%.po} $PO.merge domain.pot -o $PO
rm $PO.merge
git add $PO
done
git commit
# Push changes to the upstream repository, Weblate will fetch merge from there:
git push
複数のブランチを一度に翻訳する方法は?¶
Weblateは、1 つの Project configuration 内での翻訳変更のプッシュに対応しています。every Component configuration が有効な場合(デフォルトの動作)、行われた変更は自動的に他に反映されます。このようにすると、分岐自体がすでにかなり分岐している場合でも翻訳の同期が維持されます。分岐間の翻訳の変更は単純にマージできません。
Weblate からの変更をマージするときに、、これらのブランチをマージしてから(開発ワークフローに応じて)差分を破棄することが必要になった場合の方法:
git merge -s ours origin/maintenance
How to translate multi-platform projects?¶
Weblate supports a wide range of file formats (see 対応するファイル形式) and the easiest approach is to use the native format for each platform.
Once you have added all platform translation files as components in one project (see Adding translation projects and components), you can utilize the translation propagation feature (turned on by default, and can be turned off in the Component configuration) to translate strings for all platforms at once.
How to export the Git repository that Weblate uses?¶
There is nothing special about the repository, it lives under the
DATA_DIR
directory and is named vcs/<project>/<component>/
. If you
have SSH access to this machine, you can use the repository directly.
For anonymous access, you might want to run a Git server and let it serve the repository to the outside world.
Alternatively, you can use Git exporter inside Weblate to automate this.
What are the options for pushing changes back upstream?¶
This heavily depends on your setup, Weblate is quite flexible in this area. Here are examples of some workflows used with Weblate:
Weblate automatically pushes and merges changes (see 自動化したワークフローを作成する方法は?).
You manually tell Weblate to push (it needs push access to the upstream repository).
Somebody manually merges changes from the Weblate git repository into the upstream repository.
Somebody rewrites history produced by Weblate (e.g. by eliminating merge commits), merges changes, and tells Weblate to reset the content in the upstream repository.
Of course you are free to mix all of these as you wish.
How can I limit Weblate access to only translations, without exposing source code to it?¶
You can use git submodule for separating translations from source code while still having them under version control.
Create a repository with your translation files.
Add this as a submodule to your code:
git submodule add git@example.com:project-translations.git path/to/translations
Link Weblate to this repository, it no longer needs access to the repository containing your source code.
You can update the main repository with translations from Weblate by:
git submodule update --remote path/to/translations
Please consult the git submodule documentation for more details.
How can I check whether my Weblate is set up properly?¶
Weblate includes a set of configuration checks which you can see in the admin
interface, just follow the Performance report link in the admin interface, or
open the /manage/performance/
URL directly.
Why are all commits committed by Weblate <noreply@weblate.org>?¶
This is the default committer name, configured when you create a translation component. You can change it in the administration at any time.
The author of every commit (if the underlying VCS supports it) is still recorded correctly as the user that made the translation.
Usage¶
How do I review the translations of others?¶
There are several review based workflows available in Weblate, see 翻訳ワークフロー.
You can subscribe to any changes made in 通知 and then check others contributions as they come in by e-mail.
There is a review tool available at the bottom of the translation view, where you can choose to browse translations made by others since a given date.
参考
How do I provide feedback on a source string?¶
On context tabs below translation, you can use the Comments tab to provide feedback on a source string, or discuss it with other translators.
How can I use existing translations while translating?¶
Weblate 内のすべての翻訳は、ありがたいことに共有翻訳メモリを使用できます。
既存の翻訳メモリ ファイルを Weblate にインポートできます。
Use the import functionality to load compendium as translations, suggestions or translations needing review. This is the best approach for a one-time translation using a compendium or a similar translation database.
You can set up tmserver with all databases you have and let Weblate use it. This is good when you want to use it several times during translation.
Another option is to translate all related projects in a single Weblate instance, which will make it automatically pick up translations from other projects as well.
Does Weblate update translation files besides translations?¶
Weblate tries to limit changes in translation files to a minimum. For some file formats it might unfortunately lead to reformatting the file. If you want to keep the file formatted your way, please use a pre-commit hook for that.
Where do language definitions come from and how can I add my own?¶
The basic set of language definitions is included within Weblate and Translate-toolkit. This covers more than 150 languages and includes info about plural forms or text direction.
You are free to define your own languages in the administrative interface, you just need to provide info about it.
参考
Can Weblate highlight changes in a fuzzy string?¶
Weblate supports this, however it needs the data to show the difference.
For Gettext PO files, you have to pass the parameter --previous
to
msgmerge when updating PO files, for example:
msgmerge --previous -U po/cs.po po/phpmyadmin.pot
For monolingual translations, Weblate can find the previous string by ID, so it shows the differences automatically.
Why does Weblate still show old translation strings when I've updated the template?¶
Weblate does not try to manipulate the translation files in any way other than allowing translators to translate. So it also does not update the translatable files when the template or source code have been changed. You simply have to do this manually and push changes to the repository, Weblate will then pick up the changes automatically.
注釈
It is usually a good idea to merge changes done in Weblate before updating translation files, as otherwise you will usually end up with some conflicts to merge.
For example with gettext PO files, you can update the translation files using the msgmerge tool:
msgmerge -U locale/cs/LC_MESSAGES/django.mo locale/django.pot
In case you want to do the update automatically, you can install addon POT に一致する PO ファイルの更新(msgmerge).
Troubleshooting¶
Requests sometimes fail with "too many open files" error¶
This happens sometimes when your Git repository grows too much and you have many of them. Compressing the Git repositories will improve this situation.
The easiest way to do this is to run:
# Go to DATA_DIR directory
cd data/vcs
# Compress all Git repositories
for d in */* ; do
pushd $d
git gc
popd
done
参考
When accessing the site I get a "Bad Request (400)" error¶
This is most likely caused by an improperly configured ALLOWED_HOSTS
.
It needs to contain all hostnames you want to access on your Weblate. For example:
ALLOWED_HOSTS = ["weblate.example.com", "weblate", "localhost"]
参考
What does mean "There are more files for the single language (en)"?¶
This typically happens when you have translation file for source language. Weblate keeps track of source strings and reserves source language for this. The additional file for same language is not processed.
原文の言語への翻訳が必要な場合は、コンポーネント設定の 原文の言語 を変更してください。
原文の言語の翻訳ファイルが不必要な場合は、リポジトリから削除してください。
原文の言語の翻訳ファイルが必要だが、Weblate で無効にする場合は、言語フィルター で除外を設定してしてください。
ヒント
You might get similar error message for other languages as well. In that case the most likely reason is that several files map to single language in Weblate.
This can be caused by using obsolete language codes together with new one
(ja
and jp
for Japanese) or including both country specific and
generic codes (fr
and fr_FR
). See 言語コードの解析 for
more details.
機能¶
Does Weblate support other VCSes than Git and Mercurial?¶
Weblate currently does not have native support for anything other than Git (with extended support for GitHub, Gerrit and Subversion) and Mercurial, but it is possible to write backends for other VCSes.
You can also use Git リモート ヘルパー in Git to access other VCSes.
Weblate also supports VCS-less operation, see ローカル ファイル.
注釈
For native support of other VCSes, Weblate requires using distributed VCS, and could probably be adjusted to work with anything other than Git and Mercurial, but somebody has to implement this support.
参考
How does Weblate credit translators?¶
Every change made in Weblate is committed into VCS under the translators name. This way every single change has proper authorship, and you can track it down using the standard VCS tools you use for code.
Additionally, when the translation file format supports it, the file headers are updated to include the translator's name.
Why does Weblate force showing all PO files in a single tree?¶
Weblate was designed in a way that every PO file is represented as a single component. This is beneficial for translators, so they know what they are actually translating.
バージョン 4.2 で変更: 翻訳者は、プロジェクトのすべてのコンポーネントを、すべての言語に翻訳できます。
Why does Weblate use language codes such sr_Latn or zh_Hant?¶
These are language codes defined by RFC 4646 to better indicate that they
are really different languages instead previously wrongly used modifiers (for
@latin
variants) or country codes (for Chinese).
Weblate still understands legacy language codes and will map them to
current one - for example sr@latin
will be handled as sr_Latn
or
zh@CN
as zh_Hans
.
参考
対応するファイル形式¶
Weblate supports most translation format understood by translate-toolkit, however each format being slightly different, some issues with formats that are not well tested can arise.
注釈
When choosing a file format for your application, it's better to stick some well established format in the toolkit/platform you use. This way your translators can additionally use whatever tools they are used to, and will more likely contribute to your project.
Bilingual and monolingual formats¶
Both monolingual and bilingual formats are supported. Bilingual formats store two languages in single file—source and translation (typical examples are GNU gettext, XLIFF or Apple iOS strings). On the other side, monolingual formats identify the string by ID, and each language file contains only the mapping of those to any given language (typically Android string resources). Some file formats are used in both variants, see the detailed description below.
For correct use of monolingual files, Weblate requires access to a file containing complete list of strings to translate with their source—this file is called 単一言語のベース言語ファイル within Weblate, though the naming might vary in your paradigm.
Additionally this workflow can be extended by utilizing 中間言語ファイル to include strings provided by developers, but not to be used as is in the final strings.
自動検出¶
Weblate can automatically detect several widespread file formats, but this detection can harm your performance and will limit features specific to given file format (for example automatic addition of new translations).
Translation types capabilities¶
Capabilities of all supported formats:
Format |
Linguality 1 |
Plurals 2 |
Comments 3 |
Context 4 |
Location 5 |
Flags 8 |
Additional states 6 |
---|---|---|---|---|---|---|---|
バイリンガル |
yes |
yes |
yes |
yes |
yes 9 |
needs editing |
|
mono |
yes |
yes |
yes |
yes |
yes 9 |
needs editing |
|
both |
yes |
yes |
yes |
yes |
yes 10 |
needs editing, approved |
|
both |
no |
yes |
no |
no |
no |
||
mono |
yes |
yes |
no |
no |
no |
||
mono |
no |
yes |
no |
yes |
no |
||
both |
yes |
yes |
no |
yes |
yes 10 |
needs editing |
|
mono |
yes |
yes 7 |
no |
no |
yes 10 |
||
バイリンガル |
no |
yes |
no |
no |
no |
||
mono |
no 11 |
yes |
no |
no |
no |
||
mono |
no |
no |
no |
no |
no |
||
mono |
yes |
no |
no |
no |
no |
||
mono |
yes |
no |
no |
no |
no |
||
mono |
yes |
yes |
no |
no |
no |
||
mono |
yes |
yes |
no |
no |
no |
||
mono |
no |
yes |
no |
no |
yes 10 |
||
both |
no |
yes |
yes |
yes |
no |
needs editing |
|
mono |
no |
yes |
no |
no |
no |
||
mono |
yes |
yes |
no |
no |
no |
||
mono |
no |
no |
no |
no |
no |
||
mono |
no |
no |
no |
no |
yes 10 |
||
mono |
no |
yes |
no |
no |
no |
||
mono |
no |
yes |
yes |
yes |
no |
needs editing |
|
mono |
no |
no |
no |
no |
no |
||
mono |
no |
no |
no |
yes |
no |
||
mono |
no |
no |
no |
no |
no |
||
mono |
no |
no |
no |
no |
no |
||
mono |
no |
no |
no |
no |
no |
||
mono |
no |
no |
no |
no |
no |
||
mono |
no |
no |
no |
no |
no |
||
バイリンガル |
no |
yes |
no |
no |
yes 10 |
||
mono |
no |
no |
no |
no |
no |
- 1
- 2
Plurals are necessary to properly localize strings with variable count.
- 3
Comments can be used to pass additional info about the string to translate.
- 4
Context is used to differentiate identical strings used in different scopes (for example Sun can be used as an abbreviated name of the day "Sunday" or as the name of our closest star).
- 5
Location of a string in source code might help proficient translators figure out how the string is used.
- 6
Additional states supported by the file format in addition to "Not translated" and "Translated".
- 7
XML comment placed before the
<string>
element, parsed as a developer comment.- 8
参照: フラグを使用した動作の設定
- 9(1,2)
The gettext type comments are used as flags.
- 10(1,2,3,4,5,6)
The flags are extracted from the non-standard attribute
weblate-flags
for all XML based formats. Additionallymax-length:N
is supported through themaxwidth
attribute as defined in the XLIFF standard, see Specifying translation flags.- 11
The plurals are supported only for Laravel which uses in string syntax to define them, see Localization in Laravel.
編集不可の文字列¶
バージョン 3.10 で追加.
Read-only strings from translation files will be included, but
can not be edited in Weblate. This feature is natively supported by few formats
(XLIFF and Android string resources), but can be emulated in others by adding a
read-only
flag, see フラグを使用した動作の設定.
GNU gettext¶
libre ソフトウェアの翻訳に最も広く使用されているフォーマット。
Contextual info stored in the file is supported by adjusting its headers or linking to corresponding source files.
The bilingual gettext PO file typically looks like this:
#: weblate/media/js/bootstrap-datepicker.js:1421
msgid "Monday"
msgstr "Pondělí"
#: weblate/media/js/bootstrap-datepicker.js:1421
msgid "Tuesday"
msgstr "Úterý"
#: weblate/accounts/avatar.py:163
msgctxt "No known user"
msgid "None"
msgstr "Žádný"
Typical Weblate Component configuration |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
Empty |
新しい翻訳のテンプレート |
|
ファイル形式 |
Gettext PO file |
参考
GNU gettext を使用するソフトウェアによる翻訳、Translating documentation using Sphinx、Gettext Wikipedia 参照: 、PO Files、configure ファイルの ALL_LINGUAS 変数の更新、gettext 出力のカスタマイズ、LINGUAS ファイルの更新、MO ファイルの生成、POT に一致する PO ファイルの更新(msgmerge)
Monolingual gettext¶
Some projects decide to use gettext as monolingual formats—they code just the IDs in their source code and the string then needs to be translated to all languages, including English. This is supported, though you have to choose this file format explicitly when importing components into Weblate.
The monolingual gettext PO file typically looks like this:
#: weblate/media/js/bootstrap-datepicker.js:1421
msgid "day-monday"
msgstr "Pondělí"
#: weblate/media/js/bootstrap-datepicker.js:1421
msgid "day-tuesday"
msgstr "Úterý"
#: weblate/accounts/avatar.py:163
msgid "none-user"
msgstr "Žádný"
While the base language file will be:
#: weblate/media/js/bootstrap-datepicker.js:1421
msgid "day-monday"
msgstr "Monday"
#: weblate/media/js/bootstrap-datepicker.js:1421
msgid "day-tuesday"
msgstr "Tuesday"
#: weblate/accounts/avatar.py:163
msgid "none-user"
msgstr "None"
Typical Weblate Component configuration |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
|
新しい翻訳のテンプレート |
|
ファイル形式 |
Gettext PO file (monolingual) |
XLIFF¶
XML-based format created to standardize translation files, but in the end it is one of many standards, in this area.
XML Localization Interchange File Format (XLIFF) is usually used as bilingual, but Weblate supports it as monolingual as well.
参考
XML Localization Interchange File Format (XLIFF) specification
Translation states¶
バージョン 3.3 で変更: Weblate ignored the state
attribute prior to the 3.3 release.
The state
attribute in the file is partially processed and mapped to the
"Needs edit" state in Weblate (the following states are used to flag the string as
needing edit if there is a target present: new
, needs-translation
,
needs-adaptation
, needs-l10n
). Should the state
attribute be
missing, a string is considered translated as soon as a <target>
element
exists.
If the translation string has approved="yes"
, it will also be imported into Weblate
as "Approved", anything else will be imported as "Waiting for review" (which matches the
XLIFF specification).
While saving, Weblate doesn't add those attributes unless necessary:
The
state
attribute is only added in case string is marked as needing edit.The
approved
attribute is only added in case string has been reviewed.In other cases the attributes are not added, but they are updated in case they are present.
That means that when using the XLIFF format, it is strongly recommended to turn on the Weblate review process, in order to see and change the approved state of strings.
Similarly upon importing such files (in the upload form), you should choose Import as translated under Processing of strings needing edit.
参考
Whitespace and newlines in XLIFF¶
Generally types or amounts of whitespace is not differentiated between in XML formats.
If you want to keep it, you have to add the xml:space="preserve"
flag to
the string.
例:
<trans-unit id="10" approved="yes">
<source xml:space="preserve">hello</source>
<target xml:space="preserve">Hello, world!
</target>
</trans-unit>
Specifying translation flags¶
You can specify additional translation flags (see フラグを使用した動作の設定) by
using the weblate-flags
attribute. Weblate also understands maxwidth
and font
attributes from the XLIFF specification:
<trans-unit id="10" maxwidth="100" size-unit="pixel" font="ubuntu;22;bold">
<source>Hello %s</source>
</trans-unit>
<trans-unit id="20" maxwidth="100" size-unit="char" weblate-flags="c-format">
<source>Hello %s</source>
</trans-unit>
The font
attribute is parsed for font family, size and weight, the above
example shows all of that, though only font family is required. Any whitespace
in the font family is converted to underscore, so Source Sans Pro
becomes
Source_Sans_Pro
, please keep that in mind when naming the font group (see
フォントの管理).
文字列キー¶
Weblate identifies the units in the XLIFF file by resname
attribute in case
it is present and falls back to id
(together with file
tag if present).
The resname
attribute is supposed to be human friendly identifier of the
unit making it more suitable for Weblate to display instead of id
. The
resname
has to be unique in the whole XLIFF file. This is required by
Weblate and is not covered by the XLIFF standard - it does not put any
uniqueness restrictions on this attribute.
Typical Weblate Component configuration for bilingual XLIFF |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
Empty |
新しい翻訳のテンプレート |
|
ファイル形式 |
XLIFF Translation File |
Typical Weblate Component configuration for monolingual XLIFF |
|
---|---|
File mask |
|
単一言語のベース言語ファイル |
|
新しい翻訳のテンプレート |
|
ファイル形式 |
XLIFF Translation File |
Java properties¶
Native Java format for translations.
Java properties are usually used as monolingual translations.
Weblate supports ISO-8859-1, UTF-8 and UTF-16 variants of this format. All of
them support storing all Unicode characters, it is just differently encoded.
In the ISO-8859-1, the Unicode escape sequences are used (for example zkou\u0161ka
),
all others encode characters directly either in UTF-8 or UTF-16.
注釈
Loading escape sequences works in UTF-8 mode as well, so please be careful choosing the correct encoding set to match your application needs.
Typical Weblate Component configuration |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
|
新しい翻訳のテンプレート |
Empty |
ファイル形式 |
Java Properties (ISO-8859-1) |
GWT プロパティ¶
Native GWT format for translations.
GWT properties are usually used as monolingual translations.
Typical Weblate Component configuration |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
|
新しい翻訳のテンプレート |
Empty |
ファイル形式 |
GWT Properties |
INI translations¶
バージョン 4.1 で追加.
INI file format for translations.
INI translations are usually used as monolingual translations.
Typical Weblate Component configuration |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
|
新しい翻訳のテンプレート |
Empty |
ファイル形式 |
INI File |
注釈
Weblate only extracts keys from sections within an INI file. In case your INI file lacks sections, you might want to use Joomla translations or Java properties instead.
Inno Setup INI の翻訳¶
バージョン 4.1 で追加.
翻訳用の Inno Setup INI ファイル形式。
Inno Setup INI の翻訳は、通常、単一言語の翻訳として使用されます。
注釈
The only notable difference to INI translations is in supporting %n
and %t
placeholders for line break and tab.
Typical Weblate Component configuration |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
|
新しい翻訳のテンプレート |
Empty |
ファイル形式 |
Inno Setup INI File |
注釈
Only Unicode files (.islu
) are currently supported, ANSI variant
(.isl
) is currently not supported.
Joomla translations¶
バージョン 2.12 で追加.
Native Joomla format for translations.
Joomla translations are usually used as monolingual translations.
Typical Weblate Component configuration |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
|
新しい翻訳のテンプレート |
Empty |
ファイル形式 |
Joomla Language File |
Qt Linguist .ts¶
Translation format used in Qt based applications.
Qt Linguist files are used as both bilingual and monolingual translations.
Typical Weblate Component configuration when using as bilingual |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
Empty |
新しい翻訳のテンプレート |
|
ファイル形式 |
Qt Linguist Translation File |
Typical Weblate Component configuration when using as monolingual |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
|
新しい翻訳のテンプレート |
|
ファイル形式 |
Qt Linguist Translation File |
Android string resources¶
Android specific file format for translating applications.
Android string resources are monolingual, the 単一言語のベース言語ファイル is
stored in a different location from the others res/values/strings.xml
.
Typical Weblate Component configuration |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
|
新しい翻訳のテンプレート |
Empty |
ファイル形式 |
Android String Resource |
注釈
Android string-array structures are not currently supported. To work around this, you can break your string arrays apart:
<string-array name="several_strings">
<item>First string</item>
<item>Second string</item>
</string-array>
become:
<string-array name="several_strings">
<item>@string/several_strings_0</item>
<item>@string/several_strings_1</item>
</string-array>
<string name="several_strings_0">First string</string>
<string name="several_strings_1">Second string</string>
The string-array that points to the string elements should be stored in a different file, and not be made available for translation.
This script may help pre-process your existing strings.xml files and translations: https://gist.github.com/paour/11291062
Apple iOS strings¶
Apple specific file format for translating applications, used for both iOS and iPhone/iPad application translations.
Apple iOS strings are usually used as bilingual translations.
Typical Weblate Component configuration |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
|
新しい翻訳のテンプレート |
Empty |
ファイル形式 |
iOS Strings (UTF-8) |
PHP 文字列¶
PHP translations are usually monolingual, so it is recommended to specify a base file with (what is most often the) English strings.
Example file:
<?php
$LANG['foo'] = 'bar';
$LANG['foo1'] = 'foo bar';
$LANG['foo2'] = 'foo bar baz';
$LANG['foo3'] = 'foo bar baz bag';
Typical Weblate Component configuration |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
|
新しい翻訳のテンプレート |
|
ファイル形式 |
PHP strings |
Laravel PHP 文字列¶
バージョン 4.1 で変更.
The Laravel PHP localization files are supported as well with plurals:
<?php
return [
'welcome' => 'Welcome to our application',
'apples' => 'There is one apple|There are many apples',
];
JSON files¶
バージョン 2.0 で追加.
バージョン 2.16 で変更: Since Weblate 2.16 and with translate-toolkit at-least 2.2.4, nested structure JSON files are supported as well.
バージョン 4.3 で変更: The structure of JSON file is properly preserved even for complex situations which were broken in prior releases.
JSON format is used mostly for translating applications implemented in JavaScript.
Weblate currently supports several variants of JSON translations:
Simple key / value files, used for example by vue-i18n or react-intl.
Files with nested keys.
JSON translations are usually monolingual, so it is recommended to specify a base file with (what is most often the) English strings.
Example file:
{
"Hello, world!\n": "Ahoj světe!\n",
"Orangutan has %d banana.\n": "",
"Try Weblate at https://demo.weblate.org/!\n": "",
"Thank you for using Weblate.": ""
}
Nested files are supported as well (see above for requirements), such a file can look like:
{
"weblate": {
"hello": "Ahoj světe!\n",
"orangutan": "",
"try": "",
"thanks": ""
}
}
ヒント
The JSON file and JSON nested structure file can both handle same type of files. Both preserve existing JSON structure when translating.
The only difference between them is when adding new strings using Weblate.
The nested structure format parses the newly added key and inserts the new
string into the matching structure. For example app.name
key is inserted as:
{
"app": {
"name": "Weblate"
}
}
Typical Weblate Component configuration |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
|
新しい翻訳のテンプレート |
Empty |
ファイル形式 |
JSON nested structure file |
JSON i18next files¶
バージョン 2.17 で変更: Since Weblate 2.17 and with translate-toolkit at-least 2.2.5, i18next JSON files with plurals are supported as well.
i18next is an internationalization framework written in and for JavaScript. Weblate supports its localization files with features such as plurals.
i18next translations are monolingual, so it is recommended to specify a base file with (what is most often the) English strings.
注釈
Weblate は i18next JSON v3 形式に対応しています。v2 と v1 の違いは、複数形の処理方法を除いて、ほぼ互換性があります。
Example file:
{
"hello": "Hello",
"apple": "I have an apple",
"apple_plural": "I have {{count}} apples",
"apple_negative": "I have no apples"
}
Typical Weblate Component configuration |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
|
新しい翻訳のテンプレート |
Empty |
ファイル形式 |
i18next JSON file |
go-i18n JSON files¶
バージョン 4.1 で追加.
go-i18n translations are monolingual, so it is recommended to specify a base file with (what is most often the) English strings.
注釈
Weblate supports the go-i18n JSON v1 format, for flat JSON formats please use JSON files. The v2 format with hash is currently not supported.
Typical Weblate Component configuration |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
|
新しい翻訳のテンプレート |
Empty |
ファイル形式 |
go-i18n JSON file |
ARB File¶
バージョン 4.1 で追加.
ARB translations are monolingual, so it is recommended to specify a base file with (what is most often the) English strings.
Typical Weblate Component configuration |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
|
新しい翻訳のテンプレート |
Empty |
ファイル形式 |
ARB file |
WebExtension JSON¶
バージョン 2.16 で追加: This is supported since Weblate 2.16 and with translate-toolkit at-least 2.2.4.
File format used when translating extensions for Mozilla Firefox or Google Chromium.
注釈
While this format is called JSON, its specification allows to include comments, which are not part of JSON specification. Weblate currently does not support file with comments.
Example file:
{
"hello": {
"message": "Ahoj světe!\n",
"description": "Description",
"placeholders": {
"url": {
"content": "$1",
"example": "https://developer.mozilla.org"
}
}
},
"orangutan": {
"message": "",
"description": "Description"
},
"try": {
"message": "",
"description": "Description"
},
"thanks": {
"message": "",
"description": "Description"
}
}
Typical Weblate Component configuration |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
|
新しい翻訳のテンプレート |
Empty |
ファイル形式 |
WebExtension JSON file |
.XML resource files¶
バージョン 2.3 で追加.
A .XML resource (.resx) file employs a monolingual XML file format used in Microsoft .NET applications. It is interchangeable with .resw, when using identical syntax to .resx.
Typical Weblate Component configuration |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
|
新しい翻訳のテンプレート |
Empty |
ファイル形式 |
.NET resource file |
参考
.NET Resource files (.resx)、ref:addon-weblate.cleanup.generic
CSV files¶
バージョン 2.4 で追加.
CSV files can contain a simple list of source and translation. Weblate supports the following files:
Files with header defining fields (
location
,source
,target
,ID
,fuzzy
,context
,translator_comments
,developer_comments
). This is the recommended approach, as it is the least error prone. Choose CSV file as a file format.Files with two fields—source and translation (in this order). Choose Simple CSV file as a file format.
Headerless files with fields in order defined by the translate-toolkit:
location
,source
,target
,ID
,fuzzy
,context
,translator_comments
,developer_comments
. Choose CSV file as a file format.Remember to define 単一言語のベース言語ファイル when your files are monolingual (see Bilingual and monolingual formats).
警告
The CSV format currently automatically detects the dialect of the CSV file. In some cases the automatic detection might fail and you will get mixed results. This is especially true for CSV files with newlines in the values. As a workaround it is recommended to omit quoting characters.
Example file:
Thank you for using Weblate.,Děkujeme za použití Weblate.
Typical Weblate Component configuration for bilingual CSV |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
Empty |
新しい翻訳のテンプレート |
|
ファイル形式 |
CSV file |
Typical Weblate Component configuration for monolingual CSV |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
|
新しい翻訳のテンプレート |
|
ファイル形式 |
シンプルな CSV ファイル |
参考
YAML files¶
バージョン 2.9 で追加.
The plain YAML files with string keys and values. Weblate also extract strings from lists or dictionaries.
Example of a YAML file:
weblate:
hello: ""
orangutan": ""
try": ""
thanks": ""
Typical Weblate Component configuration |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
|
新しい翻訳のテンプレート |
Empty |
ファイル形式 |
YAML file |
Ruby YAML files¶
バージョン 2.9 で追加.
Ruby i18n YAML files with language as root node.
Example Ruby i18n YAML file:
cs:
weblate:
hello: ""
orangutan: ""
try: ""
thanks: ""
Typical Weblate Component configuration |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
|
新しい翻訳のテンプレート |
Empty |
ファイル形式 |
Ruby YAML file |
参考
DTD files¶
バージョン 2.18 で追加.
Example DTD file:
<!ENTITY hello "">
<!ENTITY orangutan "">
<!ENTITY try "">
<!ENTITY thanks "">
Typical Weblate Component configuration |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
|
新しい翻訳のテンプレート |
Empty |
ファイル形式 |
DTD file |
Flat XML files¶
バージョン 3.9 で追加.
Example of a flat XML file:
<?xml version='1.0' encoding='UTF-8'?>
<root>
<str key="hello_world">Hello World!</str>
<str key="resource_key">Translated value.</str>
</root>
Typical Weblate Component configuration |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
|
新しい翻訳のテンプレート |
Empty |
ファイル形式 |
Flat XML file |
参考
Windows RC files¶
バージョン 4.1 で変更: Support for Windows RC files has been rewritten.
注釈
Support for this format is currently in beta, feedback from testing is welcome.
Example Windows RC file:
LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
STRINGTABLE
BEGIN
IDS_MSG1 "Hello, world!\n"
IDS_MSG2 "Orangutan has %d banana.\n"
IDS_MSG3 "Try Weblate at http://demo.weblate.org/!\n"
IDS_MSG4 "Thank you for using Weblate."
END
Typical Weblate Component configuration |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
|
新しい翻訳のテンプレート |
|
ファイル形式 |
RC file |
アプリ ストア メタデータ ファイル¶
バージョン 3.5 で追加.
Metadata used for publishing apps in various app stores can be translated. Currently the following tools are compatible:
The metadata consists of several textfiles, which Weblate will present as separate strings to translate.
Typical Weblate Component configuration |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
|
新しい翻訳のテンプレート |
|
ファイル形式 |
App store metadata files |
ヒント
In case you don't want to translate certain strings (for example changelogs), mark them read-only (see フラグを使用した動作の設定). This can be automated by the 一括編集.
Subtitle files¶
バージョン 3.7 で追加.
Weblate は、さまざまな字幕ファイルを翻訳できます。
SubRip subtitle file (
*.srt
)MicroDVD subtitle file (
*.sub
)Advanced Substation Alpha subtitles file (
*.ass
)Substation Alpha subtitle file (
*.ssa
)
Typical Weblate Component configuration |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
|
新しい翻訳のテンプレート |
|
ファイル形式 |
SubRip subtitle file |
参考
Excel Open XML¶
バージョン 3.2 で追加.
Excel Open XML (.xlsx) files can be imported and exported.
When uploading XLSX files for translation, be aware that only the active
worksheet is considered, and there must be at least a column called source
(which contains the source string) and a column called target
(which
contains the translation). Additionally there should be the column called context
(which contains the context path of the translation string). If you use the XLSX
download for exporting the translations into an Excel workbook, you already get
a file with the correct file format.
HTML ファイル¶
バージョン 4.1 で追加.
注釈
Support for this format is currently in beta, feedback from testing is welcome.
The translatable content is extracted from the HTML files and offered for the translation.
参考
テキストファイル¶
バージョン 4.6 で追加.
注釈
Support for this format is currently in beta, feedback from testing is welcome.
The translatable content is extracted from the plain text files and offered for the translation. Each paragraph is translated as a separate string.
この形式の 3 種類:
プレーンテキストファイル
DokuWiki テキストファイル
MediaWiki テキストファイル
OpenDocument Format¶
バージョン 4.1 で追加.
注釈
Support for this format is currently in beta, feedback from testing is welcome.
The translatable content is extracted from the OpenDocument files and offered for the translation.
IDML Format¶
バージョン 4.1 で追加.
注釈
Support for this format is currently in beta, feedback from testing is welcome.
The translatable content is extracted from the Adobe InDesign Markup Language files and offered for the translation.
TermBase eXchange 形式¶
バージョン 4.5 で追加.
TBX は、用語データーを交換するための XML 形式です。
Typical Weblate Component configuration |
|
---|---|
ファイルマスク |
|
単一言語のベース言語ファイル |
Empty |
新しい翻訳のテンプレート |
Empty |
ファイル形式 |
TermBase eXchange ファイル |
他の形式への対応¶
Most formats supported by translate-toolkit which support serializing can be easily supported, but they did not (yet) receive any testing. In most cases some thin layer is needed in Weblate to hide differences in behavior of different translate-toolkit storages.
To add support for a new format, the preferred approach is to first implement support for it in the translate-toolkit.
バージョン管理の統合¶
Weblate は現在、バージョン管理のバックエンドとして Git (GitHub、Gerrit および Subversion の拡張サポート付き)および Mercurial に対応しています。
リポジトリへの接続¶
使用する VCS リポジトリに Weblate から接続することが必要です。一般に公開されているリポジトリの場合は、正しい URL(例: https://github.com/WeblateOrg/weblate.git`)を入力するだけですが、プライベートなリポジトリやプッシュ URL の場合は、設定がより複雑になり、認証することが必要です。
Hosted Weblate からリポジトリへの接続¶
Hosted Weblate では GitHub、Bitbucket、Codeberg、および GitLab(ユーザー名 weblate、メールアドレス hosted@weblate.org
、表示名 Weblate push user )に登録したプッシュ専用ユーザーがいます。このユーザーをコラボレーターとして追加し、リポジトリに適切な権限を与えることが必要です(クローン作成には読み取り専用、プッシュには書き込みが必要)。サービスと組織の設定にもよるが、すぐに実行するか、Weblate 側で確認することが必要です。
GitHub の weblate ユーザーは、5 分以内に自動的に招待が承認されます。他のサービスでは手動での処理が必要なことがありますが、我慢してください。
weblate ユーザーを追加すると、SSH プロトコル(例: git@github.com:WeblateOrg/weblate.git
)を使用して ソースコードのリポジトリ と リポジトリの送信先 URL を設定できます。
SSH リポジトリ¶
プライベート リポジトリに接続するために最もよく使用される方法は、SSH による接続です。SSH で upstream リポジトリに接続するために、Weblate SSH 公開鍵(参照: Weblate SSH キー)を承認します。
警告
GitHub では、各キーは 1 度しか使用できません。参照: GitHub リポジトリ および Hosted Weblate からリポジトリへの接続。
また、Weblate は最初の接続時にホスト鍵のフィンガープリントを保存し、後で変更した場合にはホストに接続できません(参照: SSH ホスト認証鍵の承認)。
変更が必要な場合は、Weblate 管理インタフェースから設定します。

Weblate SSH キー¶
Weblate 公開鍵は、About ページを閲覧するすべてのユーザーに表示されます。
管理者は、管理画面のランディング ページ内の接続(ラベル SSH keys)で Weblate が現在使用している公開鍵を生成または表示できます。
注釈
対応するプライベート SSH 認証鍵は現在パスワードを設定できないため、適切に保護されているか確認してください。
ヒント
生成されたプライベートな Weblate の SSH 認証鍵のバックアップを作成します。
SSH ホスト認証鍵の承認¶
Weblate は、次回からの接続のために、最初の接続時に SSH ホスト認証鍵を自動的に記録します。
リポジトリに接続する前に公開鍵の指紋を確認する場合は、管理画面の同じセクションから ホスト鍵の追加 で接続するサーバーの SSH ホスト認証鍵を追加してください。接続するホスト名(例: gitlab.com
)を入力し、送信 を押します。公開鍵の指紋が追加したサーバーと一致しているかどうかを確認します。
確認メッセージに表示される、追加した公開鍵の指紋:

GitHub リポジトリ¶
SSH 経由での接続もできますが(参照: SSH リポジトリ)、複数のリポジトリに接続することが必要な場合は、許可された SSH 認証鍵の使用は GitHub の制限を受けます(各認証鍵の使用は 1 度のみ)。
ブランチに push を設定していない場合、プロジェクトはフォークされ、変更はフォークを通してプッシュされます。設定されている場合、変更は upstream リポジトリと選択したブランチにプッシュされます。
小規模な設置の場合は、HTTPS 認証で個人用アクセス トークンと GitHub アカウントを使用します。参照: Creating an access token for command-line use 。
大規模な設置の場合は、通常、Weblate 専用のユーザーを作成し、そこに Weblate で生成した公開 SSH 認証鍵(参照: Weblate SSH キー)を割り当て、翻訳したいすべてのリポジトリへの接続を許可することを推奨します。このアプローチは Hosted Weblate にも適用され、専用の weblate ユーザーが存在します。
Weblate の内部 URL¶
他の(リンクした)コンポーネント内の 「weblate :// project/component」 として配置を参照することで、異なるコンポーネント間でリポジトリ設定を共有します。このようにして、リンクされたコンポーネントはメイン (参照) コンポーネントのVCSレポジトリ設定を使用します。
警告
Removing main component also removes linked components.
Weblate は、コンポーネントの作成時に、リポジトリ設定が一致するコンポーネントを見つけると、自動的にリポジトリの URL を修正します。URL は、コンポーネント設定の最後の段階で上書きできます。
使用理由:
サーバーのディスク容量を節約。リポジトリは一度だけ保存される。
更新を高速化する。リポジトリは 1 つだけ更新される。
Weblate 翻訳を使用してエクスポートするリポジトリは 1 つだけ(参照: Git exporter)。
一部のアドオンでは、単一のリポジトリを共有する複数のコンポーネント上で動作するものもあります。例: Git コミットの簡略化。
HTTPS リポジトリ¶
保護された HTTPS リポジトリに接続するには、URL にユーザー名とパスワードを含めます。心配は無用です、URL がユーザーに表示されるときに、Weblate はこの情報を削除します(リポジトリ URL の表示を許可していても)。
例えば、認証を追加した GitHub URL は次のようになります: https://user:your_access_token@github.com/WeblateOrg/weblate.git
。
注釈
ユーザー名やパスワードに特殊文字が含まれている場合は、URL をエンコードすることが必要です https://user%40example.com:%24password%23@bitbucket.org/…
。
プロキシの使用¶
プロキシー サーバーを使用して HTTP/HTTPS VCS リポジトリに接続することが必要な場合は、VCS の使用を設定します。
これは環境変数(cURL documentation に記載の通り)の http_proxy
、 https_proxy
、および all_proxy
を使用するか、VCS 設定で次のように実行する:
git config --global http.proxy http://user:password@proxy.example.com:80
注釈
プロキシの設定は、Weblate を実行しているユーザ(参照: ファイル システムのアクセス権)と ``HOME=$DATA_DIR/home``(参照: DATA_DIR
)を使用して設定することが必要です。他の設定だと、Weblate は Git を実行しません。
Git¶
参考
さまざまな種類のリポジトリに接続する方法については、リポジトリへの接続 を確認してください。
Git に強制プッシュ¶
これは Git 自体とまったく同じように動作しますが、唯一の違いは、常に強制的にプッシュすることです。これは、翻訳に別のリポジトリを使用する場合にのみ使用します。
警告
upstream のリポジトリではコミットが失われやすいので、注意して使用してください。
Git 設定のカスタマイズ¶
Weblate は、すべての VCS コマンドを HOME=$DATA_DIR/home
(参照: DATA_DIR
)で実行します。したがって、ユーザー設定の編集は DATA_DIR/home/.git
で行うことが必要です。
Git リモート ヘルパー¶
他のバージョン管理システムを追加して対応するために remote helpers を使用できますが、これにより発生する可能性がある問題をデバッグする準備をしてください。
現時点では、Bazaar と Mercurial のヘルパーは GitHub 上の別々のリポジトリ、GitHub: git-remote-hg と git-remote-bzr で利用できます。手動でダウンロードし、検索パス(例: ~/bin
)に配置します。対応するバージョン管理システムがインストールされていることを確認してください。
これらをインストールしたら、このようなリモートを使用して Weblate でリポジトリを設定できます。
Bazaar を使用して Launchpad から gnuhello
プロジェクトの複製:
bzr::lp:gnuhello
Mercurial を使用した selenic.com の hello
リポジトリの場合:
hg::http://selenic.com/repo/hello
警告
Git のリモート ヘルパーを使う上で不便な点は、例えば Mercurial の場合、変更を元に戻すときにリモート ヘルパーが新しい tip を作成してしまうことがあります。
GitHub¶
バージョン 2.3 で追加.
これにより、リポジトリに直接プッシュするのではなく、GithHub API を使用して 、薄いレイヤーを Git に追加して、翻訳の変更をプル リクエストとしてプッシュできるようになります。
Git は変更を直接リポジトリにプッシュしますが、GitHub はプル リクエストを作成します。後者は Git リポジトリに接続する場合には必要ありません。
プルリクエストとして変更を GitHub にプッシュする¶
変換を GitHub リポジトリにプッシュしたくない場合は、代わりに 1 つまたは複数のプル リクエストとして送信できます。
この機能の動作には、API 認証情報の設定が必要です。
GitLab¶
バージョン 3.9 で追加.
これにより、リポジトリに直接プッシュするのではなく、GitLab API を使用して 、薄いレイヤーを Git に追加して、翻訳の変更をプル リクエストとしてプッシュできるようになります。
Gitリポジトリにアクセスするためにこれを使う必要はありません。通常 Git は同じように動作しますが、唯一の違いはリポジトリへのプッシュの扱い方です。Git では、変更はリポジトリに直接プッシュされますが、GitLab ではマージ リクエストが作成されます。
GitLab への変更をマージ リクエストとしてプッシュする¶
変換を GitLab リポジトリにプッシュしたくない場合は、代わりに 1 つまたは複数のマージ リクエストとして送信できます。
この機能の動作には、API 認証情報の設定が必要です。
Pagure¶
バージョン 4.3.2 で追加.
これにより、リポジトリに直接プッシュするのではなく、Pagure API を使用して 、薄いレイヤーを Git に追加するだけで、翻訳の変更をプル リクエストとしてプッシュできます。
Git リポジトリにアクセスするために、これを使う必要はありません。通常 Git は同じように動作しますが、唯一の違いはリポジトリへのプッシュの扱い方です。Git では、変更はリポジトリに直接プッシュされますが、Pagure ではマージ リクエストが作成されます。
マージ リクエストとして Pagure に変更をプッシュする¶
翻訳を Pagure リポジトリにプッシュしたくない場合は、代わりに 1 つまたは複数のマージ リクエストとして送信できます。
この機能の動作には、API 認証情報の設定が必要です。
Gerrit¶
バージョン 2.2 で追加.
git-review ツールを使用して、リポジトリに直接プッシュするのではなく、Gerrit レビュー リクエストとして翻訳変更をプッシュするために、Git の上に薄いレイヤを追加します。
Gerrit ドキュメントには、このようなリポジトリを設定するために必要な設定の詳細が記載されています。
Mercurial¶
バージョン 2.1 で追加.
Mercurial は、Weblate で直接使用できるもう 1 つの VCS です。
注釈
Mercurial のどのバージョンでも動作するはずですが、コマンドライン インタフェースに互換性のない変更が追加されたので、Weblate との統合ができないことがあります。
参考
さまざまな種類のリポジトリに接続する方法については、リポジトリへの接続 を確認してください。
Subversion¶
バージョン 2.8 で追加.
Weblate は git-svn を使用して subversion リポジトリと通信します。これは、Git クライアントで Subversion を使用できる Perl スクリプトで、ユーザーは内部リポジトリの完全なクローンを維持し、ローカルでコミットできるようにします。
注釈
Weblate は Subversion リポジトリ レイアウトを自動的に検出しようとします ー ブランチの直接の URL と標準レイアウトのリポジトリの両方をサポートします(branches/、tags/、および trunk/)。詳細は git-svn documentation を確認してください。リポジトリに標準レイアウトがなく、エラーが発生した場合は、リポジトリ URL にブランチ名を含め、ブランチを空のままにします。
バージョン 2.19 で変更: これ以前は、標準レイアウト リポジトリのみに対応してました。
ローカル ファイル¶
バージョン 3.8 で追加.
Weblate は、リモート VCS がなくても動作します。最初の翻訳は、アップロードするとインポートされます。あとで、個々のファイルをファイル アップロードで置き換えるか、Weblate から直接、翻訳文字列を追加できます(現在、単一言語翻訳でのみ使用できます)。
Weblate はバックグラウンドで Git リポジトリを作成し、すべての変更を記録します。後で VCS を使用して翻訳を保存する場合は、すでに Weblate 内に統合のベースとなるリポジトリがあります。
Weblate's REST API¶
バージョン 2.6 で追加: REST API は、Weblate 2.6 から使用できる。
API は /api/
URL からアクセスでき、Django REST framework がベースになっています。直接もしくは、Weblate クライアント から使用できます。
認証と一般的なパラメータ¶
公開プロジェクト API は認証なしで使用できますが、認証されていないリクエストは大幅に制限します(デフォルトでは、毎日100リクエスト)。制限回避のために、認証の使用を推奨します。認証ではトークンを使用し、ユーザー情報から取得します。Authorization
ヘッダーで使用する項目:
-
ANY
/
¶ API、ヘッダー、ステータスコード、およびパラメータの一般的なリクエスト動作は、すべてのエンドポイントにも適用します。
- クエリ パラメータ
format -- レスポンス形式(上書き Accept)。指定できる値は REST フレームワークの設定に依存します。デフォルトでは
json
およびapi
に対応。後者には、API 用の Web ブラウザー インターフェースを提供する。
- リクエスト ヘッダー
Authorization -- 認証用のオプションのトークン
- レスポンス ヘッダー
Content-Type -- リクエストの Accept ヘッダーに依存する
Allow -- オブジェクトで許可されている HTTP メソッドのリスト
- レスポンス JSON オブジェクト
detail (string) -- 結果の詳細な説明(200 OK 以外の HTTP ステータス コードの場合)
count (int) -- オブジェクト リストの合計項目数
next (string) -- オブジェクト リストの次のページの URL
previous (string) -- オブジェクト リストの前のページの URL
results (array) -- オブジェクト リストの結果
url (string) -- このリソースへの API を使用したアクセス用の URL
web_url (string) -- このリソースへの Web ブラウザを使用したアクセス用の URL
- ステータスコード
200 OK -- リクエストが正常に処理された場合
201 Created -- when a new object was created successfully
204 No Content -- when an object was created successfully
400 Bad Request -- フォーム パラメータが不足している場合
403 Forbidden -- アクセスが拒否された場合
429 Too Many Requests -- スロットルが設定されている場合
認証の例¶
リクエストの例:
GET /api/ HTTP/1.1
Host: example.com
Accept: application/json, text/javascript
Authorization: Token YOUR-TOKEN
レスポンスの例:
HTTP/1.0 200 OK
Date: Fri, 25 Mar 2016 09:46:12 GMT
Server: WSGIServer/0.1 Python/2.7.11+
Vary: Accept, Accept-Language, Cookie
X-Frame-Options: SAMEORIGIN
Content-Type: application/json
Content-Language: en
Allow: GET, HEAD, OPTIONS
{
"projects":"http://example.com/api/projects/",
"components":"http://example.com/api/components/",
"translations":"http://example.com/api/translations/",
"languages":"http://example.com/api/languages/"
}
CURL の例:
curl \
-H "Authorization: Token TOKEN" \
https://example.com/api/
パラメータの受け渡し例¶
POST メソッドでは、フォーム送信(application/x-www-form-urlencoded)または JSON(application/json)のどちらかでパラメータを指定します。
フォーム リクエストの例:
POST /api/projects/hello/repository/ HTTP/1.1
Host: example.com
Accept: application/json
Content-Type: application/x-www-form-urlencoded
Authorization: Token TOKEN
operation=pull
JSON リクエストの例:
POST /api/projects/hello/repository/ HTTP/1.1
Host: example.com
Accept: application/json
Content-Type: application/json
Authorization: Token TOKEN
Content-Length: 20
{"operation":"pull"}
CURL の例:
curl \
-d operation=pull \
-H "Authorization: Token TOKEN" \
http://example.com/api/components/hello/weblate/repository/
CURL JSON の例:
curl \
--data-binary '{"operation":"pull"}' \
-H "Content-Type: application/json" \
-H "Authorization: Token TOKEN" \
http://example.com/api/components/hello/weblate/repository/
API 接続制限¶
API リクエストは接続制限しています。デフォルト設定では、匿名ユーザーの場合は 100 リクエスト / 日、認証済みユーザーの場合は 5000 リクエスト / 時間に制限しています。
接続制限は settings.py
で変更できます。詳細な設定方法は、Throttling in Django REST framework documentation を確認してください。
ヘッダーで報告される接続制限の状態:
|
実行するリクエストの接続制限回数 |
|
リクエストが制限されるまでの回数 |
|
接続可能秒数がリセットされるまでの秒数 |
バージョン 4.1 で変更: 接続制限状態のヘッダーの追加。
API エントリ ポイント¶
-
GET
/api/
¶ API ルート エントリ ポイント。
リクエストの例:
GET /api/ HTTP/1.1 Host: example.com Accept: application/json, text/javascript Authorization: Token YOUR-TOKEN
レスポンスの例:
HTTP/1.0 200 OK Date: Fri, 25 Mar 2016 09:46:12 GMT Server: WSGIServer/0.1 Python/2.7.11+ Vary: Accept, Accept-Language, Cookie X-Frame-Options: SAMEORIGIN Content-Type: application/json Content-Language: en Allow: GET, HEAD, OPTIONS { "projects":"http://example.com/api/projects/", "components":"http://example.com/api/components/", "translations":"http://example.com/api/translations/", "languages":"http://example.com/api/languages/" }
ユーザー¶
バージョン 4.0 で追加.
-
GET
/api/users/
¶ 返り値は、ユーザーの管理権限を持っている場合は、ユーザーの一覧です。持っていない場合は、自分の詳細のみになります。
参考
ユーザー オブジェクトの属性については、
GET /api/users/(str:username)/
にドキュメントがあります。
-
POST
/api/users/
¶ 新しいユーザーを作成します。
- パラメータ
username (string) -- ユーザー名
full_name (string) -- ユーザーのフルネーム
email (string) -- ユーザーのメールアドレス
is_superuser (boolean) -- ユーザーがスーパーユーザーかどうか? (オプション)
is_active (boolean) -- ユーザーが有効かどうか? (オプション)
-
GET
/api/users/
(str: username)/
¶ 返り値は、ユーザーの情報です。
- パラメータ
username (string) -- ユーザーのユーザー名
- レスポンス JSON オブジェクト
username (string) -- ユーザーのユーザー名
full_name (string) -- ユーザーのフルネーム
email (string) -- ユーザーのメールアドレス
is_superuser (boolean) -- ユーザーがスーパーユーザーかどうか
is_active (boolean) -- ユーザーが有効かどうか
date_joined (string) -- ユーザー登録日
groups (array) -- 関連するグループへのリンク。参照:
GET /api/groups/(int:id)/
JSON データの例:
{ "email": "user@example.com", "full_name": "Example User", "username": "exampleusername", "groups": [ "http://example.com/api/groups/2/", "http://example.com/api/groups/3/" ], "is_superuser": true, "is_active": true, "date_joined": "2020-03-29T18:42:42.617681Z", "url": "http://example.com/api/users/exampleusername/", "statistics_url": "http://example.com/api/users/exampleusername/statistics/" }
-
PUT
/api/users/
(str: username)/
¶ ユーザーのパラメータを変更します。
- パラメータ
username (string) -- ユーザーのユーザー名
- レスポンス JSON オブジェクト
username (string) -- ユーザーのユーザー名
full_name (string) -- ユーザーのフルネーム
email (string) -- ユーザーのメールアドレス
is_superuser (boolean) -- ユーザーがスーパーユーザーかどうか
is_active (boolean) -- ユーザーが有効かどうか
date_joined (string) -- ユーザー登録日
-
PATCH
/api/users/
(str: username)/
¶ ユーザーのパラメータを変更します。
- パラメータ
username (string) -- ユーザーのユーザー名
- レスポンス JSON オブジェクト
username (string) -- ユーザーのユーザー名
full_name (string) -- ユーザーのフルネーム
email (string) -- ユーザーのメールアドレス
is_superuser (boolean) -- ユーザーがスーパーユーザーかどうか
is_active (boolean) -- ユーザーが有効かどうか
date_joined (string) -- ユーザー登録日
-
DELETE
/api/users/
(str: username)/
¶ ユーザーのすべての情報を削除し、ユーザーを無効にします。
- パラメータ
username (string) -- ユーザーのユーザー名
-
POST
/api/users/
(str: username)/groups/
¶ ユーザーをグループに設定します。
- パラメータ
username (string) -- ユーザーのユーザー名
- フォーム パラメーター
string group_id -- 固有のグループ ID
-
GET
/api/users/
(str: username)/statistics/
¶ ユーザーの統計情報を一覧表示します。
- パラメータ
username (string) -- ユーザーのユーザー名
- レスポンス JSON オブジェクト
translated (int) -- ユーザーごとの翻訳数
suggested (int) -- ユーザーごとの提案数
uploaded (int) -- ユーザーごとのアップロード数
commented (int) -- ユーザーごとのコメント数
languages (int) -- ユーザーごとの翻訳可能な言語数
-
GET
/api/users/
(str: username)/notifications/
¶ ユーザーのサブスクリプションを一覧表示します。
- パラメータ
username (string) -- ユーザーのユーザー名
-
POST
/api/users/
(str: username)/notifications/
¶ ユーザーにサブスクリプションを関連付けます。
- パラメータ
username (string) -- ユーザーのユーザー名
- リクエスト JSON オブジェクト
notification (string) -- 登録中の通知の名前
scope (int) -- 選択肢の中で有効な通知する範囲
frequency (int) -- 通知の頻度の選択
-
GET
/api/users/
(str: username)/notifications/
(int: subscription_id)/
¶ ユーザーに設定中のサブスクリプションを取得します。
- パラメータ
username (string) -- ユーザーのユーザー名
subscription_id (int) -- 登録中の通知 ID
-
PUT
/api/users/
(str: username)/notifications/
(int: subscription_id)/
¶ ユーザーに設定されたサブスクリプションを編集します。
- パラメータ
username (string) -- ユーザーのユーザー名
subscription_id (int) -- 登録中の通知 ID
- リクエスト JSON オブジェクト
notification (string) -- 登録中の通知の名前
scope (int) -- 選択肢の中で有効な通知する範囲
frequency (int) -- 通知の頻度の選択
-
PATCH
/api/users/
(str: username)/notifications/
(int: subscription_id)/
¶ ユーザーに設定されたサブスクリプションを編集します。
- パラメータ
username (string) -- ユーザーのユーザー名
subscription_id (int) -- 登録中の通知 ID
- リクエスト JSON オブジェクト
notification (string) -- 登録中の通知の名前
scope (int) -- 選択肢の中で有効な通知する範囲
frequency (int) -- 通知の頻度の選択
-
DELETE
/api/users/
(str: username)/notifications/
(int: subscription_id)/
¶ ユーザーに設定されたサブスクリプションを削除します。
- パラメータ
username (string) -- ユーザーのユーザー名
subscription_id -- 登録中の通知の名前
subscription_id -- int
グループ¶
バージョン 4.0 で追加.
-
GET
/api/groups/
¶ 返り値は、グループの管理権限がある場合は、グループの一覧です。権限がない場合は、指定したユーザーが所属しているグループのみになります。
参考
グループ オブジェクトの属性については、
GET /api/groups/(int:id)/
にドキュメントがあります。
-
POST
/api/groups/
¶ 新しいグループを作成します。
- パラメータ
name (string) -- グループ名
project_selection (int) -- 指定した選択肢から選択したプロジェクトのグループ
language_selection (int) -- 指定した選択肢から選択した言語のグループ
-
GET
/api/groups/
(int: id)/
¶ 返り値は、グループの情報です。
- パラメータ
id (int) -- グループ ID
- レスポンス JSON オブジェクト
name (string) -- グループ名
project_selection (int) -- 整数 プロジェクトのグループ番号
language_selection (int) -- 整数 言語のグループ番号
roles (array) -- 関連するロールへのリンク。参照:
GET /api/roles/(int:id)/
projects (array) -- 関連するプロジェクトへのリンク。参照:
GET /api/projects/(string:project)/
components (array) -- 関連するコンポーネントへのリンク。参照:
GET /api/components/(string:project)/(string:component)/
componentlist (array) -- 関連するコンポーネント リストへのリンク。参照:
GET /api/component-lists/(str:slug)/
JSON データの例:
{ "name": "Guests", "project_selection": 3, "language_selection": 1, "url": "http://example.com/api/groups/1/", "roles": [ "http://example.com/api/roles/1/", "http://example.com/api/roles/2/" ], "languages": [ "http://example.com/api/languages/en/", "http://example.com/api/languages/cs/", ], "projects": [ "http://example.com/api/projects/demo1/", "http://example.com/api/projects/demo/" ], "componentlist": "http://example.com/api/component-lists/new/", "components": [ "http://example.com/api/components/demo/weblate/" ] }
-
PUT
/api/groups/
(int: id)/
¶ グループ パラメータを変更します。
- パラメータ
id (int) -- グループ ID
- レスポンス JSON オブジェクト
name (string) -- グループ名
project_selection (int) -- 整数 プロジェクトのグループ番号
language_selection (int) -- 整数 言語のグループ番号
-
PATCH
/api/groups/
(int: id)/
¶ グループ パラメータを変更します。
- パラメータ
id (int) -- グループ ID
- レスポンス JSON オブジェクト
name (string) -- グループ名
project_selection (int) -- 整数 プロジェクトのグループ番号
language_selection (int) -- 整数 言語のグループ番号
-
DELETE
/api/groups/
(int: id)/
¶ グループを削除します。
- パラメータ
id (int) -- グループ ID
-
POST
/api/groups/
(int: id)/roles/
¶ グループにロールを関連付けます。
- パラメータ
id (int) -- グループ ID
- フォーム パラメーター
string role_id -- 固有のロール ID
-
POST
/api/groups/
(int: id)/components/
¶ グループにコンポーネントを関連付けます。
- パラメータ
id (int) -- グループ ID
- フォーム パラメーター
string component_id -- 固有のコンポーネント ID
-
DELETE
/api/groups/
(int: id)/components/
(int: component_id)¶ グループからコンポーネントを削除します。
- パラメータ
id (int) -- グループ ID
component_id (int) -- 固有のコンポーネント ID
-
POST
/api/groups/
(int: id)/projects/
¶ グループにプロジェクトを関連付けます。
- パラメータ
id (int) -- グループ ID
- フォーム パラメーター
string project_id -- 固有のプロジェクト ID
-
DELETE
/api/groups/
(int: id)/projects/
(int: project_id)¶ プロジェクトをグループから削除します。
- パラメータ
id (int) -- グループ ID
project_id (int) -- 固有のプロジェクト ID
-
POST
/api/groups/
(int: id)/languages/
¶ グループに言語を関連付けます。
- パラメータ
id (int) -- グループ ID
- フォーム パラメーター
string language_code -- 固有の言語コード
-
DELETE
/api/groups/
(int: id)/languages/
(string: language_code)¶ 言語をグループから削除します。
- パラメータ
id (int) -- グループ ID
language_code (string) -- 固有の言語コード
-
POST
/api/groups/
(int: id)/componentlists/
¶ コンポーネント リストをグループに関連付けます。
- パラメータ
id (int) -- グループ ID
- フォーム パラメーター
string component_list_id -- 固有のコンポーネントリスト ID
-
DELETE
/api/groups/
(int: id)/componentlists/
(int: component_list_id)¶ コンポーネントリストをグループから削除します。
- パラメータ
id (int) -- グループ ID
component_list_id (int) -- 固有のコンポーネントリスト ID
ロール¶
-
GET
/api/roles/
¶ 返り値は、ユーザーに関連付けられたすべてのロールのリストです。ユーザーがスーパーユーザーの場合は、既存のすべてのロールのリストになります。
参考
ロールオブジェクトの属性については、
GET /api/roles/(int:id)/
にドキュメントがあります。
-
POST
/api/roles/
¶ 新しいロールを作成します。
- パラメータ
name (string) -- ロール名
permissions (array) -- アクセス権のコードネーム リスト
-
GET
/api/roles/
(int: id)/
¶ 返り値は、ロールの情報です。
- パラメータ
id (int) -- ロール ID
- レスポンス JSON オブジェクト
name (string) -- ロール名
permissions (array) -- アクセス権のコードネーム リスト
JSON データの例:
{ "name": "Access repository", "permissions": [ "vcs.access", "vcs.view" ], "url": "http://example.com/api/roles/1/", }
-
PUT
/api/roles/
(int: id)/
¶ ロールのパラメータを変更します。
- パラメータ
id (int) -- ロール ID
- レスポンス JSON オブジェクト
name (string) -- ロール名
permissions (array) -- アクセス権のコードネーム リスト
-
PATCH
/api/roles/
(int: id)/
¶ ロールのパラメータを変更します。
- パラメータ
id (int) -- ロール ID
- レスポンス JSON オブジェクト
name (string) -- ロール名
permissions (array) -- アクセス権のコードネーム リスト
-
DELETE
/api/roles/
(int: id)/
¶ ロールを削除します。
- パラメータ
id (int) -- ロール ID
言語¶
-
GET
/api/languages/
¶ 返り値は、すべての言語のリストです。
参考
言語オブジェクトの属性については、
GET /api/languages/(string:language)/
にドキュメントがあります。
-
POST
/api/languages/
¶ 新しい言語を作成します。
- パラメータ
code (string) -- 言語名
name (string) -- 言語名
direction (string) -- テキストの方向
plural (object) -- 言語の複数形と数
-
GET
/api/languages/
(string: language)/
¶ 返り値は、言語の情報です。
- パラメータ
language (string) -- 言語コード
- レスポンス JSON オブジェクト
code (string) -- 言語コード
direction (string) -- テキストの方向
plural (object) -- 言語の複数形の情報についてのオブジェクト
aliases (array) -- 言語のエイリアスの配列
JSON データの例:
{ "code": "en", "direction": "ltr", "name": "English", "plural": { "id": 75, "source": 0, "number": 2, "formula": "n != 1", "type": 1 }, "aliases": [ "english", "en_en", "base", "source", "eng" ], "url": "http://example.com/api/languages/en/", "web_url": "http://example.com/languages/en/", "statistics_url": "http://example.com/api/languages/en/statistics/" }
-
PUT
/api/languages/
(string: language)/
¶ 言語パラメータを変更します。
- パラメータ
language (string) -- 言語コード
- リクエスト JSON オブジェクト
name (string) -- 言語名
direction (string) -- テキストの方向
plural (object) -- 言語の複数形の詳細
-
PATCH
/api/languages/
(string: language)/
¶ 言語パラメータを変更します。
- パラメータ
language (string) -- 言語コード
- リクエスト JSON オブジェクト
name (string) -- 言語名
direction (string) -- テキストの方向
plural (object) -- 言語の複数形の詳細
-
DELETE
/api/languages/
(string: language)/
¶ 言語を削除します。
- パラメータ
language (string) -- 言語コード
-
GET
/api/languages/
(string: language)/statistics/
¶ 返り値は、言語の統計情報です。
- パラメータ
language (string) -- 言語コード
- レスポンス JSON オブジェクト
total (int) -- 文字列の総数
total_words (int) -- 単語の総数
last_change (timestamp) -- 言語での最後の変更
recent_changes (int) -- 変更の総数
translated (int) -- 翻訳済み文字列の数
translated_percent (float) -- 翻訳済みの文字列の割合
translated_words (int) -- 翻訳済みの単語の数
translated_words_percent (int) -- 翻訳済みの単語の割合
translated_chars (int) -- 翻訳済みの文字数
translated_chars_percent (int) -- 翻訳済みの文字の割合
total_chars (int) -- 合計文字数
fuzzy (int) -- あいまいな(要編集付き)文字列の数
fuzzy_percent (int) -- あいまいな(要編集付き)文字列の割合
failing (int) -- 検査不合格の文字列数
failing -- 検査不合格のもの割合
プロジェクト¶
-
GET
/api/projects/
¶ 返り値は、すべてのプロジェクトのリストです。
参考
プロジェクトオブジェクトの属性については、
GET /api/projects/(string:project)/
にドキュメントがあります。
-
POST
/api/projects/
¶ バージョン 3.9 で追加.
新しいプロジェクトを作成します。
- パラメータ
name (string) -- プロジェクト名
slug (string) -- プロジェクトのスラッグ
web (string) -- プロジェクトの Web サイト
-
GET
/api/projects/
(string: project)/
¶ 返り値は、プロジェクトの情報です。
- パラメータ
project (string) -- プロジェクト URL スラッグ
- レスポンス JSON オブジェクト
name (string) -- プロジェクト名
slug (string) -- プロジェクトのスラッグ
web (string) -- プロジェクトの Web サイト
components_list_url (string) -- コンポーネントリスト への URL。参照:
GET /api/projects/(string:project)/components/
repository_url (string) -- リポジトリステータスへのURL。参照:
GET /api/projects/(string:project)/repository/
changes_list_url (string) -- 変更リストへの URL。参照:
GET /api/projects/(string:project)/changes/
translation_review (boolean) -- 査読の有効化
source_review (boolean) -- 原文の査読の有効化
set_language_team (boolean) -- "Language-Team" ヘッダの設定
enable_hooks (boolean) -- フックの有効化
instructions (string) -- 翻訳についての説明
language_aliases (string) -- 言語の別名
JSON データの例:
{ "name": "Hello", "slug": "hello", "url": "http://example.com/api/projects/hello/", "web": "https://weblate.org/", "web_url": "http://example.com/projects/hello/" }
-
PATCH
/api/projects/
(string: project)/
¶ バージョン 4.3 で追加.
PATCH リクエストでプロジェクトを編集します。
- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
-
PUT
/api/projects/
(string: project)/
¶ バージョン 4.3 で追加.
PUT リクエストでプロジェクトを編集します。
- パラメータ
project (string) -- プロジェクト URL スラッグ
-
DELETE
/api/projects/
(string: project)/
¶ バージョン 3.9 で追加.
プロジェクトを削除します。
- パラメータ
project (string) -- プロジェクト URL スラッグ
-
GET
/api/projects/
(string: project)/changes/
¶ 帰り値は、変更があったプロジェクトのリストです。これは基本的には、同じパラメータを受け入れる
GET /api/changes/
にスコープしたプロジェクトです。- パラメータ
project (string) -- プロジェクト URL スラッグ
- レスポンス JSON オブジェクト
results (array) -- コンポーネントオブジェクトの配列。参照:
GET /api/changes/(int:id)/
-
GET
/api/projects/
(string: project)/repository/
¶ 返り値は、VCS リポジトリのステータスに関する情報です。このエンドポイントには、プロジェクトのすべてのリポジトリの全体的な概要のみが含まれています。より詳細なステータスを取得するには
GET /api/components/(string:project)/(string:component)/repository/
を使用してください。- パラメータ
project (string) -- プロジェクト URL スラッグ
- レスポンス JSON オブジェクト
needs_commit (boolean) -- コミットが必要な保留中の変更があるかどうか
needs_merge (boolean) -- マージが必要な upstream に変更があるかどうか
needs_push (boolean) -- プッシュが必要なローカルに変更があるかどうか
JSON データの例:
{ "needs_commit": true, "needs_merge": false, "needs_push": true }
-
POST
/api/projects/
(string: project)/repository/
¶ VCS リポジトリで指定の操作を実行します。
- パラメータ
project (string) -- プロジェクト URL スラッグ
- リクエスト JSON オブジェクト
operation (string) -- 実行する操作:
push
,pull
,commit
,reset
,cleanup
,file-sync
のいずれか一つ
- レスポンス JSON オブジェクト
result (boolean) -- 操作の結果
CURL の例:
curl \ -d operation=pull \ -H "Authorization: Token TOKEN" \ http://example.com/api/projects/hello/repository/
JSON リクエストの例:
POST /api/projects/hello/repository/ HTTP/1.1 Host: example.com Accept: application/json Content-Type: application/json Authorization: Token TOKEN Content-Length: 20 {"operation":"pull"}
JSON レスポンスの例:
HTTP/1.0 200 OK Date: Tue, 12 Apr 2016 09:32:50 GMT Server: WSGIServer/0.1 Python/2.7.11+ Vary: Accept, Accept-Language, Cookie X-Frame-Options: SAMEORIGIN Content-Type: application/json Content-Language: en Allow: GET, POST, HEAD, OPTIONS {"result":true}
-
GET
/api/projects/
(string: project)/components/
¶ 返り値は、指定したプロジェクト内の翻訳コンポーネントのリストです。
- パラメータ
project (string) -- プロジェクト URL スラッグ
- レスポンス JSON オブジェクト
results (array) -- コンポーネント オブジェクトの配列。参照:
GET /api/components/(string:project)/(string:component)/
-
POST
/api/projects/
(string: project)/components/
¶ バージョン 3.9 で追加.
バージョン 4.3 で変更:
zipfile
およびdocfile
パラメータは、VCS なしのコンポーネントでも使用できるようになりました。参照: ローカル ファイル。バージョン 4.6 で変更: The cloned repositories are now automatically shared within a project using Weblate の内部 URL. Use
disable_autoshare
to turn off this.指定したプロジェクトに翻訳コンポーネントを作成します。
ヒント
1 つの VCS リポジトリから複数のコンポーネントを作成するには、Weblate の内部 URL を使用します。
注釈
ほとんどのコンポーネントの作成は、バックグラウンドで実行されます。作成したコンポーネントの
task_url
属性を確認し、その進捗状況を確認します。- パラメータ
project (string) -- プロジェクト URL スラッグ
- フォーム パラメーター
file zipfile -- 翻訳の初期化のために Weblate にアップロードする ZIP ファイル
file docfile -- 翻訳するドキュメント
boolean disable_autoshare -- Disables automatic repository sharing via Weblate の内部 URL.
- レスポンス JSON オブジェクト
result (object) -- 作成されたコンポーネント オブジェクト。参照:
GET /api/components/(string:project)/(string:component)/
JSON can not be used when uploading the files using the
zipfile
anddocfile
parameters. The data has to be uploaded as multipart/form-data.CURL フォーム リクエスト例:
curl \ --form docfile=@strings.html \ --form name=Weblate \ --form slug=weblate \ --form file_format=html \ --form new_lang=add \ -H "Authorization: Token TOKEN" \ http://example.com/api/projects/hello/components/
CURL JSON リクエスト例:
curl \ --data-binary '{ "branch": "main", "file_format": "po", "filemask": "po/*.po", "git_export": "", "license": "", "license_url": "", "name": "Weblate", "slug": "weblate", "repo": "file:///home/nijel/work/weblate-hello", "template": "", "new_base": "", "vcs": "git" }' \ -H "Content-Type: application/json" \ -H "Authorization: Token TOKEN" \ http://example.com/api/projects/hello/components/
JSON リクエストの例:
POST /api/projects/hello/components/ HTTP/1.1 Host: example.com Accept: application/json Content-Type: application/json Authorization: Token TOKEN Content-Length: 20 { "branch": "main", "file_format": "po", "filemask": "po/*.po", "git_export": "", "license": "", "license_url": "", "name": "Weblate", "slug": "weblate", "repo": "file:///home/nijel/work/weblate-hello", "template": "", "new_base": "", "vcs": "git" }
JSON レスポンスの例:
HTTP/1.0 200 OK Date: Tue, 12 Apr 2016 09:32:50 GMT Server: WSGIServer/0.1 Python/2.7.11+ Vary: Accept, Accept-Language, Cookie X-Frame-Options: SAMEORIGIN Content-Type: application/json Content-Language: en Allow: GET, POST, HEAD, OPTIONS { "branch": "main", "file_format": "po", "filemask": "po/*.po", "git_export": "", "license": "", "license_url": "", "name": "Weblate", "slug": "weblate", "project": { "name": "Hello", "slug": "hello", "source_language": { "code": "en", "direction": "ltr", "name": "English", "url": "http://example.com/api/languages/en/", "web_url": "http://example.com/languages/en/" }, "url": "http://example.com/api/projects/hello/", "web": "https://weblate.org/", "web_url": "http://example.com/projects/hello/" }, "repo": "file:///home/nijel/work/weblate-hello", "template": "", "new_base": "", "url": "http://example.com/api/components/hello/weblate/", "vcs": "git", "web_url": "http://example.com/projects/hello/weblate/" }
-
GET
/api/projects/
(string: project)/languages/
¶ 返り値は、プロジェクト内の全言語のページ順の統計情報です。
バージョン 3.8 で追加.
- パラメータ
project (string) -- プロジェクト URL スラッグ
- レスポンス JSON オブジェクト
results (array) -- 翻訳統計オブジェクトの配列
language (string) -- 言語名
code (string) -- 言語コード
total (int) -- 文字列の総数
translated (int) -- 翻訳済み文字列の数
translated_percent (float) -- 翻訳済みの文字列の割合
total_words (int) -- 単語の総数
translated_words (int) -- 翻訳済みの単語の数
words_percent (float) -- 翻訳済みの単語の割合
-
GET
/api/projects/
(string: project)/statistics/
¶ 返り値は、プロジェクトの統計情報です。
バージョン 3.8 で追加.
- パラメータ
project (string) -- プロジェクト URL スラッグ
- レスポンス JSON オブジェクト
total (int) -- 文字列の総数
translated (int) -- 翻訳済み文字列の数
translated_percent (float) -- 翻訳済みの文字列の割合
total_words (int) -- 単語の総数
translated_words (int) -- 翻訳済みの単語の数
words_percent (float) -- 翻訳済みの単語の割合
コンポーネント¶
-
GET
/api/components/
¶ 返り値は、翻訳コンポーネントのリストです。
参考
コンポーネント オブジェクトの属性については、
GET /api/components/(string:project)/(string:component)/
にドキュメントがあります。
-
GET
/api/components/
(string: project)/
(string: component)/
¶ 返り値は、翻訳コンポーネントに関する情報です。
- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
- レスポンス JSON オブジェクト
project (object) -- 翻訳プロジェクト。参照:
GET /api/projects/(string:project)/
name (string) -- コンポーネント名
slug (string) -- コンポーネントのスラッグ
vcs (string) -- バージョン管理システム
repo (string) -- ソースコードのリポジトリ
git_export (string) -- エクスポートされたリポジトリ URL
branch (string) -- リポジトリブランチ
push_branch (string) -- ブランチに push
filemask (string) -- File mask
template (string) -- 単一言語のベース言語ファイル
edit_template (string) -- 基本ファイルの編集
intermediate (string) -- 中間言語ファイル
new_base (string) -- 新しい翻訳のテンプレート
file_format (string) -- ファイル形式
license (string) -- 翻訳のライセンス
agreement (string) -- 貢献者同意条項
new_lang (string) -- 新しい翻訳の追加
language_code_style (string) -- 言語コード スタイル
source_language (object) -- 原文の言語のオブジェクト。参照:
GET /api/languages/(string:language)/
push (string) -- リポジトリの送信先 URL
check_flags (string) -- 翻訳フラグ
priority (string) -- 優先順位
enforced_checks (string) -- 検査の強制
restricted (string) -- アクセス制限
repoweb (string) -- リポジトリ ブラウザー
report_source_bugs (string) -- 原文ミスの報告先アドレス
merge_style (string) -- マージ スタイル
commit_message (string) -- Commit, add, delete, merge and addon messages
add_message (string) -- Commit, add, delete, merge and addon messages
delete_message (string) -- Commit, add, delete, merge and addon messages
merge_message (string) -- Commit, add, delete, merge and addon messages
addon_message (string) -- Commit, add, delete, merge and addon messages
allow_translation_propagation (string) -- 翻訳の自動反映の有効化
enable_suggestions (string) -- 提案の有効化
suggestion_voting (string) -- 提案への投票
suggestion_autoaccept (string) -- 提案の自動採用
push_on_commit (string) -- コミット時にプッシュする
commit_pending_age (string) -- コミットするまでの経過時間
auto_lock_error (string) -- エラー時にロック
language_regex (string) -- 言語フィルター
variant_regex (string) -- 異なる表記を特定する正規表現
repository_url (string) -- リポジトリ ステータスへの URL。参照:
GET /api/components/(string:project)/(string:component)/repository/
translations_url (string) -- 翻訳リストへの URL。参照:
GET /api/components/(string:project)/(string:component)/translations/
lock_url (string) -- ステータスをロックする URL。参照:
GET /api/components/(string:project)/(string:component)/lock/
changes_list_url (string) -- 変更リストへの URL。参照:
GET /api/components/(string:project)/(string:component)/changes/
task_url (string) -- バックグラウンド タスクへの URL(存在する場合)。参照:
GET /api/tasks/(str:uuid)/
JSON データの例:
{ "branch": "main", "file_format": "po", "filemask": "po/*.po", "git_export": "", "license": "", "license_url": "", "name": "Weblate", "slug": "weblate", "project": { "name": "Hello", "slug": "hello", "source_language": { "code": "en", "direction": "ltr", "name": "English", "url": "http://example.com/api/languages/en/", "web_url": "http://example.com/languages/en/" }, "url": "http://example.com/api/projects/hello/", "web": "https://weblate.org/", "web_url": "http://example.com/projects/hello/" }, "source_language": { "code": "en", "direction": "ltr", "name": "English", "url": "http://example.com/api/languages/en/", "web_url": "http://example.com/languages/en/" }, "repo": "file:///home/nijel/work/weblate-hello", "template": "", "new_base": "", "url": "http://example.com/api/components/hello/weblate/", "vcs": "git", "web_url": "http://example.com/projects/hello/weblate/" }
-
PATCH
/api/components/
(string: project)/
(string: component)/
¶ PATCH リクエストでコンポーネントを編集します。
- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
source_language (string) -- プロジェクトの原文の言語コード(オプション)
- リクエスト JSON オブジェクト
name (string) -- コンポーネント名
slug (string) -- コンポーネントのスラッグ
repo (string) -- VCS リポジトリ URL
CURL の例:
curl \ --data-binary '{"name": "new name"}' \ -H "Content-Type: application/json" \ -H "Authorization: Token TOKEN" \ PATCH http://example.com/api/projects/hello/components/
JSON リクエストの例:
PATCH /api/projects/hello/components/ HTTP/1.1 Host: example.com Accept: application/json Content-Type: application/json Authorization: Token TOKEN Content-Length: 20 { "name": "new name" }
JSON レスポンスの例:
HTTP/1.0 200 OK Date: Tue, 12 Apr 2016 09:32:50 GMT Server: WSGIServer/0.1 Python/2.7.11+ Vary: Accept, Accept-Language, Cookie X-Frame-Options: SAMEORIGIN Content-Type: application/json Content-Language: en Allow: GET, POST, HEAD, OPTIONS { "branch": "main", "file_format": "po", "filemask": "po/*.po", "git_export": "", "license": "", "license_url": "", "name": "new name", "slug": "weblate", "project": { "name": "Hello", "slug": "hello", "source_language": { "code": "en", "direction": "ltr", "name": "English", "url": "http://example.com/api/languages/en/", "web_url": "http://example.com/languages/en/" }, "url": "http://example.com/api/projects/hello/", "web": "https://weblate.org/", "web_url": "http://example.com/projects/hello/" }, "repo": "file:///home/nijel/work/weblate-hello", "template": "", "new_base": "", "url": "http://example.com/api/components/hello/weblate/", "vcs": "git", "web_url": "http://example.com/projects/hello/weblate/" }
-
PUT
/api/components/
(string: project)/
(string: component)/
¶ PUT リクエストでコンポーネントを編集します。
- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
- リクエスト JSON オブジェクト
branch (string) -- VCS リポジトリ ブランチ
file_format (string) -- 翻訳のファイル形式
filemask (string) -- リポジトリ内の翻訳ファイルのマスク
name (string) -- コンポーネント名
slug (string) -- コンポーネントのスラッグ
repo (string) -- VCS リポジトリ URL
template (string) -- base file for monolingual translations
new_base (string) -- base file for adding new translations
vcs (string) -- version control system
-
DELETE
/api/components/
(string: project)/
(string: component)/
¶ バージョン 3.9 で追加.
Deletes a component.
- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
-
GET
/api/components/
(string: project)/
(string: component)/changes/
¶ Returns a list of component changes. This is essentially a component scoped
GET /api/changes/
accepting same params.- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
- レスポンス JSON オブジェクト
results (array) -- コンポーネントオブジェクトの配列。参照:
GET /api/changes/(int:id)/
-
GET
/api/components/
(string: project)/
(string: component)/screenshots/
¶ Returns a list of component screenshots.
- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
- レスポンス JSON オブジェクト
results (array) -- array of component screenshots; see
GET /api/screenshots/(int:id)/
-
GET
/api/components/
(string: project)/
(string: component)/lock/
¶ Returns component lock status.
- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
- レスポンス JSON オブジェクト
locked (boolean) -- whether component is locked for updates
JSON データの例:
{ "locked": false }
-
POST
/api/components/
(string: project)/
(string: component)/lock/
¶ Sets component lock status.
Response is same as
GET /api/components/(string:project)/(string:component)/lock/
.- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
- リクエスト JSON オブジェクト
lock -- Boolean whether to lock or not.
CURL の例:
curl \ -d lock=true \ -H "Authorization: Token TOKEN" \ http://example.com/api/components/hello/weblate/repository/
JSON リクエストの例:
POST /api/components/hello/weblate/repository/ HTTP/1.1 Host: example.com Accept: application/json Content-Type: application/json Authorization: Token TOKEN Content-Length: 20 {"lock": true}
JSON レスポンスの例:
HTTP/1.0 200 OK Date: Tue, 12 Apr 2016 09:32:50 GMT Server: WSGIServer/0.1 Python/2.7.11+ Vary: Accept, Accept-Language, Cookie X-Frame-Options: SAMEORIGIN Content-Type: application/json Content-Language: en Allow: GET, POST, HEAD, OPTIONS {"locked":true}
-
GET
/api/components/
(string: project)/
(string: component)/repository/
¶ Returns information about VCS repository status.
The response is same as for
GET /api/projects/(string:project)/repository/
.- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
- レスポンス JSON オブジェクト
needs_commit (boolean) -- コミットが必要な保留中の変更があるかどうか
needs_merge (boolean) -- マージが必要な upstream に変更があるかどうか
needs_push (boolean) -- プッシュが必要なローカルに変更があるかどうか
remote_commit (string) -- Remote commit information
status (string) -- VCS repository status as reported by VCS
merge_failure -- Text describing merge failure or null if there is none
-
POST
/api/components/
(string: project)/
(string: component)/repository/
¶ Performs the given operation on a VCS repository.
See
POST /api/projects/(string:project)/repository/
for documentation.- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
- リクエスト JSON オブジェクト
operation (string) -- 実行する操作:
push
,pull
,commit
,reset
,cleanup
のいずれか一つ
- レスポンス JSON オブジェクト
result (boolean) -- 操作の結果
CURL の例:
curl \ -d operation=pull \ -H "Authorization: Token TOKEN" \ http://example.com/api/components/hello/weblate/repository/
JSON リクエストの例:
POST /api/components/hello/weblate/repository/ HTTP/1.1 Host: example.com Accept: application/json Content-Type: application/json Authorization: Token TOKEN Content-Length: 20 {"operation":"pull"}
JSON レスポンスの例:
HTTP/1.0 200 OK Date: Tue, 12 Apr 2016 09:32:50 GMT Server: WSGIServer/0.1 Python/2.7.11+ Vary: Accept, Accept-Language, Cookie X-Frame-Options: SAMEORIGIN Content-Type: application/json Content-Language: en Allow: GET, POST, HEAD, OPTIONS {"result":true}
-
GET
/api/components/
(string: project)/
(string: component)/monolingual_base/
¶ Downloads base file for monolingual translations.
- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
-
GET
/api/components/
(string: project)/
(string: component)/new_template/
¶ Downloads template file for new translations.
- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
-
GET
/api/components/
(string: project)/
(string: component)/translations/
¶ Returns a list of translation objects in the given component.
- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
- レスポンス JSON オブジェクト
results (array) -- array of translation objects; see
GET /api/translations/(string:project)/(string:component)/(string:language)/
-
POST
/api/components/
(string: project)/
(string: component)/translations/
¶ Creates new translation in the given component.
- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
- リクエスト JSON オブジェクト
language_code (string) -- translation language code; see
GET /api/languages/(string:language)/
- レスポンス JSON オブジェクト
result (object) -- new translation object created
CURL の例:
curl \ -d language_code=cs \ -H "Authorization: Token TOKEN" \ http://example.com/api/projects/hello/components/
JSON リクエストの例:
POST /api/projects/hello/components/ HTTP/1.1 Host: example.com Accept: application/json Content-Type: application/json Authorization: Token TOKEN Content-Length: 20 {"language_code": "cs"}
JSON レスポンスの例:
HTTP/1.0 200 OK Date: Tue, 12 Apr 2016 09:32:50 GMT Server: WSGIServer/0.1 Python/2.7.11+ Vary: Accept, Accept-Language, Cookie X-Frame-Options: SAMEORIGIN Content-Type: application/json Content-Language: en Allow: GET, POST, HEAD, OPTIONS { "failing_checks": 0, "failing_checks_percent": 0, "failing_checks_words": 0, "filename": "po/cs.po", "fuzzy": 0, "fuzzy_percent": 0.0, "fuzzy_words": 0, "have_comment": 0, "have_suggestion": 0, "is_template": false, "is_source": false, "language": { "code": "cs", "direction": "ltr", "name": "Czech", "url": "http://example.com/api/languages/cs/", "web_url": "http://example.com/languages/cs/" }, "language_code": "cs", "id": 125, "last_author": null, "last_change": null, "share_url": "http://example.com/engage/hello/cs/", "total": 4, "total_words": 15, "translate_url": "http://example.com/translate/hello/weblate/cs/", "translated": 0, "translated_percent": 0.0, "translated_words": 0, "url": "http://example.com/api/translations/hello/weblate/cs/", "web_url": "http://example.com/projects/hello/weblate/cs/" }
-
GET
/api/components/
(string: project)/
(string: component)/statistics/
¶ Returns paginated statistics for all translations within component.
バージョン 2.7 で追加.
- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
- レスポンス JSON オブジェクト
results (array) -- array of translation statistics objects; see
GET /api/translations/(string:project)/(string:component)/(string:language)/statistics/
-
GET
/api/components/
(string: project)/
(string: component)/links/
¶ コンポーネントにリンクしたプロジェクトを返します。
バージョン 4.5 で追加.
- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
- レスポンス JSON オブジェクト
projects (array) -- 関連するプロジェクト; 参照:
GET /api/projects/(string:project)/
-
POST
/api/components/
(string: project)/
(string: component)/links/
¶ プロジェクトをコンポーネントに関連付けます。
バージョン 4.5 で追加.
- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
- フォーム パラメーター
string project_slug -- プロジェクトのスラッグ
-
DELETE
/api/components/
(string: project)/
(string: component)/links/
(string: project_slug)/
¶ コンポーネントとプロジェクトの関連付けを削除します。
バージョン 4.5 で追加.
- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
project_slug (string) -- プロジェクトを削除するスラッグ
翻訳¶
-
GET
/api/translations/
¶ Returns a list of translations.
参考
Translation object attributes are documented at
GET /api/translations/(string:project)/(string:component)/(string:language)/
.
-
GET
/api/translations/
(string: project)/
(string: component)/
(string: language)/
¶ Returns information about a translation.
- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
language (string) -- Translation language code
- レスポンス JSON オブジェクト
component (object) -- component object; see
GET /api/components/(string:project)/(string:component)/
failing_checks (int) -- 検査不合格の文字列の数
failing_checks_percent (float) -- 検査不合格の文字列の割合
failing_checks_words (int) -- 検査不合格の単語の数
filename (string) -- translation filename
fuzzy (int) -- あいまいな(要編集付き)文字列の数
fuzzy_percent (float) -- あいまいな(要編集付き)文字列の割合
fuzzy_words (int) -- number of words in fuzzy (marked for edit) strings
have_comment (int) -- number of strings with comment
have_suggestion (int) -- number of strings with suggestion
is_template (boolean) -- 翻訳が単一言語ベースかどうか
language (object) -- 原文の言語のオブジェクト。参照:
GET /api/languages/(string:language)/
language_code (string) -- language code used in the repository; this can be different from language code in the language object
last_author (string) -- name of last author
last_change (timestamp) -- last change timestamp
revision (string) -- revision hash for the file
share_url (string) -- URL for sharing leading to engagement page
total (int) -- 文字列の総数
total_words (int) -- 単語の総数
translate_url (string) -- URL for translating
translated (int) -- 翻訳済み文字列の数
translated_percent (float) -- 翻訳済みの文字列の割合
translated_words (int) -- 翻訳済みの単語の数
repository_url (string) -- URL to repository status; see
GET /api/translations/(string:project)/(string:component)/(string:language)/repository/
file_url (string) -- URL to file object; see
GET /api/translations/(string:project)/(string:component)/(string:language)/file/
changes_list_url (string) -- URL to changes list; see
GET /api/translations/(string:project)/(string:component)/(string:language)/changes/
units_list_url (string) -- URL to strings list; see
GET /api/translations/(string:project)/(string:component)/(string:language)/units/
JSON データの例:
{ "component": { "branch": "main", "file_format": "po", "filemask": "po/*.po", "git_export": "", "license": "", "license_url": "", "name": "Weblate", "new_base": "", "project": { "name": "Hello", "slug": "hello", "source_language": { "code": "en", "direction": "ltr", "name": "English", "url": "http://example.com/api/languages/en/", "web_url": "http://example.com/languages/en/" }, "url": "http://example.com/api/projects/hello/", "web": "https://weblate.org/", "web_url": "http://example.com/projects/hello/" }, "repo": "file:///home/nijel/work/weblate-hello", "slug": "weblate", "template": "", "url": "http://example.com/api/components/hello/weblate/", "vcs": "git", "web_url": "http://example.com/projects/hello/weblate/" }, "failing_checks": 3, "failing_checks_percent": 75.0, "failing_checks_words": 11, "filename": "po/cs.po", "fuzzy": 0, "fuzzy_percent": 0.0, "fuzzy_words": 0, "have_comment": 0, "have_suggestion": 0, "is_template": false, "language": { "code": "cs", "direction": "ltr", "name": "Czech", "url": "http://example.com/api/languages/cs/", "web_url": "http://example.com/languages/cs/" }, "language_code": "cs", "last_author": "Weblate Admin", "last_change": "2016-03-07T10:20:05.499", "revision": "7ddfafe6daaf57fc8654cc852ea6be212b015792", "share_url": "http://example.com/engage/hello/cs/", "total": 4, "total_words": 15, "translate_url": "http://example.com/translate/hello/weblate/cs/", "translated": 4, "translated_percent": 100.0, "translated_words": 15, "url": "http://example.com/api/translations/hello/weblate/cs/", "web_url": "http://example.com/projects/hello/weblate/cs/" }
-
DELETE
/api/translations/
(string: project)/
(string: component)/
(string: language)/
¶ バージョン 3.9 で追加.
Deletes a translation.
- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
language (string) -- Translation language code
-
GET
/api/translations/
(string: project)/
(string: component)/
(string: language)/changes/
¶ Returns a list of translation changes. This is essentially a translations-scoped
GET /api/changes/
accepting the same parameters.- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
language (string) -- Translation language code
- レスポンス JSON オブジェクト
results (array) -- コンポーネントオブジェクトの配列。参照:
GET /api/changes/(int:id)/
-
GET
/api/translations/
(string: project)/
(string: component)/
(string: language)/units/
¶ Returns a list of translation units.
- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
language (string) -- Translation language code
q (string) -- Search query string 検索 (optional)
- レスポンス JSON オブジェクト
results (array) -- array of component objects; see
GET /api/units/(int:id)/
-
POST
/api/translations/
(string: project)/
(string: component)/
(string: language)/units/
¶ Add new monolingual unit.
- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
language (string) -- Translation language code
- リクエスト JSON オブジェクト
key (string) -- Name of translation unit
value (string) -- The translation unit value
-
POST
/api/translations/
(string: project)/
(string: component)/
(string: language)/autotranslate/
¶ Trigger automatic translation.
- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
language (string) -- Translation language code
- リクエスト JSON オブジェクト
mode (string) -- 自動翻訳モード
filter_type (string) -- Automatic translation filter type
auto_source (string) -- 自動翻訳の参照元
component (string) -- プロジェクトの共有翻訳メモリに協力を有効にして、追加コンポーネントにアクセスします。
engines (string) -- 機械翻訳エンジン
threshold (string) -- スコアしきい値
-
GET
/api/translations/
(string: project)/
(string: component)/
(string: language)/file/
¶ Download current translation file as it is stored in the VCS (without the
format
parameter) or converted to another format (see 翻訳のダウンロード).注釈
This API endpoint uses different logic for output than rest of API as it operates on whole file rather than on data. Set of accepted
format
parameter differs and without such parameter you get translation file as stored in VCS.- クエリ パラメータ
format -- File format to use; if not specified no format conversion happens; supported file formats:
po
,mo
,xliff
,xliff11
,tbx
,csv
,xlsx
,json
,aresource
,strings
- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
language (string) -- Translation language code
-
POST
/api/translations/
(string: project)/
(string: component)/
(string: language)/file/
¶ Upload new file with translations.
- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
language (string) -- Translation language code
- フォーム パラメーター
string conflicts -- How to deal with conflicts (
ignore
,replace-translated
orreplace-approved
)file file -- Uploaded file
string email -- 翻訳者のメールアドレス
string author -- 翻訳者名
string method -- アップロード メソッド(
translate
,approve
,suggest
,fuzzy
,replace
,source
,add
)。参照: インポート方法string fuzzy -- Fuzzy (marked for edit) strings processing (empty,
process
,approve
)
CURL の例:
curl -X POST \ -F file=@strings.xml \ -H "Authorization: Token TOKEN" \ http://example.com/api/translations/hello/android/cs/file/
-
GET
/api/translations/
(string: project)/
(string: component)/
(string: language)/repository/
¶ Returns information about VCS repository status.
The response is same as for
GET /api/components/(string:project)/(string:component)/repository/
.- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
language (string) -- Translation language code
-
POST
/api/translations/
(string: project)/
(string: component)/
(string: language)/repository/
¶ VCS リポジトリで指定の操作を実行します。
See
POST /api/projects/(string:project)/repository/
for documentation.- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
language (string) -- Translation language code
- リクエスト JSON オブジェクト
operation (string) -- 実行する操作:
push
,pull
,commit
,reset
,cleanup
のいずれか一つ
- レスポンス JSON オブジェクト
result (boolean) -- 操作の結果
-
GET
/api/translations/
(string: project)/
(string: component)/
(string: language)/statistics/
¶ Returns detailed translation statistics.
バージョン 2.7 で追加.
- パラメータ
project (string) -- プロジェクト URL スラッグ
component (string) -- コンポーネント URL スラッグ
language (string) -- Translation language code
- レスポンス JSON オブジェクト
code (string) -- 言語コード
failing (int) -- number of failing checks
failing_percent (float) -- percentage of failing checks
fuzzy (int) -- あいまいな(要編集付き)文字列の数
fuzzy_percent (float) -- あいまいな(要編集付き)文字列の割合
total_words (int) -- 単語の総数
translated_words (int) -- 翻訳済みの単語の数
last_author (string) -- name of last author
last_change (timestamp) -- date of last change
name (string) -- 言語名
total (int) -- 文字列の総数
translated (int) -- 翻訳済み文字列の数
translated_percent (float) -- 翻訳済みの文字列の割合
url (string) -- URL to access the translation (engagement URL)
url_translate (string) -- URL to access the translation (real translation URL)
Units¶
A unit is a single piece of a translation which pairs a source string with a corresponding translated string and also contains some related metadata. The term is derived from the Translate Toolkit and XLIFF.
バージョン 2.10 で追加.
-
GET
/api/units/
¶ Returns list of translation units.
参考
Unit object attributes are documented at
GET /api/units/(int:id)/
.
-
GET
/api/units/
(int: id)/
¶ バージョン 4.3 で変更: The
target
andsource
are now arrays to properly handle plural strings.Returns information about translation unit.
- パラメータ
id (int) -- Unit ID
- レスポンス JSON オブジェクト
translation (string) -- URL of a related translation object
source (array) -- 原文
previous_source (string) -- previous source string used for fuzzy matching
target (array) -- target string
id_hash (string) -- unique identifier of the unit
content_hash (string) -- unique identifier of the source string
location (string) -- location of the unit in source code
context (string) -- translation unit context
note (string) -- translation unit note
flags (string) -- translation unit flags
state (int) -- unit state, 0 - not translated, 10 - needs editing, 20 - translated, 30 - approved, 100 - read only
fuzzy (boolean) -- ユニットが "fuzzy" もしは査読用にマークされているか
translated (boolean) -- 単位が翻訳されているかどうか
approved (boolean) -- 翻訳が承認されているかどうか
position (int) -- unit position in translation file
has_suggestion (boolean) -- ユニットに提案があるかどうか
has_comment (boolean) -- ユニットにコメントがあるかどうか
has_failing_check (boolean) -- ユニットに検査で不合格となったものがあるか
num_words (int) -- number of source words
priority (int) -- translation priority; 100 is default
id (int) -- unit identifier
explanation (string) -- String explanation, available on source units, see Additional info on source strings
extra_flags (string) -- 原文ユニットで使用可能な追加の文字列フラグ、参照: フラグを使用した動作の設定
web_url (string) -- URL where the unit can be edited
souce_unit (string) -- Source unit link; see
GET /api/units/(int:id)/
-
PATCH
/api/units/
(int: id)/
¶ バージョン 4.3 で追加.
翻訳ユニットを部分的に更新します。
- パラメータ
id (int) -- Unit ID
- リクエスト JSON オブジェクト
state (int) -- unit state, 0 - not translated, 10 - needs editing, 20 - translated, 30 - approved (need review workflow enabled, see 専任の査読者)
target (array) -- target string
explanation (string) -- String explanation, available on source units, see Additional info on source strings
extra_flags (string) -- 原文ユニットで使用可能な追加の文字列フラグ、参照: フラグを使用した動作の設定
-
PUT
/api/units/
(int: id)/
¶ バージョン 4.3 で追加.
翻訳ユニットをすべて更新します。
- パラメータ
id (int) -- Unit ID
- リクエスト JSON オブジェクト
state (int) -- unit state, 0 - not translated, 10 - needs editing, 20 - translated, 30 - approved (need review workflow enabled, see 専任の査読者)
target (array) -- target string
explanation (string) -- String explanation, available on source units, see Additional info on source strings
extra_flags (string) -- 原文ユニットで使用可能な追加の文字列フラグ、参照: フラグを使用した動作の設定
-
DELETE
/api/units/
(int: id)/
¶ バージョン 4.3 で追加.
翻訳ユニットを削除します。
- パラメータ
id (int) -- Unit ID
変更¶
バージョン 2.10 で追加.
-
GET
/api/changes/
¶ バージョン 4.1 で変更: 変更のフィルター処理は 4.1 リリースで導入しました。
Returns a list of translation changes.
参考
Change object attributes are documented at
GET /api/changes/(int:id)/
.- クエリ パラメータ
user (string) -- Username of user to filters
action (int) -- Action to filter, can be used several times
timestamp_after (timestamp) -- ISO 8601 formatted timestamp to list changes after
timestamp_before (timestamp) -- ISO 8601 formatted timestamp to list changes before
-
GET
/api/changes/
(int: id)/
¶ Returns information about translation change.
- パラメータ
id (int) -- Change ID
- レスポンス JSON オブジェクト
unit (string) -- URL of a related unit object
translation (string) -- URL of a related translation object
component (string) -- URL of a related component object
user (string) -- URL of a related user object
author (string) -- URL of a related author object
timestamp (timestamp) -- event timestamp
action (int) -- numeric identification of action
action_name (string) -- text description of action
target (string) -- event changed text or detail
id (int) -- change identifier
スクリーンショット¶
バージョン 2.14 で追加.
-
GET
/api/screenshots/
¶ Returns a list of screenshot string information.
参考
Screenshot object attributes are documented at
GET /api/screenshots/(int:id)/
.
-
GET
/api/screenshots/
(int: id)/
¶ Returns information about screenshot information.
- パラメータ
id (int) -- Screenshot ID
- レスポンス JSON オブジェクト
name (string) -- name of a screenshot
component (string) -- URL of a related component object
file_url (string) -- URL to download a file; see
GET /api/screenshots/(int:id)/file/
units (array) -- link to associated source string information; see
GET /api/units/(int:id)/
-
GET
/api/screenshots/
(int: id)/file/
¶ Download the screenshot image.
- パラメータ
id (int) -- Screenshot ID
-
POST
/api/screenshots/
(int: id)/file/
¶ Replace screenshot image.
- パラメータ
id (int) -- Screenshot ID
- フォーム パラメーター
file image -- Uploaded file
CURL の例:
curl -X POST \ -F image=@image.png \ -H "Authorization: Token TOKEN" \ http://example.com/api/screenshots/1/file/
-
POST
/api/screenshots/
(int: id)/units/
¶ Associate source string with screenshot.
- パラメータ
id (int) -- Screenshot ID
- フォーム パラメーター
string unit_id -- Unit ID
- レスポンス JSON オブジェクト
name (string) -- name of a screenshot
translation (string) -- URL of a related translation object
file_url (string) -- URL to download a file; see
GET /api/screenshots/(int:id)/file/
units (array) -- link to associated source string information; see
GET /api/units/(int:id)/
-
DELETE
/api/screenshots/
(int: id)/units/
(int: unit_id)¶ スクリーンショットと原文の関連付けを削除します。
- パラメータ
id (int) -- Screenshot ID
unit_id -- 原文ユニット ID
-
POST
/api/screenshots/
¶ Creates a new screenshot.
- フォーム パラメーター
file image -- Uploaded file
string name -- スクリーンショットの名前
string project_slug -- プロジェクトのスラッグ
string component_slug -- コンポーネントのスラッグ
string language_code -- 言語コード
- レスポンス JSON オブジェクト
name (string) -- name of a screenshot
component (string) -- URL of a related component object
file_url (string) -- URL to download a file; see
GET /api/screenshots/(int:id)/file/
units (array) -- link to associated source string information; see
GET /api/units/(int:id)/
-
PATCH
/api/screenshots/
(int: id)/
¶ スクリーンショットに関する部分的な情報を編集します。
- パラメータ
id (int) -- Screenshot ID
- レスポンス JSON オブジェクト
name (string) -- name of a screenshot
component (string) -- URL of a related component object
file_url (string) -- URL to download a file; see
GET /api/screenshots/(int:id)/file/
units (array) -- link to associated source string information; see
GET /api/units/(int:id)/
-
PUT
/api/screenshots/
(int: id)/
¶ スクリーンショットのすべての情報を編集します。
- パラメータ
id (int) -- Screenshot ID
- レスポンス JSON オブジェクト
name (string) -- name of a screenshot
component (string) -- URL of a related component object
file_url (string) -- URL to download a file; see
GET /api/screenshots/(int:id)/file/
units (array) -- link to associated source string information; see
GET /api/units/(int:id)/
-
DELETE
/api/screenshots/
(int: id)/
¶ スクリーンショットを削除します。
- パラメータ
id (int) -- Screenshot ID
アドオン¶
バージョン 4.4.1 で追加.
-
GET
/api/addons/
¶ アドオンの一覧を返します。
参考
アドオン オブジェクトの属性は、
GET /api/addons/(int:id)/
にドキュメントがあります。
-
GET
/api/addons/
(int: id)/
¶ アドオン情報に関する情報を返します。
- パラメータ
id (int) -- アドオン ID
- レスポンス JSON オブジェクト
name (string) -- アドオンの名前
component (string) -- URL of a related component object
configuration (object) -- オプションのアドオン設定
-
POST
/api/components/
(string: project)/
(string: component)/addons/
¶ 新しいアドオンを作成します。
- パラメータ
project_slug (string) -- プロジェクトのスラッグ
component_slug (string) -- コンポーネントのスラッグ
- リクエスト JSON オブジェクト
name (string) -- アドオンの名前
configuration (object) -- オプションのアドオン設定
-
PATCH
/api/addons/
(int: id)/
¶ アドオンに関する部分的な情報を編集します。
- パラメータ
id (int) -- アドオン ID
- レスポンス JSON オブジェクト
configuration (object) -- オプションのアドオン設定
-
PUT
/api/addons/
(int: id)/
¶ アドオンに関する完全な情報を編集します。
- パラメータ
id (int) -- アドオン ID
- レスポンス JSON オブジェクト
configuration (object) -- オプションのアドオン設定
-
DELETE
/api/addons/
(int: id)/
¶ アドオンを削除します。
- パラメータ
id (int) -- アドオン ID
複数のコンポーネント リスト¶
バージョン 4.0 で追加.
-
GET
/api/component-lists/
¶ すべてのコンポーネント リストのリストを返します。
参考
コンポーネント リストのオブジェクト属性は、
GET /api/component-lists/(str:slug)/
にドキュメントがあります。
-
GET
/api/component-lists/
(str: slug)/
¶ コンポーネント リストに関する情報を返します。
- パラメータ
slug (string) -- コンポーネント リストのスラッグ
- レスポンス JSON オブジェクト
name (string) -- コンポーネント リストの名前
slug (string) -- コンポーネント リストのスラッグ
show_dashboard (boolean) -- ダッシュボードに表示するかどうか
components (array) -- 関連するコンポーネントへのリンク。参照:
GET /api/components/(string:project)/(string:component)/
auto_assign (array) -- 自動割り当て規則
-
PUT
/api/component-lists/
(str: slug)/
¶ コンポーネント リストのパラメータを変更します。
- パラメータ
slug (string) -- コンポーネント リストのスラッグ
- リクエスト JSON オブジェクト
name (string) -- コンポーネント リストの名前
slug (string) -- コンポーネント リストのスラッグ
show_dashboard (boolean) -- ダッシュボードに表示するかどうか
-
PATCH
/api/component-lists/
(str: slug)/
¶ コンポーネント リストのパラメータを変更します。
- パラメータ
slug (string) -- コンポーネント リストのスラッグ
- リクエスト JSON オブジェクト
name (string) -- コンポーネント リストの名前
slug (string) -- コンポーネント リストのスラッグ
show_dashboard (boolean) -- ダッシュボードに表示するかどうか
-
DELETE
/api/component-lists/
(str: slug)/
¶ コンポーネント リストを削除します。
- パラメータ
slug (string) -- コンポーネント リストのスラッグ
-
POST
/api/component-lists/
(str: slug)/components/
¶ コンポーネントをコンポーネント リストに関連付けます。
- パラメータ
slug (string) -- コンポーネント リストのスラッグ
- フォーム パラメーター
string component_id -- コンポーネント ID
-
DELETE
/api/component-lists/
(str: slug)/components/
(str: component_slug)¶ コンポーネント リストからコンポーネントの関連付けを解除します。
- パラメータ
slug (string) -- コンポーネント リストのスラッグ
component_slug (string) -- コンポーネントのスラッグ
用語集¶
バージョン 4.5 で変更: 現在、用語集は普通のコンポーネントとして、翻訳と文字列を保存するようになりました。代わりに該当の API を使用してください。
タスク¶
バージョン 4.4 で追加.
-
GET
/api/tasks/
¶ タスクの一覧は現在使用できません。
-
GET
/api/tasks/
(str: uuid)/
¶ タスクに関する情報を返します
- パラメータ
uuid (string) -- タスク UUID
- レスポンス JSON オブジェクト
completed (boolean) -- タスクが完了したかどうか
progress (int) -- タスクの進捗率
result (object) -- タスクの結果または進捗状況の詳細
log (string) -- タスクの履歴
通知フック¶
Notification hooks allow external applications to notify Weblate that the VCS repository has been updated.
You can use repository endpoints for projects, components and translations to
update individual repositories; see
POST /api/projects/(string:project)/repository/
for documentation.
-
GET
/hooks/update/
(string: project)/
(string: component)/
¶ バージョン 2.6 で非推奨: Please use
POST /api/components/(string:project)/(string:component)/repository/
instead which works properly with authentication for ACL limited projects.Triggers update of a component (pulling from VCS and scanning for translation changes).
-
GET
/hooks/update/
(string: project)/
¶ バージョン 2.6 で非推奨: Please use
POST /api/projects/(string:project)/repository/
instead which works properly with authentication for ACL limited projects.Triggers update of all components in a project (pulling from VCS and scanning for translation changes).
-
POST
/hooks/github/
¶ Special hook for handling GitHub notifications and automatically updating matching components.
注釈
GitHub includes direct support for notifying Weblate: enable Weblate service hook in repository settings and set the URL to the URL of your Weblate installation.
参考
- Automatically receiving changes from GitHub
For instruction on setting up GitHub integration
- https://docs.github.com/en/github/extending-github/about-webhooks
Generic information about GitHub Webhooks
ENABLE_HOOKS
For enabling hooks for whole Weblate
-
POST
/hooks/gitlab/
¶ Special hook for handling GitLab notifications and automatically updating matching components.
参考
- Automatically receiving changes from GitLab
For instruction on setting up GitLab integration
- https://docs.gitlab.com/ce/user/project/integrations/webhooks.html
Generic information about GitLab Webhooks
ENABLE_HOOKS
For enabling hooks for whole Weblate
-
POST
/hooks/bitbucket/
¶ Special hook for handling Bitbucket notifications and automatically updating matching components.
参考
- Automatically receiving changes from Bitbucket
For instruction on setting up Bitbucket integration
- https://support.atlassian.com/bitbucket-cloud/docs/manage-webhooks/
Generic information about Bitbucket Webhooks
ENABLE_HOOKS
For enabling hooks for whole Weblate
-
POST
/hooks/pagure/
¶ バージョン 3.3 で追加.
Pagure 通知を処理し、一致するコンポーネントを自動的に更新するための特別なフック。
参考
- Pagure からの変更を自動的に受信
Pagure 統合の設定方法について
- https://docs.pagure.org/pagure/usage/using_webhooks.html
Pagure WEB フックに関する一般的な情報
ENABLE_HOOKS
For enabling hooks for whole Weblate
-
POST
/hooks/azure/
¶ バージョン 3.8 で追加.
Special hook for handling Azure Repos notifications and automatically updating matching components.
参考
- Automatically receiving changes from Azure Repos
For instruction on setting up Azure integration
- https://docs.microsoft.com/en-us/azure/devops/service-hooks/services/webhooks?view=azure-devops
Generic information about Azure Repos Web Hooks
ENABLE_HOOKS
For enabling hooks for whole Weblate
-
POST
/hooks/gitea/
¶ バージョン 3.9 で追加.
Special hook for handling Gitea Webhook notifications and automatically updating matching components.
参考
- Automatically receiving changes from Gitea Repos
For instruction on setting up Gitea integration
- https://docs.gitea.io/en-us/webhooks/
Generic information about Gitea Webhooks
ENABLE_HOOKS
For enabling hooks for whole Weblate
-
POST
/hooks/gitee/
¶ バージョン 3.9 で追加.
Special hook for handling Gitee Webhook notifications and automatically updating matching components.
参考
- Automatically receiving changes from Gitee Repos
For instruction on setting up Gitee integration
- https://gitee.com/help/categories/40
Generic information about Gitee Webhooks
ENABLE_HOOKS
For enabling hooks for whole Weblate
Exports¶
Weblate provides various exports to allow you to further process the data.
-
GET
/exports/stats/
(string: project)/
(string: component)/
¶ - クエリ パラメータ
format (string) -- Output format: either
json
orcsv
バージョン 2.6 で非推奨: Please use
GET /api/components/(string:project)/(string:component)/statistics/
andGET /api/translations/(string:project)/(string:component)/(string:language)/statistics/
instead; it allows access to ACL controlled projects as well.Retrieves statistics for given component in given format.
Example request:
GET /exports/stats/weblate/main/ HTTP/1.1 Host: example.com Accept: application/json, text/javascript
Example response:
HTTP/1.1 200 OK Vary: Accept Content-Type: application/json [ { "code": "cs", "failing": 0, "failing_percent": 0.0, "fuzzy": 0, "fuzzy_percent": 0.0, "last_author": "Michal Čihař", "last_change": "2012-03-28T15:07:38+00:00", "name": "Czech", "total": 436, "total_words": 15271, "translated": 436, "translated_percent": 100.0, "translated_words": 3201, "url": "http://hosted.weblate.org/engage/weblate/cs/", "url_translate": "http://hosted.weblate.org/projects/weblate/main/cs/" }, { "code": "nl", "failing": 21, "failing_percent": 4.8, "fuzzy": 11, "fuzzy_percent": 2.5, "last_author": null, "last_change": null, "name": "Dutch", "total": 436, "total_words": 15271, "translated": 319, "translated_percent": 73.2, "translated_words": 3201, "url": "http://hosted.weblate.org/engage/weblate/nl/", "url_translate": "http://hosted.weblate.org/projects/weblate/main/nl/" }, { "code": "el", "failing": 11, "failing_percent": 2.5, "fuzzy": 21, "fuzzy_percent": 4.8, "last_author": null, "last_change": null, "name": "Greek", "total": 436, "total_words": 15271, "translated": 312, "translated_percent": 71.6, "translated_words": 3201, "url": "http://hosted.weblate.org/engage/weblate/el/", "url_translate": "http://hosted.weblate.org/projects/weblate/main/el/" } ]
RSS フィード¶
Changes in translations are exported in RSS feeds.
-
GET
/exports/rss/
(string: project)/
(string: component)/
(string: language)/
¶ Retrieves RSS feed with recent changes for a translation.
-
GET
/exports/rss/
(string: project)/
(string: component)/
¶ Retrieves RSS feed with recent changes for a component.
-
GET
/exports/rss/
(string: project)/
¶ Retrieves RSS feed with recent changes for a project.
-
GET
/exports/rss/language/
(string: language)/
¶ Retrieves RSS feed with recent changes for a language.
-
GET
/exports/rss/
¶ Retrieves RSS feed with recent changes for Weblate instance.
Weblate クライアント¶
バージョン 2.7 で追加: Weblate 2.7 以降、wlc ユーティリティにすべて対応しています。古いバージョンを使用している場合は、API との互換性に問題が発生することがあります。
導入¶
Weblate クライアントは個別に提供され、Python モジュールを含んでいます。以下のコマンドを使用するには、wlc
をインストールすることが必要です。
pip3 install wlc
Docker の使用¶
Weblate クライアントは Docker イメージでも動作します。
イメージは Docker Hub: https://hub.docker.com/r/weblate/wlc で公開しています
インストール:
docker pull weblate/wlc
Docker コンテナは Weblate のデフォルト設定を使用して、localhost にデプロイされた API に接続します。API URL と API_KEY は、Weblate が受け入れる引数で設定できます。
コンテナがコマンドで起動する構文:
docker run --rm weblate/wlc [WLC_ARGS]
例:
docker run --rm weblate/wlc --url https://hosted.weblate.org/api/ list-projects
You might want to pass your 設定ファイル to the Docker container, the
easiest approach is to add your current directory as /home/weblate
volume:
docker run --volume $PWD:/home/weblate --rm weblate/wlc show
はじめに¶
wlc 設定は ~/.config/weblate
に保存されます(他の場所については 設定ファイル for other locations を参照:)。環境に合わせて作成してください:
[weblate]
url = https://hosted.weblate.org/api/
[keys]
https://hosted.weblate.org/api/ = APIKEY
そのあと、デフォルト サーバーでコマンドを呼び出せます。
wlc ls
wlc commit sandbox/hello-world
参考
解説¶
Weblate クライアントは Python ライブラリであり、Weblate's REST API を使用して Weblate をリモートで管理するためのコマンドライン ユーティリティです。コマンドライン ユーティリティは、wlc として呼び出すことができ、wlc
に標準搭載されています。
引数¶
プログラムは、出力形式を定義する以下の引数、または使用する Weblate インスタンスを受け入れます。これらは、コマンドの前に入力が必要です。
-
--format
{csv,json,text,html}
¶ 出力形式を指定する。
コマンド¶
使用できるコマンド:
-
version
¶
現在のバージョンを表示する。
-
list-languages
¶
Weblate で使用している言語を一覧表示する。
-
list-projects
¶
Weblate のプロジェクトを一覧表示する。
-
list-components
¶
Weblate のコンポーネントを一覧表示する。
-
list-translations
¶
Weblate の翻訳を一覧表示する。
-
show
¶
Weblate オブジェクトを表示する(変換、コンポーネントまたはプロジェクト)。
-
ls
¶
Weblate のオブジェクト(翻訳、コンポーネントまたはプロジェクト)を一覧表示する。
-
commit
¶
Weblate オブジェクト(翻訳、コンポーネントまたはプロジェクト)で行われた変更をコミットする)。
-
pull
¶
リモートリポジトリの変更を Weblate オブジェクト(翻訳、コンポーネント、またはプロジェクト)にプルする。
-
push
¶
Weblate オブジェクトの変更をリモート リポジトリ(翻訳、コンポーネント、またはプロジェクト)にプッシュする。
-
reset
¶
バージョン 0.7 で追加: wlc 0.7 から対応。
Weblate オブジェクトの変更をリセットして、リモート リポジトリ(翻訳、コンポーネント、またはプロジェクト)に一致させる。
-
cleanup
¶
バージョン 0.9 で追加: wlc 0.9 から対応。
リモート リポジトリ(翻訳、コンポーネントまたはプロジェクト)に一致する Weblate オブジェクト内の記録されていない変更を削除する。
-
repo
¶
指定した Weblate オブジェクト(翻訳、コンポーネントまたはプロジェクト)のリポジトリ状況を表示する。
-
statistics
¶
指定した Weblate オブジェクト(翻訳、コンポーネント、またはプロジェクト)の詳細な統計情報を表示する。
-
lock-status
¶
バージョン 0.5 で追加: wlc 0.5 から対応。
ロックの状況を表示する。
-
lock
¶
バージョン 0.5 で追加: wlc 0.5 から対応。
Weblate での今後の翻訳からコンポーネントをロックする。
-
unlock
¶
バージョン 0.5 で追加: wlc 0.5 から対応。
Weblate コンポーネントの翻訳のロックを解除する。
-
changes
¶
バージョン 0.7 で追加: wlc 0.7 および Weblate 2.10 以降から対応。
指定したオブジェクトの変更を表示する。
-
download
¶
バージョン 0.7 で追加: wlc 0.7 から対応。
翻訳ファイルをダウンロードする。
-
--convert
¶
ファイル形式を変換する、ファイル形式を指定しない場合はサーバー上で変換は行われず、ファイルはそのままリポジトリにダウンロードされる。
-
--output
¶
出力を保存するファイルを指定する。指定しない場合は、標準出力に出力される。
-
-
upload
¶
バージョン 0.9 で追加: wlc 0.9 から対応。
翻訳ファイルをアップロードする。
-
--overwrite
¶
アップロード時に既存の翻訳を上書きする。
-
--input
¶
内容を読み込むファイル。指定しない場合は、stdin から読み込む。
-
ヒント
--help
を付加すると、個々のコマンドの呼び出しに関するより詳細な情報を取得できる。例: wlc ls --help
。
設定ファイル¶
.weblate
、.weblate.ini
、weblate.ini
バージョン 1.6 で変更: 拡張子が .ini のファイルにも対応する。
プロジェクト別の構成ファイル
C:\Users\NAME\AppData\weblate.ini
バージョン 1.6 で追加.
Windows のユーザー設定ファイル。
~/.config/weblate
ユーザー設定ファイル
/etc/xdg/weblate
システム全体の設定ファイル
このプログラムは XDG の仕様に準拠しているので、環境変数 XDG_CONFIG_HOME
や XDG_CONFIG_DIRS
を使って設定ファイルの配置を設定できます。Windows では、設定ファイルは APPDATA
ディレクトリに保存することを推奨します。
[weblate]
セクションで設定可能な設定( --config-section
でカスタマイズできる):
-
key
Weblate に接続するための API キー。
-
url
API サーバーの URL、デフォルトは
http://127.0.0.1:8000/api/
。
-
translation
デフォルトの翻訳へのパス - コンポーネントまたはプロジェクト。
設定ファイルは、次のような INI ファイル:
[weblate]
url = https://hosted.weblate.org/api/
key = APIKEY
translation = weblate/application
さらに、API キーは次の [keys]
セクションに保存が可能:
[keys]
https://hosted.weblate.org/api/ = APIKEY
これにより、VCS リポジトリー内の .weblate
設定を使用して、wlc がどのサーバーと通信すべきかを認識しながら、個人設定に鍵を保管できます。
例:¶
現在のプログラムのバージョンの表示:
$ wlc version
version: 0.1
すべてのプロジェクトの一覧表示:
$ wlc list-projects
name: Hello
slug: hello
url: http://example.com/api/projects/hello/
web: https://weblate.org/
web_url: http://example.com/projects/hello/
また、wlc で作業するプロジェクトの指定も可能:
$ cat .weblate
[weblate]
url = https://hosted.weblate.org/api/
translation = weblate/application
$ wlc show
branch: main
file_format: po
source_language: en
filemask: weblate/locale/*/LC_MESSAGES/django.po
git_export: https://hosted.weblate.org/git/weblate/application/
license: GPL-3.0+
license_url: https://spdx.org/licenses/GPL-3.0+
name: Application
new_base: weblate/locale/django.pot
project: weblate
repo: git://github.com/WeblateOrg/weblate.git
slug: application
template:
url: https://hosted.weblate.org/api/components/weblate/application/
vcs: git
web_url: https://hosted.weblate.org/projects/weblate/application/
この設定により、現在のプロジェクトで保留中の変更を簡単にコミットが可能:
$ wlc commit
Weblate の Python API¶
wlc
¶
WeblateException
¶
-
exception
wlc.
WeblateException
¶ すべての例外の基底クラス。
導入方法¶
Weblate のインストール¶
Docker を使用したインストール¶
With dockerized Weblate deployment you can get your personal Weblate instance up and running in seconds. All of Weblate's dependencies are already included. PostgreSQL is set up as the default database.
Hardware requirements¶
Weblate should run on any contemporary hardware without problems, the following is the minimal configuration required to run Weblate on a single host (Weblate, database and webserver):
2 GB of RAM
2 CPU cores
1 GB of storage space
The more memory the better - it is used for caching on all levels (filesystem, database and Weblate).
Many concurrent users increases the amount of needed CPU cores. For hundreds of translation components at least 4 GB of RAM is recommended.
The typical database storage usage is around 300 MB per 1 million hosted words. Storage space needed for cloned repositories varies, but Weblate tries to keep their size minimal by doing shallow clones.
注釈
Actual requirements for your installation of Weblate vary heavily based on the size of the translations managed in it.
導入¶
The following examples assume you have a working Docker environment, with
docker-compose
installed. Please check the Docker documentation for instructions.
Clone the weblate-docker repo:
git clone https://github.com/WeblateOrg/docker-compose.git weblate-docker cd weblate-docker
Create a
docker-compose.override.yml
file with your settings. See Docker environment variables for full list of environment variables.version: '3' services: weblate: ports: - 80:8080 environment: WEBLATE_EMAIL_HOST: smtp.example.com WEBLATE_EMAIL_HOST_USER: user WEBLATE_EMAIL_HOST_PASSWORD: pass WEBLATE_SERVER_EMAIL: weblate@example.com WEBLATE_DEFAULT_FROM_EMAIL: weblate@example.com WEBLATE_SITE_DOMAIN: weblate.example.com WEBLATE_ADMIN_PASSWORD: password for the admin user WEBLATE_ADMIN_EMAIL: weblate.admin@example.com
注釈
If
WEBLATE_ADMIN_PASSWORD
is not set, the admin user is created with a random password shown on first startup.The provided example makes Weblate listen on port 80, edit the port mapping in the
docker-compose.override.yml
file to change it.Start Weblate containers:
docker-compose up
Enjoy your Weblate deployment, it's accessible on port 80 of the weblate
container.
バージョン 2.15-2 で変更: The setup has changed recently, priorly there was separate web server container, since 2.15-2 the web server is embedded in the Weblate container.
バージョン 3.7.1-6 で変更: In July 2019 (starting with the 3.7.1-6 tag), the containers are not running as a root user. This has changed the exposed port from 80 to 8080.
Docker container with HTTPS support¶
Please see 導入 for generic deployment instructions, this section only mentions differences compared to it.
Using own SSL certificates¶
バージョン 3.8-3 で追加.
In case you have own SSL certificate you want to use, simply place the files into the Weblate data volume (see Docker container volumes):
ssl/fullchain.pem
containing the certificate including any needed CA certificatesssl/privkey.pem
containing the private key
Both of these files must be owned by the same user as the one starting the docker container and have file mask set to 600
(readable and writable only by the owning user).
Additionally, Weblate container will now accept SSL connections on port 4443, you will want to include the port forwarding for HTTPS in docker compose override:
version: '3'
services:
weblate:
ports:
- 80:8080
- 443:4443
If you already host other sites on the same server, it is likely ports 80
and 443
are used by a reverse proxy, such as NGINX. To pass the HTTPS connection from NGINX to the docker container, you can use the following configuration:
server {
listen 443;
listen [::]:443;
server_name <SITE_URL>;
ssl_certificate /etc/letsencrypt/live/<SITE>/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/<SITE>/privkey.pem;
location / {
proxy_set_header HOST $host;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_pass https://127.0.0.1:<EXPOSED_DOCKER_PORT>;
}
}
Replace <SITE_URL>
, <SITE>
and <EXPOSED_DOCKER_PORT>
with actual values from your environment.
Automatic SSL certificates using Let’s Encrypt¶
In case you want to use Let’s Encrypt
automatically generated SSL certificates on public installation, you need to
add a reverse HTTPS proxy an additional Docker container, https-portal will be used for that.
This is made use of in the docker-compose-https.yml
file. Then create
a docker-compose-https.override.yml
file with your settings:
version: '3'
services:
weblate:
environment:
WEBLATE_EMAIL_HOST: smtp.example.com
WEBLATE_EMAIL_HOST_USER: user
WEBLATE_EMAIL_HOST_PASSWORD: pass
WEBLATE_SITE_DOMAIN: weblate.example.com
WEBLATE_ADMIN_PASSWORD: password for admin user
https-portal:
environment:
DOMAINS: 'weblate.example.com -> http://weblate:8080'
Whenever invoking docker-compose you need to pass both files to it, and then do:
docker-compose -f docker-compose-https.yml -f docker-compose-https.override.yml build
docker-compose -f docker-compose-https.yml -f docker-compose-https.override.yml up
Upgrading the Docker container¶
Usually it is good idea to only update the Weblate container and keep the PostgreSQL container at the version you have, as upgrading PostgreSQL is quite painful and in most cases does not bring many benefits.
You can do this by sticking with the existing docker-compose and just pull the latest images and then restart:
docker-compose stop
docker-compose pull
docker-compose up
The Weblate database should be automatically migrated on first startup, and there should be no need for additional manual actions.
注釈
Upgrades across 3.0 are not supported by Weblate. If you are on 2.x series
and want to upgrade to 3.x, first upgrade to the latest 3.0.1-x (at time of
writing this it is the 3.0.1-7
) image, which will do the migration and then
continue upgrading to newer versions.
You might also want to update the docker-compose
repository, though it's
not needed in most case. Please beware of PostgreSQL version changes in this
case as it's not straightforward to upgrade the database, see GitHub issue for more info.
管理者サイン イン¶
After container setup, you can sign in as admin user with password provided
in WEBLATE_ADMIN_PASSWORD
, or a random password generated on first
start if that was not set.
To reset admin password, restart the container with
WEBLATE_ADMIN_PASSWORD
set to new password.
Number of processes and memory consumption¶
The number of worker processes for both uWSGI and Celery is determined automatically based on number of CPUs. This works well for most cloud virtual machines as these typically have few CPUs and good amount of memory.
In case you have a lot of CPU cores and hit out of memory issues, try reducing number of workers:
environment:
WEBLATE_WORKERS: 2
You can also fine-tune individual worker categories:
environment:
UWSGI_WORKERS: 4
CELERY_MAIN_OPTIONS: --concurrency 2
CELERY_NOTIFY_OPTIONS: --concurrency 1
CELERY_TRANSLATE_OPTIONS: --concurrency 1
Scaling horizontally¶
バージョン 4.6 で追加.
警告
This feature is a technology preview.
You can run multiple Weblate containers to scale the service horizontally. The
/app/data
volume has to be shared by all containers, it is recommended
to use cluster filesystem such as GlusterFS for this. The /app/cache
volume should be separate for each container.
Each Weblate container has defined role using WEBLATE_SERVICE
environment variable. Please follow carefully the documentation as some of the
services should be running just once in the cluster and the ordering of the
services matters as well.
You can find example setup in the docker-compose
repo as
docker-compose-split.yml.
Docker environment variables¶
Many of Weblate's 設定 can be set in the Docker container using environment variables:
Generic settings¶
-
WEBLATE_LOGLEVEL
¶ Configures the logging verbosity.
-
WEBLATE_SITE_TITLE
¶ Changes the site-title shown in the header of all pages.
-
WEBLATE_SITE_DOMAIN
¶ サイトのドメインを設定します。このパラメーターは必須です。
-
WEBLATE_ADMIN_NAME
¶
-
WEBLATE_ADMIN_EMAIL
¶ Configures the site-admin's name and e-mail. It is used for both
ADMINS
setting and creating admin user (seeWEBLATE_ADMIN_PASSWORD
for more info on that).例:
environment: WEBLATE_ADMIN_NAME: Weblate admin WEBLATE_ADMIN_EMAIL: noreply@example.com
-
WEBLATE_ADMIN_PASSWORD
¶ Sets the password for the admin user.
If not set and admin user does not exist, it is created with a random password shown on first container startup.
If not set and admin user exists, no action is performed.
If set the admin user is adjusted on every container startup to match
WEBLATE_ADMIN_PASSWORD
,WEBLATE_ADMIN_NAME
andWEBLATE_ADMIN_EMAIL
.
警告
It might be a security risk to store password in the configuration file. Consider using this variable only for initial setup (or let Weblate generate random password on initial startup) or for password recovery.
-
WEBLATE_SERVER_EMAIL
¶
-
WEBLATE_CONTACT_FORM
¶ Configures contact form behavior, see
CONTACT_FORM
.
-
WEBLATE_ALLOWED_HOSTS
¶ Configures allowed HTTP hostnames using
ALLOWED_HOSTS
.Defaults to
*
which allows all hostnames.例:
environment: WEBLATE_ALLOWED_HOSTS: weblate.example.com,example.com
-
WEBLATE_REGISTRATION_OPEN
¶ Configures whether registrations are open by toggling
REGISTRATION_OPEN
.例:
environment: WEBLATE_REGISTRATION_OPEN: 0
-
WEBLATE_REGISTRATION_ALLOW_BACKENDS
¶ Configure which authentication methods can be used to create new account via
REGISTRATION_ALLOW_BACKENDS
.例:
environment: WEBLATE_REGISTRATION_OPEN: 0 WEBLATE_REGISTRATION_ALLOW_BACKENDS: azuread-oauth2,azuread-tenant-oauth2
-
WEBLATE_TIME_ZONE
¶ Configures the used time zone in Weblate, see
TIME_ZONE
.注釈
To change the time zone of the Docker container itself, use the
TZ
environment variable.例:
environment: WEBLATE_TIME_ZONE: Europe/Prague
-
WEBLATE_ENABLE_HTTPS
¶ Makes Weblate assume it is operated behind a reverse HTTPS proxy, it makes Weblate use HTTPS in e-mail and API links or set secure flags on cookies.
ヒント
Please see
ENABLE_HTTPS
documentation for possible caveats.注釈
This does not make the Weblate container accept HTTPS connections, you need to configure that as well, see Docker container with HTTPS support for examples.
例:
environment: WEBLATE_ENABLE_HTTPS: 1
-
WEBLATE_IP_PROXY_HEADER
¶ Lets Weblate fetch the IP address from any given HTTP header. Use this when using a reverse proxy in front of the Weblate container.
Enables
IP_BEHIND_REVERSE_PROXY
and setsIP_PROXY_HEADER
.注釈
The format must conform to Django's expectations. Django transforms raw HTTP header names as follows:
converts all characters to uppercase
replaces any hyphens with underscores
prepends
HTTP_
prefix
So
X-Forwarded-For
would be mapped toHTTP_X_FORWARDED_FOR
.例:
environment: WEBLATE_IP_PROXY_HEADER: HTTP_X_FORWARDED_FOR
-
WEBLATE_SECURE_PROXY_SSL_HEADER
¶ A tuple representing a HTTP header/value combination that signifies a request is secure. This is needed when Weblate is running behind a reverse proxy doing SSL termination which does not pass standard HTTPS headers.
例:
environment: WEBLATE_SECURE_PROXY_SSL_HEADER: HTTP_X_FORWARDED_PROTO,https
-
WEBLATE_REQUIRE_LOGIN
¶ Enables
REQUIRE_LOGIN
to enforce authentication on whole Weblate.例:
environment: WEBLATE_REQUIRE_LOGIN: 1
-
WEBLATE_LOGIN_REQUIRED_URLS_EXCEPTIONS
¶
-
WEBLATE_ADD_LOGIN_REQUIRED_URLS_EXCEPTIONS
¶
-
WEBLATE_REMOVE_LOGIN_REQUIRED_URLS_EXCEPTIONS
¶ Adds URL exceptions for authentication required for the whole Weblate installation using
LOGIN_REQUIRED_URLS_EXCEPTIONS
.You can either replace whole settings, or modify default value using
ADD
andREMOVE
variables.
-
WEBLATE_GOOGLE_ANALYTICS_ID
¶ Configures ID for Google Analytics by changing
GOOGLE_ANALYTICS_ID
.
-
WEBLATE_GITHUB_USERNAME
¶ Configures GitHub username for GitHub pull-requests by changing
GITHUB_USERNAME
.参考
-
WEBLATE_GITHUB_TOKEN
¶ バージョン 4.3 で追加.
Configures GitHub personal access token for GitHub pull-requests via API by changing
GITHUB_TOKEN
.参考
-
WEBLATE_GITLAB_USERNAME
¶ Configures GitLab username for GitLab merge-requests by changing
GITLAB_USERNAME
参考
-
WEBLATE_GITLAB_TOKEN
¶ Configures GitLab personal access token for GitLab merge-requests via API by changing
GITLAB_TOKEN
参考
-
WEBLATE_PAGURE_USERNAME
¶ PAGURE_USERNAME
を変更して、Pagure merge-requests 用の Pagure ユーザー名を設定する参考
-
WEBLATE_PAGURE_TOKEN
¶ PAGURE_TOKEN
を変更して、API 経由の Pagure のマージ リクエストに対して、Pagure の個人用アクセス トークンを構成する参考
-
WEBLATE_SIMPLIFY_LANGUAGES
¶ Configures the language simplification policy, see
SIMPLIFY_LANGUAGES
.
-
WEBLATE_DEFAULT_ACCESS_CONTROL
¶ Configures the default アクセス制御 for new projects, see
DEFAULT_ACCESS_CONTROL
.
-
WEBLATE_DEFAULT_RESTRICTED_COMPONENT
¶ Configures the default value for アクセス制限 for new components, see
DEFAULT_RESTRICTED_COMPONENT
.
-
WEBLATE_DEFAULT_TRANSLATION_PROPAGATION
¶ Configures the default value for 翻訳の自動反映の有効化 for new components, see
DEFAULT_TRANSLATION_PROPAGATION
.
-
WEBLATE_DEFAULT_COMMITER_EMAIL
¶ Configures
DEFAULT_COMMITER_EMAIL
.
-
WEBLATE_DEFAULT_COMMITER_NAME
¶ Configures
DEFAULT_COMMITER_NAME
.
-
WEBLATE_DEFAULT_SHARED_TM
¶ DEFAULT_SHARED_TM
の設定。
-
WEBLATE_AKISMET_API_KEY
¶ Configures the Akismet API key, see
AKISMET_API_KEY
.
-
WEBLATE_GPG_IDENTITY
¶ Configures GPG signing of commits, see
WEBLATE_GPG_IDENTITY
.
-
WEBLATE_URL_PREFIX
¶ Configures URL prefix where Weblate is running, see
URL_PREFIX
.
-
WEBLATE_SILENCED_SYSTEM_CHECKS
¶ Configures checks which you do not want to be displayed, see
SILENCED_SYSTEM_CHECKS
.
-
WEBLATE_CSP_SCRIPT_SRC
¶
-
WEBLATE_CSP_IMG_SRC
¶
-
WEBLATE_CSP_CONNECT_SRC
¶
-
WEBLATE_CSP_STYLE_SRC
¶
-
WEBLATE_CSP_FONT_SRC
¶ Allows to customize
Content-Security-Policy
HTTP header.
-
WEBLATE_LICENSE_FILTER
¶ LICENSE_FILTER
の設定。
-
WEBLATE_LICENSE_REQUIRED
¶ LICENSE_REQUIRED
の設定
-
WEBLATE_WEBSITE_REQUIRED
¶ WEBSITE_REQUIRED
の設定
-
WEBLATE_HIDE_VERSION
¶ HIDE_VERSION
の設定。
-
WEBLATE_BASIC_LANGUAGES
¶ BASIC_LANGUAGES
の設定。
-
WEBLATE_DEFAULT_AUTO_WATCH
¶ DEFAULT_AUTO_WATCH
の設定。
-
WEBLATE_RATELIMIT_ATTEMPTS
¶
-
WEBLATE_RATELIMIT_LOCKOUT
¶
-
WEBLATE_RATELIMIT_WINDOW
¶ バージョン 4.6 で追加.
接続制限を設定する。
ヒント
You can set configuration for any rate limiter scopes. To do that add
WEBLATE_
prefix to any of setting described in 接続制限.
-
WEBLATE_ENABLE_AVATARS
¶ バージョン 4.6.1 で追加.
Configures
ENABLE_AVATARS
.
Machine translation settings¶
-
WEBLATE_MT_APERTIUM_APY
¶ Enables Apertium machine translation and sets
MT_APERTIUM_APY
-
WEBLATE_MT_AWS_REGION
¶
-
WEBLATE_MT_AWS_ACCESS_KEY_ID
¶
-
WEBLATE_MT_AWS_SECRET_ACCESS_KEY
¶ Configures AWS machine translation.
environment: WEBLATE_MT_AWS_REGION: us-east-1 WEBLATE_MT_AWS_ACCESS_KEY_ID: AKIAIOSFODNN7EXAMPLE WEBLATE_MT_AWS_SECRET_ACCESS_KEY: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
-
WEBLATE_MT_DEEPL_KEY
¶ Enables DeepL machine translation and sets
MT_DEEPL_KEY
-
WEBLATE_MT_DEEPL_API_VERSION
¶ 使用する DeepL API のバージョンを設定します。参照:
MT_DEEPL_API_VERSION
。
-
WEBLATE_MT_GOOGLE_KEY
¶ Enables Google Translate and sets
MT_GOOGLE_KEY
-
WEBLATE_MT_MICROSOFT_COGNITIVE_KEY
¶ Enables Microsoft Cognitive Services Translator and sets
MT_MICROSOFT_COGNITIVE_KEY
-
WEBLATE_MT_MICROSOFT_ENDPOINT_URL
¶ Sets
MT_MICROSOFT_ENDPOINT_URL
, please note this is supposed to contain domain name only.
-
WEBLATE_MT_MICROSOFT_REGION
¶ Sets
MT_MICROSOFT_REGION
-
WEBLATE_MT_MICROSOFT_BASE_URL
¶
-
WEBLATE_MT_MODERNMT_KEY
¶ Enables ModernMT and sets
MT_MODERNMT_KEY
.
-
WEBLATE_MT_MYMEMORY_ENABLED
¶ Enables MyMemory machine translation and sets
MT_MYMEMORY_EMAIL
toWEBLATE_ADMIN_EMAIL
.例:
environment: WEBLATE_MT_MYMEMORY_ENABLED: 1
-
WEBLATE_MT_MICROSOFT_TERMINOLOGY_ENABLED
¶ Microsoft Terminology Service 機械翻訳の有効化。
environment: WEBLATE_MT_MICROSOFT_TERMINOLOGY_ENABLED: 1
-
WEBLATE_MT_SAP_BASE_URL
¶
-
WEBLATE_MT_SAP_SANDBOX_APIKEY
¶
-
WEBLATE_MT_SAP_USERNAME
¶
-
WEBLATE_MT_SAP_PASSWORD
¶
-
WEBLATE_MT_SAP_USE_MT
¶ Configures SAP Translation Hub machine translation.
environment: WEBLATE_MT_SAP_BASE_URL: "https://example.hana.ondemand.com/translationhub/api/v1/" WEBLATE_MT_SAP_USERNAME: "user" WEBLATE_MT_SAP_PASSWORD: "password" WEBLATE_MT_SAP_USE_MT: 1
Authentication settings¶
-
WEBLATE_AUTH_LDAP_SERVER_URI
¶
-
WEBLATE_AUTH_LDAP_USER_DN_TEMPLATE
¶
-
WEBLATE_AUTH_LDAP_USER_ATTR_MAP
¶
-
WEBLATE_AUTH_LDAP_BIND_DN
¶
-
WEBLATE_AUTH_LDAP_BIND_PASSWORD
¶
-
WEBLATE_AUTH_LDAP_CONNECTION_OPTION_REFERRALS
¶
-
WEBLATE_AUTH_LDAP_USER_SEARCH
¶
-
WEBLATE_AUTH_LDAP_USER_SEARCH_FILTER
¶
-
WEBLATE_AUTH_LDAP_USER_SEARCH_UNION
¶
-
WEBLATE_AUTH_LDAP_USER_SEARCH_UNION_DELIMITER
¶ LDAP authentication configuration.
Example for direct bind:
environment: WEBLATE_AUTH_LDAP_SERVER_URI: ldap://ldap.example.org WEBLATE_AUTH_LDAP_USER_DN_TEMPLATE: uid=%(user)s,ou=People,dc=example,dc=net # map weblate 'full_name' to ldap 'name' and weblate 'email' attribute to 'mail' ldap attribute. # another example that can be used with OpenLDAP: 'full_name:cn,email:mail' WEBLATE_AUTH_LDAP_USER_ATTR_MAP: full_name:name,email:mail
Example for search and bind:
environment: WEBLATE_AUTH_LDAP_SERVER_URI: ldap://ldap.example.org WEBLATE_AUTH_LDAP_BIND_DN: CN=ldap,CN=Users,DC=example,DC=com WEBLATE_AUTH_LDAP_BIND_PASSWORD: password WEBLATE_AUTH_LDAP_USER_ATTR_MAP: full_name:name,email:mail WEBLATE_AUTH_LDAP_USER_SEARCH: CN=Users,DC=example,DC=com
Example for union search and bind:
environment: WEBLATE_AUTH_LDAP_SERVER_URI: ldap://ldap.example.org WEBLATE_AUTH_LDAP_BIND_DN: CN=ldap,CN=Users,DC=example,DC=com WEBLATE_AUTH_LDAP_BIND_PASSWORD: password WEBLATE_AUTH_LDAP_USER_ATTR_MAP: full_name:name,email:mail WEBLATE_AUTH_LDAP_USER_SEARCH_UNION: ou=users,dc=example,dc=com|ou=otherusers,dc=example,dc=com
Example with search and bind against Active Directory:
environment: WEBLATE_AUTH_LDAP_BIND_DN: CN=ldap,CN=Users,DC=example,DC=com WEBLATE_AUTH_LDAP_BIND_PASSWORD: password WEBLATE_AUTH_LDAP_SERVER_URI: ldap://ldap.example.org WEBLATE_AUTH_LDAP_CONNECTION_OPTION_REFERRALS: 0 WEBLATE_AUTH_LDAP_USER_ATTR_MAP: full_name:name,email:mail WEBLATE_AUTH_LDAP_USER_SEARCH: CN=Users,DC=example,DC=com WEBLATE_AUTH_LDAP_USER_SEARCH_FILTER: (sAMAccountName=%(user)s)
参考
-
WEBLATE_SOCIAL_AUTH_BITBUCKET_KEY
¶
-
WEBLATE_SOCIAL_AUTH_BITBUCKET_SECRET
¶ Bitbucket 認証 の有効化。
-
WEBLATE_SOCIAL_AUTH_FACEBOOK_KEY
¶
-
WEBLATE_SOCIAL_AUTH_FACEBOOK_SECRET
¶ Facebook OAuth 2 の有効化。
-
WEBLATE_SOCIAL_AUTH_GOOGLE_OAUTH2_KEY
¶
-
WEBLATE_SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET
¶
-
WEBLATE_SOCIAL_AUTH_GOOGLE_OAUTH2_WHITELISTED_DOMAINS
¶
-
WEBLATE_SOCIAL_AUTH_GOOGLE_OAUTH2_WHITELISTED_EMAILS
¶ Google OAuth 2 の有効化。
-
WEBLATE_SOCIAL_AUTH_GITLAB_KEY
¶
-
WEBLATE_SOCIAL_AUTH_GITLAB_SECRET
¶
-
WEBLATE_SOCIAL_AUTH_GITLAB_API_URL
¶ GitLab OAuth 2 の有効化。
-
WEBLATE_SOCIAL_AUTH_AZUREAD_OAUTH2_KEY
¶
-
WEBLATE_SOCIAL_AUTH_AZUREAD_OAUTH2_SECRET
¶ Enables Azure Active Directory authentication, see Microsoft Azure Active Directory.
-
WEBLATE_SOCIAL_AUTH_AZUREAD_TENANT_OAUTH2_KEY
¶
-
WEBLATE_SOCIAL_AUTH_AZUREAD_TENANT_OAUTH2_SECRET
¶
-
WEBLATE_SOCIAL_AUTH_AZUREAD_TENANT_OAUTH2_TENANT_ID
¶ Enables Azure Active Directory authentication with Tenant support, see Microsoft Azure Active Directory.
-
WEBLATE_SOCIAL_AUTH_KEYCLOAK_KEY
¶
-
WEBLATE_SOCIAL_AUTH_KEYCLOAK_SECRET
¶
-
WEBLATE_SOCIAL_AUTH_KEYCLOAK_PUBLIC_KEY
¶
-
WEBLATE_SOCIAL_AUTH_KEYCLOAK_ALGORITHM
¶
-
WEBLATE_SOCIAL_AUTH_KEYCLOAK_AUTHORIZATION_URL
¶
-
WEBLATE_SOCIAL_AUTH_KEYCLOAK_ACCESS_TOKEN_URL
¶ Enables Keycloak authentication, see documentation.
You can enable authentication using Linux vendors authentication services by setting following variables to any value.
-
WEBLATE_SOCIAL_AUTH_FEDORA
¶
-
WEBLATE_SOCIAL_AUTH_OPENSUSE
¶
-
WEBLATE_SOCIAL_AUTH_UBUNTU
¶
PostgreSQL database setup¶
The database is created by docker-compose.yml
, so these settings affect
both Weblate and PostgreSQL containers.
-
POSTGRES_PASSWORD
¶ PostgreSQL password.
-
POSTGRES_USER
¶ PostgreSQL username.
-
POSTGRES_DATABASE
¶ PostgreSQL database name.
-
POSTGRES_HOST
¶ PostgreSQL server hostname or IP address. Defaults to
database
.
-
POSTGRES_PORT
¶ PostgreSQL server port. Defaults to none (uses the default value).
-
POSTGRES_SSL_MODE
¶ Configure how PostgreSQL handles SSL in connection to the server, for possible choices see SSL Mode Descriptions
-
POSTGRES_ALTER_ROLE
¶ Configures name of role to alter during migrations, see PostgreSQL を使用するための Webrate の設定.
Database backup settings¶
-
WEBLATE_DATABASE_BACKUP
¶ Configures the daily database dump using
DATABASE_BACKUP
. Defaults toplain
.
Caching server setup¶
Using Redis is strongly recommended by Weblate and you have to provide a Redis instance when running Weblate in Docker.
参考
-
REDIS_HOST
¶ The Redis server hostname or IP address. Defaults to
cache
.
-
REDIS_PORT
¶ The Redis server port. Defaults to
6379
.
-
REDIS_DB
¶ The Redis database number, defaults to
1
.
-
REDIS_PASSWORD
¶ The Redis server password, not used by default.
-
REDIS_TLS
¶ Enables using SSL for Redis connection.
-
REDIS_VERIFY_SSL
¶ Can be used to disable SSL certificate verification for Redis connection.
Email server setup¶
To make outgoing e-mail work, you need to provide a mail server.
Example TLS configuration:
environment:
WEBLATE_EMAIL_HOST: smtp.example.com
WEBLATE_EMAIL_HOST_USER: user
WEBLATE_EMAIL_HOST_PASSWORD: pass
Example SSL configuration:
environment:
WEBLATE_EMAIL_HOST: smtp.example.com
WEBLATE_EMAIL_PORT: 465
WEBLATE_EMAIL_HOST_USER: user
WEBLATE_EMAIL_HOST_PASSWORD: pass
WEBLATE_EMAIL_USE_TLS: 0
WEBLATE_EMAIL_USE_SSL: 1
参考
-
WEBLATE_EMAIL_HOST
¶ Mail server hostname or IP address.
-
WEBLATE_EMAIL_PORT
¶ Mail server port, defaults to 25.
参考
-
WEBLATE_EMAIL_HOST_USER
¶ メール認証ユーザー。
-
WEBLATE_EMAIL_HOST_PASSWORD
¶ メール認証のパスワード。
-
WEBLATE_EMAIL_USE_SSL
¶ Whether to use an implicit TLS (secure) connection when talking to the SMTP server. In most e-mail documentation, this type of TLS connection is referred to as SSL. It is generally used on port 465. If you are experiencing problems, see the explicit TLS setting
WEBLATE_EMAIL_USE_TLS
.
-
WEBLATE_EMAIL_USE_TLS
¶ Whether to use a TLS (secure) connection when talking to the SMTP server. This is used for explicit TLS connections, generally on port 587 or 25. If you are experiencing connections that hang, see the implicit TLS setting
WEBLATE_EMAIL_USE_SSL
.
-
WEBLATE_EMAIL_BACKEND
¶ Configures Django back-end to use for sending e-mails.
Error reporting¶
It is recommended to collect errors from the installation systematically, see エラー レポートの収集.
To enable support for Rollbar, set the following:
-
ROLLBAR_KEY
¶ Your Rollbar post server access token.
-
ROLLBAR_ENVIRONMENT
¶ Your Rollbar environment, defaults to
production
.
To enable support for Sentry, set following:
-
SENTRY_DSN
¶ Your Sentry DSN.
-
SENTRY_ENVIRONMENT
¶ Your Sentry Environment (optional).
CDN の現地化¶
-
WEBLATE_LOCALIZE_CDN_URL
¶
-
WEBLATE_LOCALIZE_CDN_PATH
¶ バージョン 4.2.1 で追加.
Configuration for JavaScript 現地語化 CDN.
The
WEBLATE_LOCALIZE_CDN_PATH
is path within the container. It should be stored on the persistent volume and not in the transient storage.One of possibilities is storing that inside the Weblate data dir:
environment: WEBLATE_LOCALIZE_CDN_URL: https://cdn.example.com/ WEBLATE_LOCALIZE_CDN_PATH: /app/data/l10n-cdn
注釈
You are responsible for setting up serving of the files generated by Weblate, it only does stores the files in configured location.
Changing enabled apps, checks, addons or autofixes¶
バージョン 3.8-5 で追加.
The built-in configuration of enabled checks, addons or autofixes can be adjusted by the following variables:
-
WEBLATE_ADD_APPS
¶
-
WEBLATE_REMOVE_APPS
¶
-
WEBLATE_ADD_CHECK
¶
-
WEBLATE_REMOVE_CHECK
¶
-
WEBLATE_ADD_AUTOFIX
¶
-
WEBLATE_REMOVE_AUTOFIX
¶
-
WEBLATE_ADD_ADDONS
¶
-
WEBLATE_REMOVE_ADDONS
¶
例:
environment:
WEBLATE_REMOVE_AUTOFIX: weblate.trans.autofixes.whitespace.SameBookendingWhitespace
WEBLATE_ADD_ADDONS: customize.addons.MyAddon,customize.addons.OtherAddon
コンテナの設定¶
-
WEBLATE_WORKERS
¶ バージョン 4.6.1 で追加.
Base number of worker processes running in the container. When not set it is determined automatically on container startup based on number of CPU cores available.
It is used to determine
CELERY_MAIN_OPTIONS
,CELERY_NOTIFY_OPTIONS
,CELERY_MEMORY_OPTIONS
,CELERY_TRANSLATE_OPTIONS
,CELERY_BACKUP_OPTIONS
,CELERY_BEAT_OPTIONS
, andUWSGI_WORKERS
. You can use these settings to fine-tune.
-
CELERY_MAIN_OPTIONS
¶
-
CELERY_NOTIFY_OPTIONS
¶
-
CELERY_MEMORY_OPTIONS
¶
-
CELERY_TRANSLATE_OPTIONS
¶
-
CELERY_BACKUP_OPTIONS
¶
-
CELERY_BEAT_OPTIONS
¶ These variables allow you to adjust Celery worker options. It can be useful to adjust concurrency (
--concurrency 16
) or use different pool implementation (--pool=gevent
).By default, the number of concurrent workers is based on
WEBLATE_WORKERS
.例:
environment: CELERY_MAIN_OPTIONS: --concurrency 16
-
UWSGI_WORKERS
¶ Configure how many uWSGI workers should be executed.
It defaults to
WEBLATE_WORKERS
.例:
environment: UWSGI_WORKERS: 32
-
WEBLATE_SERVICE
¶ Defines which services should be executed inside the container. Use this for Scaling horizontally.
Following services are defined:
celery-beat
Celery task scheduler, only one instance should be running. This container is also responsible for the database structure migrations and it should be started prior others.
celery-backup
Celery worker for backups, only one instance should be running.
celery-celery
Generic Celery worker.
celery-memory
Translation memory Celery worker.
celery-notify
Notifications Celery worker.
celery-translate
Automatic translation Celery worker.
web
Web サーバー。
Docker container volumes¶
There are two volumes (data and cache) exported by the Weblate container. The other service containers (PostgreSQL or Redis) have their data volumes as well, but those are not covered by this document.
The data volume is used to store Weblate persistent data such as cloned repositories or to customize Weblate installation.
The placement of the Docker volume on host system depends on your Docker
configuration, but usually it is stored in
/var/lib/docker/volumes/weblate-docker_weblate-data/_data/
. In the
container it is mounted as /app/data
.
The cache volume is mounted as /app/cache
and is used to store static
files. Its content is recreated on container startup and the volume can be
mounted using ephemeral filesystem such as tmpfs.
Further configuration customization¶
You can further customize Weblate installation in the data volume, see Docker container volumes.
Custom configuration files¶
You can additionally override the configuration in
/app/data/settings-override.py
(see Docker container volumes). This is
executed at the end of built-in settings, after all environment settings
are loaded, and you can adjust or override them.
Replacing logo and other static files¶
バージョン 3.8-5 で追加.
The static files coming with Weblate can be overridden by placing into
/app/data/python/customize/static
(see Docker container volumes). For
example creating /app/data/python/customize/static/favicon.ico
will
replace the favicon.
ヒント
The files are copied to the corresponding location upon container startup, so a restart of Weblate is needed after changing the content of the volume.
Alternatively you can also include own module (see Customizing Weblate) and add it as separate volume to the Docker container, for example:
weblate:
volumes:
- weblate-data:/app/data
- ./weblate_customization/weblate_customization:/app/data/python/weblate_customization
environment:
WEBLATE_ADD_APPS: weblate_customization
Adding own Python modules¶
バージョン 3.8-5 で追加.
You can place own Python modules in /app/data/python/
(see
Docker container volumes) and they can be then loaded by Weblate, most likely by
using Custom configuration files.
Select your machine - local or cloud providers¶
With Docker Machine you can create your Weblate deployment either on your local machine, or on any large number of cloud-based deployments on e.g. Amazon AWS, Greenhost, and many other providers.
Installing on Debian and Ubuntu¶
Hardware requirements¶
Weblate should run on any contemporary hardware without problems, the following is the minimal configuration required to run Weblate on a single host (Weblate, database and webserver):
2 GB of RAM
2 CPU cores
1 GB of storage space
The more memory the better - it is used for caching on all levels (filesystem, database and Weblate).
Many concurrent users increases the amount of needed CPU cores. For hundreds of translation components at least 4 GB of RAM is recommended.
The typical database storage usage is around 300 MB per 1 million hosted words. Storage space needed for cloned repositories varies, but Weblate tries to keep their size minimal by doing shallow clones.
注釈
Actual requirements for your installation of Weblate vary heavily based on the size of the translations managed in it.
導入¶
System requirements¶
Install the dependencies needed to build the Python modules (see ソフトウェア要件):
apt install \
libxml2-dev libxslt-dev libfreetype6-dev libjpeg-dev libz-dev libyaml-dev \
libcairo-dev gir1.2-pango-1.0 libgirepository1.0-dev libacl1-dev libssl-dev \
build-essential python3-gdbm python3-dev python3-pip python3-virtualenv virtualenv git
Install wanted optional dependencies depending on features you intend to use (see オプションの依存関係):
apt install tesseract-ocr libtesseract-dev libleptonica-dev
Optionally install software for running production server, see 実行サーバー, Weblate のデータベース設定, Celery を使用するバックグラウンド タスク. Depending on size of your installation you might want to run these components on dedicated servers.
The local installation instructions:
# Web server option 1: NGINX and uWSGI
apt install nginx uwsgi uwsgi-plugin-python3
# Web server option 2: Apache with ``mod_wsgi``
apt install apache2 libapache2-mod-wsgi
# Caching backend: Redis
apt install redis-server
# Database server: PostgreSQL
apt install postgresql postgresql-contrib
# SMTP server
apt install exim4
Python modules¶
ヒント
We're using virtualenv to install Weblate in a separate environment from your system. If you are not familiar with it, check virtualenv User Guide.
Create the virtualenv for Weblate:
virtualenv --python=python3 ~/weblate-env
Activate the virtualenv for Weblate:
. ~/weblate-env/bin/activate
Install Weblate including all dependencies:
pip install Weblate
Install database driver:
pip install psycopg2-binary
Install wanted optional dependencies depending on features you intend to use (some might require additional system libraries, check オプションの依存関係):
pip install ruamel.yaml aeidon boto3 zeep chardet tesserocr
Configuring Weblate¶
注釈
Following steps assume virtualenv used by Weblate is active (what can be
done by . ~/weblate-env/bin/activate
). In case this is not true, you will
have to specify full path to weblate command as
~/weblate-env/bin/weblate
.
Copy the file
~/weblate-env/lib/python3.7/site-packages/weblate/settings_example.py
to~/weblate-env/lib/python3.7/site-packages/weblate/settings.py
.新しい
settings.py
ファイルの値を、必要に応じて変更してください。テスト用に用意された例をそのまま使用できますが、本番用のセットアップのために変更する場合は 詳細設定 を確認してください。Create the database and its structure for Weblate (the example settings use PostgreSQL, check Weblate のデータベース設定 for production ready setup):
weblate migrate
Create the administrator user account and copy the password it outputs to the clipboard, and also save it for later use:
weblate createadmin
Collect static files for web server (see 実行サーバー and 静的ファイルの提供):
weblate collectstatic
Compress JavaScript and CSS files (optional, see クライアント アセットの圧縮):
weblate compress
Start Celery workers. This is not necessary for development purposes, but strongly recommended otherwise. See Celery を使用するバックグラウンド タスク for more info:
~/weblate-env/lib/python3.7/site-packages/weblate/examples/celery start
Start the development server (see 実行サーバー for production setup):
weblate runserver
After installation¶
Congratulations, your Weblate server is now running and you can start using it.
You can now access Weblate on
http://localhost:8000/
.Login with admin credentials obtained during installation or register with new users.
You can now run Weblate commands using weblate command when Weblate virtualenv is active, see Management commands.
You can stop the test server with Ctrl+C.
Review potential issues with your installation either on
/manage/performance/
URL or using weblate check --deploy, see 本番環境の設定.
Adding translation¶
Open the admin interface (
http://localhost:8000/create/project/
) and create the project you want to translate. See Project configuration for more details.All you need to specify here is the project name and its website.
Create a component which is the real object for translation - it points to the VCS repository, and selects which files to translate. See Component configuration for more details.
The important fields here are: Component name, VCS repository address and mask for finding translatable files. Weblate supports a wide range of formats including gettext PO files, Android resource strings, iOS string properties, Java properties or Qt Linguist files, see 対応するファイル形式 for more details.
Once the above is completed (it can be lengthy process depending on the size of your VCS repository, and number of messages to translate), you can start translating.
Installing on SUSE and openSUSE¶
Hardware requirements¶
Weblate should run on any contemporary hardware without problems, the following is the minimal configuration required to run Weblate on a single host (Weblate, database and webserver):
2 GB of RAM
2 CPU cores
1 GB of storage space
The more memory the better - it is used for caching on all levels (filesystem, database and Weblate).
Many concurrent users increases the amount of needed CPU cores. For hundreds of translation components at least 4 GB of RAM is recommended.
The typical database storage usage is around 300 MB per 1 million hosted words. Storage space needed for cloned repositories varies, but Weblate tries to keep their size minimal by doing shallow clones.
注釈
Actual requirements for your installation of Weblate vary heavily based on the size of the translations managed in it.
導入¶
System requirements¶
Install the dependencies needed to build the Python modules (see ソフトウェア要件):
zypper install \
libxslt-devel libxml2-devel freetype-devel libjpeg-devel zlib-devel libyaml-devel \
cairo-devel typelib-1_0-Pango-1_0 gobject-introspection-devel libacl-devel \
python3-pip python3-virtualenv python3-devel git
Install wanted optional dependencies depending on features you intend to use (see オプションの依存関係):
zypper install tesseract-ocr tesseract-devel leptonica-devel
Optionally install software for running production server, see 実行サーバー, Weblate のデータベース設定, Celery を使用するバックグラウンド タスク. Depending on size of your installation you might want to run these components on dedicated servers.
The local installation instructions:
# Web server option 1: NGINX and uWSGI
zypper install nginx uwsgi uwsgi-plugin-python3
# Web server option 2: Apache with ``mod_wsgi``
zypper install apache2 apache2-mod_wsgi
# Caching backend: Redis
zypper install redis-server
# Database server: PostgreSQL
zypper install postgresql postgresql-contrib
# SMTP server
zypper install postfix
Python modules¶
ヒント
We're using virtualenv to install Weblate in a separate environment from your system. If you are not familiar with it, check virtualenv User Guide.
Create the virtualenv for Weblate:
virtualenv --python=python3 ~/weblate-env
Activate the virtualenv for Weblate:
. ~/weblate-env/bin/activate
Install Weblate including all dependencies:
pip install Weblate
Install database driver:
pip install psycopg2-binary
Install wanted optional dependencies depending on features you intend to use (some might require additional system libraries, check オプションの依存関係):
pip install ruamel.yaml aeidon boto3 zeep chardet tesserocr
Configuring Weblate¶
注釈
Following steps assume virtualenv used by Weblate is active (what can be
done by . ~/weblate-env/bin/activate
). In case this is not true, you will
have to specify full path to weblate command as
~/weblate-env/bin/weblate
.
Copy the file
~/weblate-env/lib/python3.7/site-packages/weblate/settings_example.py
to~/weblate-env/lib/python3.7/site-packages/weblate/settings.py
.新しい
settings.py
ファイルの値を、必要に応じて変更してください。テスト用に用意された例をそのまま使用できますが、本番用のセットアップのために変更する場合は 詳細設定 を確認してください。Create the database and its structure for Weblate (the example settings use PostgreSQL, check Weblate のデータベース設定 for production ready setup):
weblate migrate
Create the administrator user account and copy the password it outputs to the clipboard, and also save it for later use:
weblate createadmin
Collect static files for web server (see 実行サーバー and 静的ファイルの提供):
weblate collectstatic
Compress JavaScript and CSS files (optional, see クライアント アセットの圧縮):
weblate compress
Start Celery workers. This is not necessary for development purposes, but strongly recommended otherwise. See Celery を使用するバックグラウンド タスク for more info:
~/weblate-env/lib/python3.7/site-packages/weblate/examples/celery start
Start the development server (see 実行サーバー for production setup):
weblate runserver
After installation¶
Congratulations, your Weblate server is now running and you can start using it.
You can now access Weblate on
http://localhost:8000/
.Login with admin credentials obtained during installation or register with new users.
You can now run Weblate commands using weblate command when Weblate virtualenv is active, see Management commands.
You can stop the test server with Ctrl+C.
Review potential issues with your installation either on
/manage/performance/
URL or using weblate check --deploy, see 本番環境の設定.
Adding translation¶
Open the admin interface (
http://localhost:8000/create/project/
) and create the project you want to translate. See Project configuration for more details.All you need to specify here is the project name and its website.
Create a component which is the real object for translation - it points to the VCS repository, and selects which files to translate. See Component configuration for more details.
The important fields here are: Component name, VCS repository address and mask for finding translatable files. Weblate supports a wide range of formats including gettext PO files, Android resource strings, iOS string properties, Java properties or Qt Linguist files, see 対応するファイル形式 for more details.
Once the above is completed (it can be lengthy process depending on the size of your VCS repository, and number of messages to translate), you can start translating.
Installing on RedHat, Fedora and CentOS¶
Hardware requirements¶
Weblate should run on any contemporary hardware without problems, the following is the minimal configuration required to run Weblate on a single host (Weblate, database and webserver):
2 GB of RAM
2 CPU cores
1 GB of storage space
The more memory the better - it is used for caching on all levels (filesystem, database and Weblate).
Many concurrent users increases the amount of needed CPU cores. For hundreds of translation components at least 4 GB of RAM is recommended.
The typical database storage usage is around 300 MB per 1 million hosted words. Storage space needed for cloned repositories varies, but Weblate tries to keep their size minimal by doing shallow clones.
注釈
Actual requirements for your installation of Weblate vary heavily based on the size of the translations managed in it.
導入¶
System requirements¶
Install the dependencies needed to build the Python modules (see ソフトウェア要件):
dnf install \
libxslt-devel libxml2-devel freetype-devel libjpeg-devel zlib-devel libyaml-devel \
cairo-devel pango-devel gobject-introspection-devel libacl-devel \
python3-pip python3-virtualenv python3-devel git
Install wanted optional dependencies depending on features you intend to use (see オプションの依存関係):
dnf install tesseract-langpack-eng tesseract-devel leptonica-devel
Optionally install software for running production server, see 実行サーバー, Weblate のデータベース設定, Celery を使用するバックグラウンド タスク. Depending on size of your installation you might want to run these components on dedicated servers.
The local installation instructions:
# Web server option 1: NGINX and uWSGI
dnf install nginx uwsgi uwsgi-plugin-python3
# Web server option 2: Apache with ``mod_wsgi``
dnf install apache2 apache2-mod_wsgi
# Caching backend: Redis
dnf install redis
# Database server: PostgreSQL
dnf install postgresql postgresql-contrib
# SMTP server
dnf install postfix
Python modules¶
ヒント
We're using virtualenv to install Weblate in a separate environment from your system. If you are not familiar with it, check virtualenv User Guide.
Create the virtualenv for Weblate:
virtualenv --python=python3 ~/weblate-env
Activate the virtualenv for Weblate:
. ~/weblate-env/bin/activate
Install Weblate including all dependencies:
pip install Weblate
Install database driver:
pip install psycopg2-binary
Install wanted optional dependencies depending on features you intend to use (some might require additional system libraries, check オプションの依存関係):
pip install ruamel.yaml aeidon boto3 zeep chardet tesserocr
Configuring Weblate¶
注釈
Following steps assume virtualenv used by Weblate is active (what can be
done by . ~/weblate-env/bin/activate
). In case this is not true, you will
have to specify full path to weblate command as
~/weblate-env/bin/weblate
.
Copy the file
~/weblate-env/lib/python3.7/site-packages/weblate/settings_example.py
to~/weblate-env/lib/python3.7/site-packages/weblate/settings.py
.新しい
settings.py
ファイルの値を、必要に応じて変更してください。テスト用に用意された例をそのまま使用できますが、本番用のセットアップのために変更する場合は 詳細設定 を確認してください。Create the database and its structure for Weblate (the example settings use PostgreSQL, check Weblate のデータベース設定 for production ready setup):
weblate migrate
Create the administrator user account and copy the password it outputs to the clipboard, and also save it for later use:
weblate createadmin
Collect static files for web server (see 実行サーバー and 静的ファイルの提供):
weblate collectstatic
Compress JavaScript and CSS files (optional, see クライアント アセットの圧縮):
weblate compress
Start Celery workers. This is not necessary for development purposes, but strongly recommended otherwise. See Celery を使用するバックグラウンド タスク for more info:
~/weblate-env/lib/python3.7/site-packages/weblate/examples/celery start
Start the development server (see 実行サーバー for production setup):
weblate runserver
After installation¶
Congratulations, your Weblate server is now running and you can start using it.
You can now access Weblate on
http://localhost:8000/
.Login with admin credentials obtained during installation or register with new users.
You can now run Weblate commands using weblate command when Weblate virtualenv is active, see Management commands.
You can stop the test server with Ctrl+C.
Review potential issues with your installation either on
/manage/performance/
URL or using weblate check --deploy, see 本番環境の設定.
Adding translation¶
Open the admin interface (
http://localhost:8000/create/project/
) and create the project you want to translate. See Project configuration for more details.All you need to specify here is the project name and its website.
Create a component which is the real object for translation - it points to the VCS repository, and selects which files to translate. See Component configuration for more details.
The important fields here are: Component name, VCS repository address and mask for finding translatable files. Weblate supports a wide range of formats including gettext PO files, Android resource strings, iOS string properties, Java properties or Qt Linguist files, see 対応するファイル形式 for more details.
Once the above is completed (it can be lengthy process depending on the size of your VCS repository, and number of messages to translate), you can start translating.
Installing on macOS¶
Hardware requirements¶
Weblate should run on any contemporary hardware without problems, the following is the minimal configuration required to run Weblate on a single host (Weblate, database and webserver):
2 GB of RAM
2 CPU cores
1 GB of storage space
The more memory the better - it is used for caching on all levels (filesystem, database and Weblate).
Many concurrent users increases the amount of needed CPU cores. For hundreds of translation components at least 4 GB of RAM is recommended.
The typical database storage usage is around 300 MB per 1 million hosted words. Storage space needed for cloned repositories varies, but Weblate tries to keep their size minimal by doing shallow clones.
注釈
Actual requirements for your installation of Weblate vary heavily based on the size of the translations managed in it.
導入¶
System requirements¶
Install the dependencies needed to build the Python modules (see ソフトウェア要件):
brew install python pango cairo gobject-introspection libffi glib libyaml
pip3 install virtualenv
Make sure pip will be able to find the libffi
version provided by homebrew
— this will be needed during the installation build step.
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"
Install wanted optional dependencies depending on features you intend to use (see オプションの依存関係):
brew install tesseract
Optionally install software for running production server, see 実行サーバー, Weblate のデータベース設定, Celery を使用するバックグラウンド タスク. Depending on size of your installation you might want to run these components on dedicated servers.
The local installation instructions:
# Web server option 1: NGINX and uWSGI
brew install nginx uwsgi
# Web server option 2: Apache with ``mod_wsgi``
brew install httpd
# Caching backend: Redis
brew install redis
# Database server: PostgreSQL
brew install postgresql
Python modules¶
ヒント
We're using virtualenv to install Weblate in a separate environment from your system. If you are not familiar with it, check virtualenv User Guide.
Create the virtualenv for Weblate:
virtualenv --python=python3 ~/weblate-env
Activate the virtualenv for Weblate:
. ~/weblate-env/bin/activate
Install Weblate including all dependencies:
pip install Weblate
Install database driver:
pip install psycopg2-binary
Install wanted optional dependencies depending on features you intend to use (some might require additional system libraries, check オプションの依存関係):
pip install ruamel.yaml aeidon boto3 zeep chardet tesserocr
Configuring Weblate¶
注釈
Following steps assume virtualenv used by Weblate is active (what can be
done by . ~/weblate-env/bin/activate
). In case this is not true, you will
have to specify full path to weblate command as
~/weblate-env/bin/weblate
.
Copy the file
~/weblate-env/lib/python3.7/site-packages/weblate/settings_example.py
to~/weblate-env/lib/python3.7/site-packages/weblate/settings.py
.新しい
settings.py
ファイルの値を、必要に応じて変更してください。テスト用に用意された例をそのまま使用できますが、本番用のセットアップのために変更する場合は 詳細設定 を確認してください。Create the database and its structure for Weblate (the example settings use PostgreSQL, check Weblate のデータベース設定 for production ready setup):
weblate migrate
Create the administrator user account and copy the password it outputs to the clipboard, and also save it for later use:
weblate createadmin
Collect static files for web server (see 実行サーバー and 静的ファイルの提供):
weblate collectstatic
Compress JavaScript and CSS files (optional, see クライアント アセットの圧縮):
weblate compress
Start Celery workers. This is not necessary for development purposes, but strongly recommended otherwise. See Celery を使用するバックグラウンド タスク for more info:
~/weblate-env/lib/python3.7/site-packages/weblate/examples/celery start
Start the development server (see 実行サーバー for production setup):
weblate runserver
After installation¶
Congratulations, your Weblate server is now running and you can start using it.
You can now access Weblate on
http://localhost:8000/
.Login with admin credentials obtained during installation or register with new users.
You can now run Weblate commands using weblate command when Weblate virtualenv is active, see Management commands.
You can stop the test server with Ctrl+C.
Review potential issues with your installation either on
/manage/performance/
URL or using weblate check --deploy, see 本番環境の設定.
Adding translation¶
Open the admin interface (
http://localhost:8000/create/project/
) and create the project you want to translate. See Project configuration for more details.All you need to specify here is the project name and its website.
Create a component which is the real object for translation - it points to the VCS repository, and selects which files to translate. See Component configuration for more details.
The important fields here are: Component name, VCS repository address and mask for finding translatable files. Weblate supports a wide range of formats including gettext PO files, Android resource strings, iOS string properties, Java properties or Qt Linguist files, see 対応するファイル形式 for more details.
Once the above is completed (it can be lengthy process depending on the size of your VCS repository, and number of messages to translate), you can start translating.
ソースからインストール¶
まずは、使用しているシステムのインストール方法に従う:
Git で最新の Weblate のソースを取得(または tarball をダウンロードして解凍)する方法:
git clone https://github.com/WeblateOrg/weblate.git weblate-src
または、リリースしたアーカイブも使用できます。Web サイト <https://weblate.org/> からダウンロードできます。ダウンロード ファイルは暗号化し署名されています。リリース署名の検証 を確認してください。
現在の Weblate コードを virtualenv にインストールする方法:
. ~/weblate-env/bin/activate pip install -e weblate-src
weblate/settings_example.py
をweblate/settings.py
にコピーする。新しい
settings.py
ファイルの値を、必要に応じて変更してください。テスト用に用意された例をそのまま使用できますが、本番用のセットアップのために変更する場合は 詳細設定 を確認してください。Weblate が使用するデータベースを作成します。参照: Weblate のデータベース設定。
Django テーブル、静的ファイル、初期データのビルド(参照: データベースの準備 および 静的ファイルの提供)の方法:
weblate migrate weblate collectstatic weblate compress weblate compilemessages
注釈
この手順は、リポジトリを更新するたびに繰り返すことが必要です。
Installing on OpenShift¶
With the OpenShift Weblate template you can get your personal Weblate instance up and running in seconds. All of Weblate’s dependencies are already included. PostgreSQL is set up as the default database and persistent volume claims are used.
You can find the template at <https://github.com/WeblateOrg/openshift/>.
導入¶
The following examples assume you have a working OpenShift v3.x
environment, with oc
client tool installed. Please check the
OpenShift documentation for instructions.
Web Console¶
Copy the raw content from template.yml
and import them into your
project, then use the Create
button in the OpenShift web console to
create your application. The web console will prompt you for the values
for all of the parameters used by the template.
CLI¶
To upload the Weblate template to your current project’s template
library, pass the template.yml
file with the following command:
$ oc create -f https://raw.githubusercontent.com/WeblateOrg/openshift/main/template.yml \
-n <PROJECT>
The template is now available for selection using the web console or the CLI.
The parameters that you can override are listed in the parameters section of the template. You can list them with the CLI by using the following command and specifying the file to be used:
$ oc process --parameters -f https://raw.githubusercontent.com/WeblateOrg/openshift/main/template.yml
# If the template is already uploaded
$ oc process --parameters -n <PROJECT> weblate
You can also use the CLI to process templates and use the configuration that is generated to create objects immediately.
$ oc process -f https://raw.githubusercontent.com/WeblateOrg/openshift/main/template.yml \
-p APPLICATION_NAME=weblate \
-p WEBLATE_VERSION=4.3.1-1 \
-p WEBLATE_SITE_DOMAIN=weblate.app-openshift.example.com \
-p POSTGRESQL_IMAGE=docker-registry.default.svc:5000/openshift/postgresql:9.6 \
-p REDIS_IMAGE=docker-registry.default.svc:5000/openshift/redis:3.2 \
| oc create -f
The Weblate instance should be available after successful migration and
deployment at the specified WEBLATE_SITE_DOMAIN
parameter.
After container setup, you can sign in as admin user with password provided
in WEBLATE_ADMIN_PASSWORD
, or a random password generated on first
start if that was not set.
To reset admin password, restart the container with
WEBLATE_ADMIN_PASSWORD
set to new password in the respective Secret
.
$ oc delete all -l app=<APPLICATION_NAME>
$ oc delete configmap -l app= <APPLICATION_NAME>
$ oc delete secret -l app=<APPLICATION_NAME>
# ATTTENTION! The following command is only optional and will permanently delete all of your data.
$ oc delete pvc -l app=<APPLICATION_NAME>
$ oc delete all -l app=weblate \
&& oc delete secret -l app=weblate \
&& oc delete configmap -l app=weblate \
&& oc delete pvc -l app=weblate
設定¶
By processing the template a respective ConfigMap
will be created
and which can be used to customize the Weblate image. The ConfigMap
is directly mounted as environment variables and triggers a new
deployment every time it is changed. For further configuration options,
see Docker environment variables for full list of environment variables.
Installing on Kubernetes¶
注釈
This guide is looking for contributors experienced with Kubernetes to cover the setup in more details.
With the Kubernetes Helm chart you can get your personal Weblate instance up and running in seconds. All of Weblate’s dependencies are already included. PostgreSQL is set up as the default database and persistent volume claims are used.
You can find the chart at <https://github.com/WeblateOrg/helm/> and it can be displayed at <https://artifacthub.io/packages/helm/weblate/weblate>.
導入¶
helm repo add weblate https://helm.weblate.org
helm install my-release weblate/weblate
セットアップと経験に応じて、適切なインストール方法を選択する:
Docker を使用したインストール、本番環境として推奨。
Virtualenv のインストール、推奨する本番環境:
ソースからインストール、開発環境として推奨。
ソフトウェア要件¶
オペレーティング システム¶
Weblate は、Linux、FreeBSD、macOSで動作することが判明しています。他の Unix のようなシステムでも動作する可能性は高いでしょう。
Weblate は Windows には対応していません。しかし、それでも動作するかもしれないのでパッチは歓迎します。
その他のサービス¶
Weblate は他のサービスを利用しています。実行が必要なサービス:
PostgreSQL データベース サーバー。参照: Weblate のデータベース設定。
キャッシュとタスク キューの Redis サーバー。参照: Celery を使用するバックグラウンド タスク。
メール送信用の SMTP サーバー。参照: メール送信の設定。
Python の依存関係¶
Weblateは、Python で書かれており、Python 3.6 以降に対応しています。依存関係は pip を使ってのインストールも、ディストリビューションのパッケージからのインストールもできます。完全な一覧は requirements.txt
にあります。
最も重要な依存関係:
- Django
- Celery
- Translate Toolkit
- translation-finder
- Python Social Auth
- Django REST フレームワーク
オプションの依存関係¶
Weblate の機能には、以下のモジュールを必要とするものがあります。これらはすべて 、requirements-optional.txt
で確認できます。
Mercurial
( Mercurial リポジトリ対応用のオプション)phply
(PHP 対応用のオプション)tesserocr
(スクリーンショットの OCR 用のオプション)akismet
(提案のスパム保護用のオプション)ruamel.yaml
(YAML files 用のオプション)Zeep
(Microsoft Terminology Service 用のオプション)aeidon
(Subtitle files 用のオプション)
バックエンドのデータベースの依存関係¶
Weblate は、PostgreSQL、MySQL および MariaDB に対応しています。詳細は Weblate のデータベース設定 およびバックエンドのドキュメントを確認してください。
その他のシステム要件¶
システムにインストールする必要がある依存関係:
Git
- Pango、Cairo および関連するヘッダ ファイルと gir イントロスペクション データ
https://cairographics.org/、https://pango.gnome.org/。参照: Pango と Cairo
git-review
(Gerrit 対応用のオプション)git-svn
(Subversion 対応用のオプション)tesseract
とそのデータ(スクリーンショットの OCR 用のオプション)licensee
(コンポーネント作成時にライセンス確認するためのオプション)
ビルド時の依存関係¶
Python の依存関係 の一部をビルドするには、それらの依存関係をインストールすることが必要な場合があります。これはインストール方法によって異なりますので、個々のパッケージに関するドキュメントを確認してください。 pip
を使用してインストールするときにビルド済みの Wheels
を使用する場合、または配布パッケージを使用する場合には必要ありません。
Pango と Cairo¶
バージョン 3.7 で変更.
Weblateは、ビットマップ ウィジェットの表示(参照: Promoting the translation)と、検査結果の表示(参照: フォントの管理)に Pango と Cairo を使用します。それらの Python バインディングを適切にインストールするには、最初にシステム ライブラリのインストールが必要です。Cairo と Pango の両方が必要であり、次に GLib が必要です。これらはすべて、開発ファイルと GObject イントロスペクション データとともにインストールが必要です。
リリース署名の検証¶
Weblate のリリースは、リリースした開発者により署名は暗号化されています。現在は、Michal Čihař です。彼の PGP 鍵の指紋:
63CB 1DF1 EF12 CF2A C0EE 5A32 9C27 B313 42B7 511D
さらに、<https://keybase.io/nijel> からより多くの身元情報を得られます。
署名がダウンロードしたアーカイブと一致するかどうかの確認が必要です。これにより、リリースされたものと同じコードを使用していることを確認できます。また、署名の日付を確認して、最新バージョンをダウンロードしたかどうかも確認が必要です。
各アーカイブには、PGP 署名を含む .asc
ファイルが付属しています。両方を同じフォルダに入れることで署名を確認できます。
$ gpg --verify Weblate-3.5.tar.xz.asc
gpg: assuming signed data in 'Weblate-3.5.tar.xz'
gpg: Signature made Ne 3. března 2019, 16:43:15 CET
gpg: using RSA key 87E673AF83F6C3A0C344C8C3F4AA229D4D58C245
gpg: Can't check signature: public key not found
ご覧のとおり、GPG は公開鍵が分からないと苦情を返してます。この時点で、実行が必要な項目:
wkd を使用して鍵をダウンロードする:
$ gpg --auto-key-locate wkd --locate-keys michal@cihar.com
pub rsa4096 2009-06-17 [SC]
63CB1DF1EF12CF2AC0EE5A329C27B31342B7511D
uid [ultimate] Michal Čihař <michal@cihar.com>
uid [ultimate] Michal Čihař <nijel@debian.org>
uid [ultimate] [jpeg image of size 8848]
uid [ultimate] Michal Čihař (Braiins) <michal.cihar@braiins.cz>
sub rsa4096 2009-06-17 [E]
sub rsa4096 2015-09-09 [S]
Michal のサーバー から鍵束をダウンロードし、次のコマンドでインポートする:
$ gpg --import wmxth3chu9jfxdxywj1skpmhsj311mzm
鍵サーバーの 1 つから鍵をダウンロードしてインポートする:
$ gpg --keyserver hkp://pgp.mit.edu --recv-keys 87E673AF83F6C3A0C344C8C3F4AA229D4D58C245
gpg: key 9C27B31342B7511D: "Michal Čihař <michal@cihar.com>" imported
gpg: Total number processed: 1
gpg: unchanged: 1
これは状況を少し改善させます - この時点で、指定した鍵からの署名が正しいことを確認できますが、鍵で使用されている名前の信頼はできない:
$ gpg --verify Weblate-3.5.tar.xz.asc
gpg: assuming signed data in 'Weblate-3.5.tar.xz'
gpg: Signature made Ne 3. března 2019, 16:43:15 CET
gpg: using RSA key 87E673AF83F6C3A0C344C8C3F4AA229D4D58C245
gpg: Good signature from "Michal Čihař <michal@cihar.com>" [ultimate]
gpg: aka "Michal Čihař <nijel@debian.org>" [ultimate]
gpg: aka "[jpeg image of size 8848]" [ultimate]
gpg: aka "Michal Čihař (Braiins) <michal.cihar@braiins.cz>" [ultimate]
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: 63CB 1DF1 EF12 CF2A C0EE 5A32 9C27 B313 42B7 511D
ここでの問題は、誰でもこの名前で鍵を発行できることです。鍵が実際にその人物が所有しているかどうかの確認が必要です。 GNU プライバシー ハンドブックでは、Validating other keys on your public keyring の章でこの話題を扱っています。最も信頼できる方法は、開発者と直接会って鍵の指紋を交換することですが、信頼できる WEB に頼ることもできます。これにより、開発者に直接会った他の人の署名を使用して、鍵を関節的に信頼できます。
鍵が信頼されると、警告は発生しない:
$ gpg --verify Weblate-3.5.tar.xz.asc
gpg: assuming signed data in 'Weblate-3.5.tar.xz'
gpg: Signature made Sun Mar 3 16:43:15 2019 CET
gpg: using RSA key 87E673AF83F6C3A0C344C8C3F4AA229D4D58C245
gpg: Good signature from "Michal Čihař <michal@cihar.com>" [ultimate]
gpg: aka "Michal Čihař <nijel@debian.org>" [ultimate]
gpg: aka "[jpeg image of size 8848]" [ultimate]
gpg: aka "Michal Čihař (Braiins) <michal.cihar@braiins.cz>" [ultimate]
署名が無効な場合(アーカイブ改ざん時)、鍵が信頼できるかどうかにかかわらず、表示される明確なエラー:
$ gpg --verify Weblate-3.5.tar.xz.asc
gpg: Signature made Sun Mar 3 16:43:15 2019 CET
gpg: using RSA key 87E673AF83F6C3A0C344C8C3F4AA229D4D58C245
gpg: BAD signature from "Michal Čihař <michal@cihar.com>" [ultimate]
ファイル システムのアクセス権¶
Weblate プロセスは、データを保持するディレクトリに対して読み書きできることが必要 - DATA_DIR
。このディレクトリ内のすべてのファイルは、すべての Weblat プロセス(通常は WSGI と Celery、参照: 実行サーバー および Celery を使用するバックグラウンド タスク)を実行しているユーザーが所有し、書き込み可能であることが必要です。
デフォルトの設定では、これらは Weblate のソースと同じ階層に配置されますが、より適切な場所に移動が可能: /var/lib/weblate
。
Weblate は、これらのディレクトリを自動的に作成を試みます。しかし、アクセス権がない場合は失敗します。
また、Management commands の実行時には注意が必要です。これは、Weblate 自体の実行と同じユーザーで実行することが必要なためです。そうでなければ、アクセス権を間違ったファイルがあります。
Docker コンテナでは、/app/data
ボリューム内のすべてのファイルは、コンテナ内の weblate ユーザーが所有者であることが必要です(UID 1000)。
参考
Weblate のデータベース設定¶
PostgreSQL データベース サーバーで Weblate を実行することを推奨します。
PostgreSQL¶
通常、PostgreSQL は Django ベースのサイトに最適です。これは、Django データベース層の実装に使用する参照データベースです。
注釈
Weblate では、場合によっては個別にインストールすることが必要なトライグラム拡張機能を使用します。postgresql-contrib
または同様の名前のパッケージを探してください。
PostgreSQL でデータベースの作成¶
通常は、データベースを分けて Weblate を実行することを推奨します。ユーザー アカウントも分ける:
# If PostgreSQL was not installed before, set the main password
sudo -u postgres psql postgres -c "\password postgres"
# Create a database user called "weblate"
sudo -u postgres createuser --superuser --pwprompt weblate
# Create the database "weblate" owned by "weblate"
sudo -u postgres createdb -O weblate weblate
ヒント
Weblate ユーザーを PostgreSQL のスーパーユーザーにしたくない場合は、省略できます。その場合、Weblate が使用するスキーマの PostgreSQL スーパーユーザとして、移行手順のいくつかを手動で実行することが必要。方法:
CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA weblate;
PostgreSQL を使用するための Webrate の設定¶
settings.py
PostgreSQL 用のスニペット:
DATABASES = {
"default": {
# Database engine
"ENGINE": "django.db.backends.postgresql",
# Database name
"NAME": "weblate",
# Database user
"USER": "weblate",
# Name of role to alter to set parameters in PostgreSQL,
# use in case role name is different than user used for authentication.
# "ALTER_ROLE": "weblate",
# Database password
"PASSWORD": "password",
# Set to empty string for localhost
"HOST": "database.example.com",
# Set to empty string for default
"PORT": "",
}
}
データベースの移行では、Weblate が使用するデータベース ロールに対して ALTER ROLE を実行します。ほとんどの場合、ロールの名前は username と一致します。より複雑な設定では、ロール名がユーザ名と異なり、データベース移行中に存在しないロールに関するエラーが発生します(psycopg2.errors.UndefinedObject: role "weblate@hostname" does not exist
)。これは Azure Database for PostgreSQL で発生することが判明していますが、この環境に限定されません。データベースの移行中に Weblate で変更するロールの名前を変更するには、ALTER_ROLE
と設定してください。
MySQL と MariaDB¶
ヒント
Weblate の機能の中には、PostgreSQL を使用するとパフォーマンスが向上するものがあります。これには、検索と翻訳メモリが含まれます。どちらもデータベースの全文機能を利用しており、PostgreSQL を実装する方が優れています。
Weblate は MySQL や MariaDB でも使用できます。Django を使用する際の注意事項については、MySQL notes および MariaDB notes を確認してください。制限があるため、新規インストールには PostgreSQL の使用を推奨します。
Weblate には、MySQL 5.7.8 以上または MariaDB 10.2.7 以上が必要です。
Weblate で推奨する設定:
utf8mb4
文字セットを使用して、より高い Unicode プレーン(絵文字など)の表現を可能にする。テキスト フィールドでより長いインデックスを使用できるように、
innodb_large_prefix
をサーバーに設定する。分離レベルを
READ COMMITTED
に設定する。SQL モードは
STRICT_TRANS_TABLES
に設定が必要。
MySQL 8.x, MariaDB 10.5.x or newer have reasonable default configuration so that no server tweaking should be necessary and all what is needed can be configured on the client side.
以下は、8 GB の RAM を搭載したサーバーの例 /etc/my.cnf.d/server.cnf
です。ほとんどのインストールでは、この設定で十分です。MySQL と MariaDB には、サーバーの性能を向上させる調整機能があります。これは、システムに多数のユーザーが同時接続することを計画していない限り、不要となります。これらの詳細については、さまざまなベンダーのドキュメントを確認してください。
Weblate のインストールを開始する前に MySQL/MariaDB が再起動されるため、innodb_file_per_table
を適切に設定してインストール時の問題を減らすことが非常に重要です。
[mysqld]
character-set-server = utf8mb4
character-set-client = utf8mb4
collation-server = utf8mb4_unicode_ci
datadir=/var/lib/mysql
log-error=/var/log/mariadb/mariadb.log
innodb_large_prefix=1
innodb_file_format=Barracuda
innodb_file_per_table=1
innodb_buffer_pool_size=2G
sql_mode=STRICT_TRANS_TABLES
ヒント
#1071 - Specified key was too long; max key length is 767 bytes
というメッセージが表示された場合、上記の innodb
設定を含むように構成を更新し、インストールを再開してください。
ヒント
In case you are getting #2006 - MySQL server has gone away
error,
configuring CONN_MAX_AGE
might help.
MySQL/MariaDB を使用するための Weblate の設定¶
settings.py
MySQL と MariaDB 用のスニペット:
DATABASES = {
"default": {
# Database engine
"ENGINE": "django.db.backends.mysql",
# Database name
"NAME": "weblate",
# Database user
"USER": "weblate",
# Database password
"PASSWORD": "password",
# Set to empty string for localhost
"HOST": "127.0.0.1",
# Set to empty string for default
"PORT": "3306",
# In case you wish to use additional
# connection options
"OPTIONS": {},
}
}
インストールを開始する前に、MySQL または MariaDB で weblate
ユーザー アカウントの作成が必要です。次のコマンドを使用する:
GRANT ALL ON weblate.* to 'weblate'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
その他の設定¶
メール送信の設定¶
Weblate は、多くのタイミングでメールを送信します - アカウントの有効化やユーザーが設定した通知など。そのためには、SMTP サーバへの接続が必要です。
メール サーバーのセットアップは、次の設定を使用して設定する: EMAIL_HOST
、EMAIL_HOST_PASSWORD
、EMAIL_USE_TLS
、EMAIL_USE_SSL
、EMAIL_HOST_USER
および EMAIL_PORT
。 名前は一目瞭然ですが、詳細については Django の資料を確認してください。
ヒント
対応していない認証方法に関するエラーが発生した場合(例: SMTP AUTH extension not supported by server
)、安全でない接続を使用していることが原因である可能性が高く、サーバーはこの方法による認証を拒否します。このような場合は、EMAIL_USE_TLS
を有効にしてみてください。
リバース プロキシの背後で実行¶
Weblate の複数の機能は、クライアントの IP アドレスを取得できることを前提にしています。これには、接続制限、Spam protection または 監査ログ が含まれます。
デフォルト構成では、WEBlate は WSGI ハンドラーによって設定された REMOTE_ADDR
から IP アドレスを解析します。
リバース プロキシーを実行している場合、このフィールドには通常、そのアドレスが含まれます。追加の HTTP ヘッダーを信頼し、これらから IP アドレスを解析するように Webrate を設定することが必要です。リバース プロキシを使用しないインストールでは IP アドレスのスプーフィングが許可されるため、デフォルトでは有効にできません。IP_BEHIND_REVERSE_PROXY
を有効化するだけで通常の設定では十分ですが、IP_PROXY_HEADER
および IP_PROXY_OFFSET
の設定も調整が必要です。
HTTP プロキシ¶
Weblate は VCS コマンドを実行し、それらは環境からプロキシ設定を受け入れます。次の場所でプロキシ設定の設定を推奨します settings.py
:
import os
os.environ["http_proxy"] = "http://proxy.example.com:8080"
os.environ["HTTPS_PROXY"] = "http://proxy.example.com:8080"
詳細設定¶
参考
weblate/settings_example.py
を weblate/settings.py
にコピーし、設定に合わせて変更します。変更した方がいいオプション:
ADMINS
マージの失敗や Django エラーなど、問題が発生したときに通知を受け取るサイト管理者一覧。
参考
ALLOWED_HOSTS
これを設定して、サイトでサービスを提供する予定のホストを一覧表示することが必要です。設定例:
ALLOWED_HOSTS = ["demo.weblate.org"]ワイルドカードを含めることも可能:
ALLOWED_HOSTS = ["*"]
SESSION_ENGINE
セッションの保存方法を設定します。デフォルトのデータベース バックエンド エンジンを使用している場合は、次のスケジュールが必要: weblate clearsessions で、古いセッション データをデータベースから削除する。
Redis をキャッシュとして使用している場合(参照: キャッシュの有効化)、セッションにも Redis を使用すべき:
SESSION_ENGINE = "django.contrib.sessions.backends.cache"
DATABASES
データベース サーバーへの接続。詳細については、Django のドキュメントを確認してください。
DEBUG
すべての本番環境サーバーでこの機能を無効にします。デバッグ モードを有効にすると、Django はユーザーにエラーが発生した場合にバックトレースを表示します。無効にすると、エラーはメールごとに
ADMINS
(上記参照)に送信されます。デバッグ モードでは、Django がこの場合でより多くの情報を内部に保存するため、Weblate の速度が低下します。
参考
DEFAULT_FROM_EMAIL
メール送信時の送信者のメールアドレス。例: 登録済みのメールアドレス。
SECRET_KEY
Django が Cookie の情報に署名するために使用するキー。詳細については、Django の秘密鍵 を確認してください。
参考
SERVER_EMAIL
管理者にメール送信する場合の送信者のメールアドレス。例: マージを失敗した時の通知など 。
参考
データベースの準備¶
設定の準備ができたら、weblate migrate
を実行してデータベース構造を作成します。これで、管理インタフェースを使用して翻訳プロジェクトを作成できます。
非対話式でインストールを実行する場合は、weblate migrate --noinput
を使用してから、createadmin
コマンドを使用して admin ユーザーを作成します。
設定が完了したら、管理インターフェイスの Performance report も確認してください。これにより、サイトの不適切かもしれない設定のヒントが得られます。
本番環境の設定¶
本番環境のセットアップでは、以下のセクションで説明する設定が必要です。最重要の設定では警告が発生します。スーパーユーザーとしてサインインしている場合、上部バーに感嘆符で警告:

また、Django によって起動された検査項目を確認することも推奨します(すべてを修正する必要はないかもしれない):
weblate check --deploy
管理画面 からも、ほぼ同じな検査項目を確認できます。
参考
デバッグ モードの無効¶
Django のデバッグ モード( DEBUG
)を無効する方法:
DEBUG = False
デバッグ モードを有効にすると、Django は実行したすべてのクエリーを保管し、ユーザーにエラーのバック トレースを表示しますが、これは本番環境では望ましくありません。
参考
管理者の適切な設定¶
適切な管理者のメールアドレスを ADMINS
に設定します。サーバーで問題が発生した場合に誰がメールを受信するかを設定します。次のように:
ADMINS = (("Your Name", "your_email@example.com"),)
参考
正確なサイトのドメイン設定¶
管理インターフェイスでサイト名とドメインを設定してください。そうでなければ、RSS のリンクまたは登録したメールが機能しません。これは、サイトのドメイン名を含めて SITE_DOMAIN
に設定します。
バージョン 4.2 で変更: 4.2 以前のリリースでは、代わりに Django sites フレームワークが使用されていました。参照: The "sites" framework。
HTTPS を正確に構成する¶
暗号化された HTTPS プロトコルを使用して Webrate を実行することを強く推奨します。有効にした後に ENABLE_HTTPS
に設定が必要:
ENABLE_HTTPS = True
ヒント
HSTS も設定すべきです。詳細については、SSL/HTTPS を確認してください。
SECURE_HSTS_SECONDS を適切に設定¶
サイトを SSL で提供している場合、HTTP Strict Transport Security を有効にするには、settings.py
内の SECURE_HSTS_SECONDS
の値を設定する検討が必要です。以下のように、デフォルトでは 0 に設定されています。
SECURE_HSTS_SECONDS = 0
ゼロ以外の整数値に設定すると、django.middleware.security.SecurityMiddleware
は、HTTP Strict Transport Security ヘッダーをまだ持たないすべての応答に設定します。
警告
これを誤って設定すると、元に戻せないほど(しばらくの間)サイトが壊れることがあります。はじめに HTTP Strict Transport Security のドキュメントを読んでください。
強力なデータベース エンジンの使用¶
本番環境では PostgreSQL を使用してください。詳しいことは、Weblate のデータベース設定 を確認してください。
キャッシュの有効化¶
可能であれば、設定変数 CACHES
を調整して Django の Redis を使用します。設定例:
CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://127.0.0.1:6379/0",
# If redis is running on same host as Weblate, you might
# want to use unix sockets instead:
# 'LOCATION': 'unix:///var/run/redis/redis.sock?db=0',
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
"PARSER_CLASS": "redis.connection.HiredisParser",
},
}
}
ヒント
キャッシュの Redis 設定を変更する場合は、Celery 用に調整することが必要です。参照: Celery を使用するバックグラウンド タスク。
アバターのキャッシュ¶
Django のキャッシュに加えて、Weblate はアバターのキャッシュも行います。別のファイル バックアップ キャッシュにすることを推奨します。設定例:
CACHES = {
"default": {
# Default caching backend setup, see above
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "unix:///var/run/redis/redis.sock?db=0",
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
"PARSER_CLASS": "redis.connection.HiredisParser",
},
},
"avatar": {
"BACKEND": "django.core.cache.backends.filebased.FileBasedCache",
"LOCATION": os.path.join(DATA_DIR, "avatar-cache"),
"TIMEOUT": 604800,
"OPTIONS": {
"MAX_ENTRIES": 1000,
},
},
}
メールの送信設定¶
Weblate は何度かメールを送信することが必要です。また、送信者のメールアドレスが正確であることが必要です。環境に合わせて SERVER_EMAIL
および DEFAULT_FROM_EMAIL
を設定してください。設定例:
SERVER_EMAIL = "admin@example.org"
DEFAULT_FROM_EMAIL = "weblate@example.org"
注釈
Weblate からのメール送信を無効にするには、EMAIL_BACKEND
を django.core.mail.backends.dummy.EmailBackend
に設定します。
これにより、登録やパスワード リセットを含む すべての メール配信が無効になります。
許可するホストの登録¶
Django では、サイトの使用を許可するドメイン名のリストを登録するために ALLOWED_HOSTS
が必要です。空のままだと、リクエストはブロックされます。
HTTP サーバーと一致するように設定されていない場合、以下のようなエラーが発生します。Invalid HTTP_HOST header: '1.1.1.1'. You may need to add '1.1.1.1' to ALLOWED_HOSTS.
ヒント
Docker コンテナでは、WEBLATE_ALLOWED_HOSTS
として使用できます。
Django の秘密鍵¶
SECRET_KEY
設定は、Django が cookie に署名するために使用します。サンプル設定の値を使用せず、実際に独自の値を生成することが必要です。
新しい秘密鍵の生成には、Weblate 付属の weblate/examples/generate-secret-key
を使用します。
参考
ホーム ディレクトリ¶
バージョン 2.1 で変更: これは不要になりました。Weblate では、すべてのデータを DATA_DIR
に格納します。
Weblate を実行しているユーザーのホーム ディレクトリが存在し、ユーザーが書き込み可能であることが必要です。これは、特に SSH を使ってプライベート リポジトリに接続したい場合に必要ですが、Git はこのディレクトリにもアクセスが必要かもしれません(使用する Git のバージョンによる)。
Weblate で使用するディレクトリは、 settings.py
で変更できます。Weblate 階層の configuration
ディレクトリに設定します。
os.environ["HOME"] = os.path.join(BASE_DIR, "configuration")
注釈
Linux および、その他の UNIX などのシステムでは、ユーザーのホーム ディレクトリへのパスは /etc/passwd
に定義します。多くのディストリビューションでは、WEB コンテンツを提供するユーザー(apache
、www-data
または wwwrun
など)のために、書き込み不可のディレクトリをデフォルトにしています。そのため、別のユーザーの配下で Webrate を実行するか、この設定の変更が必要です。
参考
テンプレートの読み込み¶
Django には、キャッシュしたテンプレート ローダーの使用を推奨します。解析したテンプレートをキャッシュして、リクエストごとに解析を行うことが必要なくなります。次のスニペット(ここでは loaders
の設定が重要)を使用した設定方法:
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [
os.path.join(BASE_DIR, "templates"),
],
"OPTIONS": {
"context_processors": [
"django.contrib.auth.context_processors.auth",
"django.template.context_processors.debug",
"django.template.context_processors.i18n",
"django.template.context_processors.request",
"django.template.context_processors.csrf",
"django.contrib.messages.context_processors.messages",
"weblate.trans.context_processors.weblate_context",
],
"loaders": [
(
"django.template.loaders.cached.Loader",
[
"django.template.loaders.filesystem.Loader",
"django.template.loaders.app_directories.Loader",
],
),
],
},
},
]
メンテナンス タスクの実行¶
パフォーマンスを最適化するには、メンテナンス タスクをバックグラウンドで実行することを推奨します。これは、Celery を使用するバックグラウンド タスク により自動的に実行します。次のカバーされるタスク:
設定の健全性診断(毎時)。
保留中の変更のコミット(毎時)。参照: Lazy commits および
commit_pending
。コンポーネント アラートの更新(毎日)。
リモート ブランチの(毎晩)更新。参照:
AUTO_UPDATE
。JSON への翻訳メモリのバックアップ(毎日)。参照:
dump_memory
。全文およびデータベースの保守タスク(毎日および毎週のタスク)。参照:
cleanuptrans
。
バージョン 3.2 で変更: バージョン 3.2 以降、これらのタスクを実行するデフォルトの方法に Celery を使用しており、Weblate はすでに適切な設定で提供しています。参照: Celery を使用するバックグラウンド タスク。
システム言語とエンコーディング¶
システム言語は、UTF-8 対応の言語に設定することが必要です。ほとんどの Linux ディストリビューションでは、これがデフォルト設定です。システム上に当てはまらない場合は、言語を UTF-8 形式に変更してください。
例えば、/etc/default/locale
を編集して、``LANG="C.UTF-8"``を設定します。
場合によっては、個々のサービスが言語に対して個別の設定を持っています。Apache を使用する場合、 /etc/apache2/envvars
にする設定:
export LANG='en_US.UTF-8'
export LC_ALL='en_US.UTF-8'
カスタム認証局の使用¶
Weblate は、HTTP リクエスト中に SSL 証明書を検証します。デフォルトで同梱の信頼性がないカスタム認証局を使用している場合は、その証明書を信頼できるものとして追加することが必要です。
これをシステム レベルで行うことを推奨します。詳細はディストリビューションのドキュメントを参照してください(例えば Debian では、CA 証明書を /usr/local/share/ca-certificates/
に配置して、 update-ca-certificates を実行します)。
これを実行すると、システム ツールは証明書を信頼します。これは Git を含みます。
Python コードの場合は、同梱しているシステム CA バンドルではなく、システム CA バンドルを使用するようにリクエストを設定することが必要です。これは、次のコードを settings.py
(Debian 固有のパス)にコピーして実現:
import os
os.environ["REQUESTS_CA_BUNDLE"] = "/etc/ssl/certs/ca-certificates.crt"
クライアント アセットの圧縮¶
Weblate には、JavaScript と CSS ファイルがたくさん付属しています。パフォーマンス上の理由から、クライアントに送信する前に圧縮することを推奨します。デフォルトの設定では、オーバーヘッドをかけずに、その場で実行されます。大規模なインストールでは、オフライン圧縮モードの有効化を推奨します。これは、設定ですることが必要であり、圧縮は、すべての Weblate アップグレードで実行することが必要です。
設定の切り替えは簡単で、django.conf.settings.COMPRESS_OFFLINE
を有効にして、django.conf.settings.COMPRESS_OFFLINE_CONTEXT`
を設定(後者はすでに制定例に含む)設定例:
COMPRESS_OFFLINE = True
デプロイごとに、現在のバージョンと一致するようにファイルを圧縮することが必要:
weblate compress
ヒント
公式の Docker イメージでは、この機能はすでに有効です。
実行サーバー¶
ヒント
In case you are not experienced with services described below, you might want to try Docker を使用したインストール.
Weblate の実行に必要なサービスと推奨設定:
データベース サーバー(参照: Weblate のデータベース設定 )
キャッシュ サーバー(参照: キャッシュの有効化 )
静的ファイルと SSL ターミネーション用のフロントエンド Web サーバー(参照: 静的ファイルの提供 )
動的コンテンツ用の WSGI サーバー(参照: NGINX および uWSGI の設定例 )
バックグラウンド タスクを実行用のセロリ(参照: Celery を使用するバックグラウンド タスク )
注釈
サービス間には一部依存関係があります。例えば、Celery または uwsgi プロセスの起動時には、キャッシュとデータベース サーバーが実行されていることが必要です。
ほとんどの場合、すべてのサービスを単一の(仮想)サーバー上で実行しますが、インストールの負荷が高い場合は、サービスを分割できます。唯一の制限は、Celery サーバーと Wsgi サーバーは DATA_DIR
へのアクセスが必要なことです。
注釈
WSGI プロセスは、Celery プロセスと同じユーザーとして実行することが必要です。異なると、DATA_DIR
内のファイルの所有権は混在した状態で保存され、実行時に問題が発生します。
ファイル システムのアクセス権 および Celery を使用するバックグラウンド タスク も確認してください。
Web サーバーの実行¶
Weblate の実行は、他の Django ベースのプログラムの実行と同じことです。通常 Django は uWSGI または fcgi として実行されます(次の Web サーバー例の確認)。
テスト目的での、Django に標準搭載された Web サーバーの使用方法:
weblate runserver
警告
このサーバーを本番環境では使用しないでください。セキュリティ監査や性能試験を受けていません。 runserver
の Django ドキュメントも確認してください。
ヒント
Django に標準搭載されたサーバーは開発専用であるため、DEBUG
が有効な場合にのみ静的ファイルが提供されます。本番環境で使用するには、NGINX および uWSGI の設定例、Apache の設定例、Apache と Gunicorn の設定例、および 静的ファイルの提供 の設定を確認してください。
静的ファイルの提供¶
バージョン 2.4 で変更: バージョン 2.4 以前では、Weblate が Django 静的ファイル フレームワークを適切に使用せず設定が難解でした。
Django は、静的ファイルを 1 つのディレクトリーに集約することが必要です。実現には、weblate collectstatic --noinput
を実行します。これにより、STATIC_ROOT
設定に指定したディレクトリに静的ファイルがコピーされます(デフォルトでは、 DATA_DIR
内の static
ディレクトリ)。
静的ファイルは、Web サーバーから直接提供することを推奨します。静的ファイルが必要なパス:
/static/
Weblate および管理インタフェースの静的ファイルの提供(
STATIC_ROOT
に設定済)。/media/
ユーザーメディアのアップロードに使用する(例: スクリーンショット)。
/favicon.ico
/static/favicon.ico
を提供するようにルールを書き直すことが必要。
コンテンツ セキュリティ ポリシー¶
Weblate のデフォルト設定では、weblate.middleware.SecurityMiddleware
ミドルウェアが有効となり、Content-Security-Policy
または X-XSS-Protection
などのセキュリティ関連の HTTP ヘッダーが設定されます。デフォルトでは、これらは Weblate の設定で動作するように設定されていますが、環境によっては変更が必要です。
NGINX および uWSGI の設定例¶
本番環境の WEB サーバーを実行するには、Weblate とセットでインストールされた wsgi ラッパーを使用します(virtual env の場合、~/weblate-env/lib/python3.7/site-packages/weblate/wsgi.py
としてインストールされる)。 Python 検索パスも virtualenv に設定することを忘れないでください(例: uWSGI で virtualenv = /home/user/weblate-env
の使用)。
次の設定では、NGINX WEB サーバーの下で Weblate を uWSGI として実行します。
NGINX の設定( weblate/examples/weblate.nginx.conf
に設定可能):
# This example assumes Weblate is installed in virtualenv in /home/weblate/weblate-env
# and DATA_DIR is set to /home/weblate/data, please adjust paths to match your setup.
server {
listen 80;
server_name weblate;
# Not used
root /var/www/html;
location ~ ^/favicon.ico$ {
# DATA_DIR/static/favicon.ico
alias /home/weblate/data/static/favicon.ico;
expires 30d;
}
location /static/ {
# DATA_DIR/static/
alias /home/weblate/data/static/;
expires 30d;
}
location /media/ {
# DATA_DIR/media/
alias /home/weblate/data/media/;
expires 30d;
}
location / {
include uwsgi_params;
# Needed for long running operations in admin interface
uwsgi_read_timeout 3600;
# Adjust based to uwsgi configuration:
uwsgi_pass unix:///run/uwsgi/app/weblate/socket;
# uwsgi_pass 127.0.0.1:8080;
}
}
uWSGI の設定( weblate/examples/weblate.uwsgi.ini
に設定可能)。
# This example assumes Weblate is installed in virtualenv in /home/weblate/weblate-env
# and DATA_DIR is set to /home/weblate/data, please adjust paths to match your setup.
[uwsgi]
plugins = python3
master = true
protocol = uwsgi
socket = 127.0.0.1:8080
wsgi-file = /home/weblate/weblate-env/lib/python3.7/site-packages/weblate/wsgi.py
# Add path to Weblate checkout if you did not install
# Weblate by pip
# python-path = /path/to/weblate
# In case you're using virtualenv uncomment this:
virtualenv = /home/weblate/weblate-env
# Needed for OAuth/OpenID
buffer-size = 8192
# Reload when consuming too much of memory
reload-on-rss = 250
# Increase number of workers for heavily loaded sites
workers = 8
# Enable threads for Sentry error submission
enable-threads = true
# Child processes do not need file descriptors
close-on-exec = true
# Avoid default 0000 umask
umask = 0022
# Run as weblate user
uid = weblate
gid = weblate
# Enable harakiri mode (kill requests after some time)
# harakiri = 3600
# harakiri-verbose = true
# Enable uWSGI stats server
# stats = :1717
# stats-http = true
# Do not log some errors caused by client disconnects
ignore-sigpipe = true
ignore-write-errors = true
disable-write-exception = true
Apache の設定例¶
Weblate で WSGI を使用する場合は、prefork MPM の使用を推奨します。
次は、Weblate を WSGI として実行する設定方法。mod_wsgi
を有効にすること(weblate/examples/apache.conf
にて設定可能):
#
# VirtualHost for Weblate
#
# This example assumes Weblate is installed in virtualenv in /home/weblate/weblate-env
# and DATA_DIR is set to /home/weblate/data, please adjust paths to match your setup.
#
<VirtualHost *:80>
ServerAdmin admin@weblate.example.org
ServerName weblate.example.org
# DATA_DIR/static/favicon.ico
Alias /favicon.ico /home/weblate/data/static/favicon.ico
# DATA_DIR/static/
Alias /static/ /home/weblate/data/static/
<Directory /home/weblate/data/static/>
Require all granted
</Directory>
# DATA_DIR/media/
Alias /media/ /home/weblate/data/media/
<Directory /home/weblate/data/media/>
Require all granted
</Directory>
# Path to your Weblate virtualenv
WSGIDaemonProcess weblate python-home=/home/weblate/weblate-env user=weblate
WSGIProcessGroup weblate
WSGIApplicationGroup %{GLOBAL}
WSGIScriptAlias / /home/weblate/weblate-env/lib/python3.7/site-packages/weblate/wsgi.py process-group=weblate request-timeout=600
WSGIPassAuthorization On
<Directory /home/weblate/weblate-env/lib/python3.7/site-packages/weblate/>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
</VirtualHost>
注釈
Weblate には Python3 が必要なので、modwsgi で Python 3 variant が実行されていることを確認してください。通常、libapache2-mod-wsgi-py3
のように、個別のパッケージとして入手できます。
Apache と Gunicorn の設定例¶
次の設定は、Gunicorn および Apache 2.4 で Weblate を実行する方法(weblate/examples/apache.gunicorn.conf
に設定可能):
#
# VirtualHost for Weblate using gunicorn on localhost:8000
#
# This example assumes Weblate is installed in virtualenv in /home/weblate/weblate-env
# and DATA_DIR is set to /home/weblate/data, please adjust paths to match your setup.
#
<VirtualHost *:443>
ServerAdmin admin@weblate.example.org
ServerName weblate.example.org
# DATA_DIR/static/favicon.ico
Alias /favicon.ico /home/weblate/data/static/favicon.ico
# DATA_DIR/static/
Alias /static/ /home/weblate/data/static/
<Directory /home/weblate/data/static/>
Require all granted
</Directory>
# DATA_DIR/media/
Alias /media/ /home/weblate/data/media/
<Directory /home/weblate/data/media/>
Require all granted
</Directory>
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/https_cert.cert
SSLCertificateKeyFile /etc/apache2/ssl/https_key.pem
SSLProxyEngine On
ProxyPass /favicon.ico !
ProxyPass /static/ !
ProxyPass /media/ !
ProxyPass / http://localhost:8000/
ProxyPassReverse / http://localhost:8000/
ProxyPreserveHost On
</VirtualHost>
パスの下での Weblate の実行¶
バージョン 1.3 で追加.
Weblate で WSGI を使用する場合は、prefork MPM の使用を推奨します。
Weblate を /weblate
配下で実行する Apache の設定例。再び `` mod_wsgi`` の使用(weblate/examples/apache-path.conf
でも設定可能):
#
# VirtualHost for Weblate, running under /weblate path
#
# This example assumes Weblate is installed in virtualenv in /home/weblate/weblate-env
# and DATA_DIR is set to /home/weblate/data, please adjust paths to match your setup.
#
<VirtualHost *:80>
ServerAdmin admin@weblate.example.org
ServerName weblate.example.org
# DATA_DIR/static/favicon.ico
Alias /weblate/favicon.ico /home/weblate/data/static/favicon.ico
# DATA_DIR/static/
Alias /weblate/static/ /home/weblate/data/static/
<Directory /home/weblate/data/static/>
Require all granted
</Directory>
# DATA_DIR/media/
Alias /weblate/media/ /home/weblate/data/media/
<Directory /home/weblate/data/media/>
Require all granted
</Directory>
# Path to your Weblate virtualenv
WSGIDaemonProcess weblate python-home=/home/weblate/weblate-env user=weblate
WSGIProcessGroup weblate
WSGIApplicationGroup %{GLOBAL}
WSGIScriptAlias /weblate /home/weblate/weblate-env/lib/python3.7/site-packages/weblate/wsgi.py process-group=weblate request-timeout=600
WSGIPassAuthorization On
<Directory /home/weblate/weblate-env/lib/python3.7/site-packages/weblate/>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
</VirtualHost>
さらに、weblate/settings.py
の変更が必要です。
URL_PREFIX = "/weblate"
Celery を使用するバックグラウンド タスク¶
バージョン 3.2 で追加.
Weblate は Celery を使ってバックグラウンド タスクを処理します。Redis をバックエンドとして使用する一般的な設定例:
CELERY_TASK_ALWAYS_EAGER = False
CELERY_BROKER_URL = "redis://localhost:6379"
CELERY_RESULT_BACKEND = CELERY_BROKER_URL
開発で使用できる、すべてのタスクを適切に処理する Eager の設定例。Weblate の性能に影響を与えます:
CELERY_TASK_ALWAYS_EAGER = True
CELERY_BROKER_URL = "memory://"
CELERY_TASK_EAGER_PROPAGATES = True
また、Celery ワーカーを起動してタスクを処理し、スケジュールしたタスクを開始することが必要です。コマンド ラインから直接実行する方法(これはデバッグや開発の際に便利です):
./weblate/examples/celery start
./weblate/examples/celery stop
注釈
Celery プロセスは、WSGI プロセスと同じユーザーとして実行することが必要です。異なると、DATA_DIR
内のファイルの所有権は混在した状態で保存され、実行時に問題が発生します。
ファイル システムのアクセス権 および 実行サーバー も確認してください。
システム サービスとして実行する Celery¶
多くの場合、Celery をデーモンとして実行しますが、これは Daemonization でカバーされます。systemd を使用した最も一般的な Linux の設定では、次に示す examples
フォルダに付属のサンプル ファイルを使用できます。
/etc/systemd/system/celery-weblate.service
に記述する Systemd ユニットの設定方法:
[Unit]
Description=Celery Service (Weblate)
After=network.target
[Service]
Type=forking
User=weblate
Group=weblate
EnvironmentFile=/etc/default/celery-weblate
WorkingDirectory=/home/weblate
RuntimeDirectory=celery
RuntimeDirectoryPreserve=restart
LogsDirectory=celery
ExecStart=/bin/sh -c '${CELERY_BIN} multi start ${CELERYD_NODES} \
-A ${CELERY_APP} --pidfile=${CELERYD_PID_FILE} \
--logfile=${CELERYD_LOG_FILE} --loglevel=${CELERYD_LOG_LEVEL} ${CELERYD_OPTS}'
ExecStop=/bin/sh -c '${CELERY_BIN} multi stopwait ${CELERYD_NODES} \
--pidfile=${CELERYD_PID_FILE}'
ExecReload=/bin/sh -c '${CELERY_BIN} multi restart ${CELERYD_NODES} \
-A ${CELERY_APP} --pidfile=${CELERYD_PID_FILE} \
--logfile=${CELERYD_LOG_FILE} --loglevel=${CELERYD_LOG_LEVEL} ${CELERYD_OPTS}'
[Install]
WantedBy=multi-user.target
/etc/default/celery-weblate
に記述する環境の設定方法:
# Name of nodes to start
CELERYD_NODES="celery notify memory backup translate"
# Absolute or relative path to the 'celery' command:
CELERY_BIN="/home/weblate/weblate-env/bin/celery"
# App instance to use
# comment out this line if you don't use an app
CELERY_APP="weblate.utils"
# Extra command-line arguments to the worker,
# increase concurency if you get weblate.E019
CELERYD_OPTS="--beat:celery --queues:celery=celery --prefetch-multiplier:celery=4 \
--queues:notify=notify --prefetch-multiplier:notify=10 \
--queues:memory=memory --prefetch-multiplier:memory=10 \
--queues:translate=translate --prefetch-multiplier:translate=4 \
--concurrency:backup=1 --queues:backup=backup --prefetch-multiplier:backup=2"
# Logging configuration
# - %n will be replaced with the first part of the nodename.
# - %I will be replaced with the current child process index
# and is important when using the prefork pool to avoid race conditions.
CELERYD_PID_FILE="/run/celery/weblate-%n.pid"
CELERYD_LOG_FILE="/var/log/celery/weblate-%n%I.log"
CELERYD_LOG_LEVEL="INFO"
# Internal Weblate variable to indicate we're running inside Celery
CELERY_WORKER_RUNNING="1"
/etc/logrotate.d/celery
にある Celery ログを logrotate を使用してローテーションするための追加の設定方法:
/var/log/celery/*.log {
weekly
missingok
rotate 12
compress
notifempty
}
Celery beat を使用した定期的なタスク¶
Weblate には、スケジュール済みのタスク用の設定が標準搭載されています。または、settings.py
で追加のタスクを設定できます。Lazy commits の例を確認してください。
タスクは Celery beats デーモンによって実行されることになっています。正常に動作していない場合は、実行していないか、データベースが破損していることがあります。このような場合は、Celery の起動ログを調べて、根本的な原因を突き止めます。
Celery の状態の監視¶
celery_queues
を使用して、Celery タスク キューの現在の長さを確認できます。キューが長くなりすぎると、管理インターフェイスでも設定エラーが発生します。
警告
デフォルトでは、Celery エラーは Celery ログにのみ記録され、ユーザーには表示されません。このような障害の概要を知りたいときは、エラー レポートの収集 の設定を推奨します。
Weblate の監視¶
Weblate は、例えば Kubernetes を使った簡単な健全性診断で使用する /healthz/
URLを提供します。
エラー レポートの収集¶
Weblate は、他のソフトウェアと同じように失敗することがあります。有用な障害状態を収集するには、サードパーティのサービスを使用して、そのような情報を収集することを推奨します。これは、Celery タスクが失敗した場合にとても便利です。失敗した場合、ログにエラーが報告されるだけで、ログには通知されません。Weblate が対応するサービス:
Sentry¶
Weblate には`Sentry <https://sentry.io/>`_ への対応が標準搭載されています。使用するには、 settings.py
に SENTRY_DSN
だけを設定すれば十分です。
SENTRY_DSN = "https://id@your.sentry.example.com/"
Rollbar¶
Weblate には Rollbar への対応が標準搭載されています。使用方法は、 Rollbar notifier for Python の指示に従うだけです。
つまり、settings.py
に設定が必要:
# Add rollbar as last middleware:
MIDDLEWARE = [
# … other middleware classes …
"rollbar.contrib.django.middleware.RollbarNotifierMiddleware",
]
# Configure client access
ROLLBAR = {
"access_token": "POST_SERVER_ITEM_ACCESS_TOKEN",
"client_token": "POST_CLIENT_ITEM_ACCESS_TOKEN",
"environment": "development" if DEBUG else "production",
"branch": "main",
"root": "/absolute/path/to/code/root",
}
他のすべてが自動的に統合して、サーバー側とクライアント側の両方のエラーを収集します。
Weblate を別のサーバーに移行¶
Weblate を別のサーバーに移行するのは非常に簡単ですが、慎重に移行することが必要な少数の場所にデータが保存されています。最適な方法は、移行のために Weblate を停止することです。
データベースの移行¶
データベースのバックエンドによっては、データベースを移行するオプションが複数あります。最も簡単な方法は、1 つのサーバーにデータベースをダンプし、新しいサーバーにインポートすることです。データベースがレプリケーションに対応している場合は、レプリケーションを使用できます。
最良の方法は、データベースの標準機能を使用することです。これらは通常、最も効果的です(例: mysqldump`もしくは :command:`pg_dump)。異なるデータベース間で移行する場合の、Django 管理を使用してデータベースのダンプとインポートを行う唯一の方法:
# Export current data
weblate dumpdata > /tmp/weblate.dump
# Import dump
weblate loaddata /tmp/weblate.dump
その他の注意事項¶
Redis や Cron ジョブ、カスタム認証バックエンドなど、Weblate が使用していた可能性のある他のサービスの移動を忘れないでください。
Weblate の設置¶
Weblate はクラウドに簡単にインストールできます。使用するプラットフォームの詳細なガイドを参照する:
サード パーティの Weblate の設置¶
注釈
以下の設置は、Weblate チームが開発またはサポートをしていません。セットアップの一部は、このドキュメントで説明されている内容とは異なることがあります。
Bitnami Weblate スタック¶
Bitnami は、<https://bitnami.com/stack/weblate> の多くのプラットフォームに Weblate スタックを提供しています。インストール中に設定を調整します。詳細は <https://bitnami.com/stack/weblate/README.txt> を確認してください。
Weblate Cloudron パッケージ¶
Cloudron は、自己ホスト用 Web アプリケーション用のプラットフォームです。Cloudron と同時にインストールされる Weblate は自動的に最新の状態に保たれます。このパッケージは Cloudron チームの Weblate package repo で管理されています。

YunoHost の Weblate¶
自己ホスト用プロジェクト YunoHost は Weblate 用のパッケージを提供しています。YunoHost をインストールしたら、他のアプリケーションと同じように Webrate をインストールできます。バックアップと復元を備えた完全に動作するスタックを提供しますが、用途に合わせて設定ファイルを編集することが必要です。
管理画面を使用するか、このボタンの使用(サーバーに移動):

コマンドライン インターフェイスの使用も可能:
yunohost app install https://github.com/YunoHost-Apps/weblate_ynh
Weblate のアップグレード¶
Docker イメージのアップグレード¶
公式の Docker イメージ(参照: Docker を使用したインストール)には、すべてのアップグレードの方法が統合されています。最新バージョンを入手する以外に必要な操作はありません。
一般的なアップグレード方法¶
アップグレードをする前に、現在の ソフトウェア要件 を確認してください。変更があるかもしれません。すべての要件がインストールまたは更新されたあと、設定の変更に合わせて settings.py
を設定してください(正しい値については settings_example.py
を確認してください)。
Always check Version specific instructions before upgrade. In case you are skipping some versions, please follow instructions for all versions you are skipping in the upgrade. Sometimes it's better to upgrade to some intermediate version to ensure a smooth migration. Upgrading across multiple releases should work, but is not as well tested as single version upgrades.
注釈
It is recommended to perform a full database backup prior to upgrade so that you can roll back the database in case upgrade fails, see Weblate のバックアップと移動.
Stop wsgi and Celery processes. The upgrade can perform incompatible changes in the database, so it is always safer to avoid old processes running while upgrading.
Upgrade Weblate code.
For pip installs it can be achieved by:
pip install -U Weblate
With Git checkout you need to fetch new source code and update your installation:
cd weblate-src git pull # Update Weblate inside your virtualenv . ~/weblate-env/bin/pip install -e . # Install dependencies directly when not using virtualenv pip install --upgrade -r requirements.txt
Upgrade configuration file, refer to
settings_example.py
or Version specific instructions for needed steps.Upgrade database structure:
weblate migrate --noinput
Collect updated static files (see 実行サーバー and 静的ファイルの提供):
weblate collectstatic --noinput
Compress JavaScript and CSS files (optional, see クライアント アセットの圧縮):
weblate compress
Git のバージョンを実行している場合は、アップグレードするたびに言語ファイルを再生成することが必要です。これを実行するメソッドの呼び出し:
weblate compilemessages
Verify that your setup is sane (see also 本番環境の設定):
weblate check --deploy
Restart celery worker (see Celery を使用するバックグラウンド タスク).
Version specific instructions¶
Upgrade from 2.x¶
If you are upgrading from 2.x release, always first upgrade to 3.0.1 and then continue upgrading in the 3.x series. Upgrades skipping this step are not supported and will break.
Upgrade from 3.x¶
If you are upgrading from 3.x release, always first upgrade to 4.0.4 or 4.1.1 and then continue upgrading in the 4.x series. Upgrades skipping this step are not supported and will break.
Upgrade from 4.0 to 4.1¶
Please follow 一般的なアップグレード方法 in order to perform update.
Notable configuration or dependencies changes:
There are several changes in
settings_example.py
, most notable middleware changes, please adjust your settings accordingly.There are new file formats, you might want to include them in case you modified the
WEBLATE_FORMATS
.There are new quality checks, you might want to include them in case you modified the
CHECK_LIST
.DEFAULT_THROTTLE_CLASSES
の設定を変更し、API で接続制限のレポート作成を可能とした。There are some new and updated requirements.
There is a change in
INSTALLED_APPS
.The DeepL machine translation now defaults to v2 API, you might need to adjust
MT_DEEPL_API_VERSION
in case your current DeepL subscription does not support that.
Upgrade from 4.1 to 4.2¶
Please follow 一般的なアップグレード方法 in order to perform update.
Notable configuration or dependencies changes:
Upgrade from 3.x releases is not longer supported, please upgrade to 4.0 or 4.1 first.
There are some new and updated requirements.
There are several changes in
settings_example.py
, most notable new middleware and changed application ordering.The keys for JSON based formats no longer include leading dot. The strings are adjusted during the database migration, but external components might need adjustment in case you rely on keys in exports or API.
The Celery configuration was changed to no longer use
memory
queue. Please adjust your startup scripts andCELERY_TASK_ROUTES
setting.The Weblate domain is now configured in the settings, see
SITE_DOMAIN
(orWEBLATE_SITE_DOMAIN
). You will have to configure it before running Weblate.The username and email fields on user database now should be case insensitive unique. It was mistakenly not enforced with PostgreSQL.
Upgrade from 4.2 to 4.3¶
Please follow 一般的なアップグレード方法 in order to perform update.
Notable configuration or dependencies changes:
There are some changes in quality checks, you might want to include them in case you modified the
CHECK_LIST
.The source language attribute was moved from project to a component what is exposed in the API. You will need to update Weblate クライアント in case you are using it.
The database migration to 4.3 might take long depending on number of strings you are translating (expect around one hour of migration time per 100,000 source strings).
There is a change in
INSTALLED_APPS
.There is a new setting
SESSION_COOKIE_AGE_AUTHENTICATED
which complementsSESSION_COOKIE_AGE
.In case you were using hub or lab to integrate with GitHub or GitLab, you will need to reconfigure this, see
GITHUB_CREDENTIALS
andGITLAB_CREDENTIALS
.
-
バージョン 4.3.1 で変更:
The Celery configuration was changed to add
memory
queue. Please adjust your startup scripts andCELERY_TASK_ROUTES
setting.
-
バージョン 4.3.2 で変更:
The
post_update
method of addons now takes extraskip_push
parameter.
Upgrade from 4.3 to 4.4¶
Please follow 一般的なアップグレード方法 in order to perform update.
Notable configuration or dependencies changes:
There is a change in
INSTALLED_APPS
,weblate.configuration
has to be added there.Django 3.1 is now required.
In case you are using MySQL or MariaDB, the minimal required versions have increased, see MySQL と MariaDB.
-
バージョン 4.4.1 で変更:
Monolingual gettext now uses both
msgid
andmsgctxt
when present. This will change identification of translation strings in such files breaking links to Weblate extended data such as screenshots or review states. Please make sure you commit pending changes in such files prior upgrading and it is recommeded to force loading of affected component usingloadpo
.Increased minimal required version of translate-toolkit to address several file format issues.
Upgrade from 4.4 to 4.5¶
Please follow 一般的なアップグレード方法 in order to perform update.
Notable configuration or dependencies changes:
The migration might take considerable time if you had big glossaries.
Glossaries are now stored as regular components.
The glossary API is removed, use regular translation API to access glossaries.
There is a change in
INSTALLED_APPS
-weblate.metrics
should be added.
-
バージョン 4.5.1 で変更:
There is a new dependency on the pyahocorasick module.
Upgrade from 4.5 to 4.6¶
Please follow 一般的なアップグレード方法 in order to perform update.
Notable configuration or dependencies changes:
There are new file formats, you might want to include them in case you modified the
WEBLATE_FORMATS
.コンポーネントを作成するための API は、自動的に Weblate の内部 URL を使用するようになりました。参照:
POST /api/projects/(string:project)/components/
。There is a change in dependencies and
PASSWORD_HASHERS
to prefer Argon2 for passwords hashing.
Upgrading from Python 2 to Python 3¶
Weblate no longer supports Python older than 3.5. In case you are still running on older version, please perform migration to Python 3 first on existing version and upgrade later. See Upgrading from Python 2 to Python 3 in the Weblate 3.11.1 documentation.
Migrating from other databases to PostgreSQL¶
If you are running Weblate on other dabatase than PostgreSQL, you should migrate to PostgreSQL as that will be the only supported database backend in the 4.0 release. The following steps will guide you in migrating your data between the databases. Please remember to stop both web and Celery servers prior to the migration, otherwise you might end up with inconsistent data.
PostgreSQL でデータベースの作成¶
通常は、データベースを分けて Weblate を実行することを推奨します。ユーザー アカウントも分ける:
# If PostgreSQL was not installed before, set the main password
sudo -u postgres psql postgres -c "\password postgres"
# Create a database user called "weblate"
sudo -u postgres createuser -D -P weblate
# Create the database "weblate" owned by "weblate"
sudo -u postgres createdb -O weblate weblate
Migrating using Django JSON dumps¶
The simplest approach for migration is to utilize Django JSON dumps. This works well for smaller installations. On bigger sites you might want to use pgloader instead, see Migrating to PostgreSQL using pgloader.
Add PostgreSQL as additional database connection to the
settings.py
:
DATABASES = {
"default": {
# Database engine
"ENGINE": "django.db.backends.mysql",
# Database name
"NAME": "weblate",
# Database user
"USER": "weblate",
# Database password
"PASSWORD": "password",
# Set to empty string for localhost
"HOST": "database.example.com",
# Set to empty string for default
"PORT": "",
# Additional database options
"OPTIONS": {
# In case of using an older MySQL server, which has MyISAM as a default storage
# 'init_command': 'SET storage_engine=INNODB',
# Uncomment for MySQL older than 5.7:
# 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
# If your server supports it, see the Unicode issues above
"charset": "utf8mb4",
# Change connection timeout in case you get MySQL gone away error:
"connect_timeout": 28800,
},
},
"postgresql": {
# Database engine
"ENGINE": "django.db.backends.postgresql",
# Database name
"NAME": "weblate",
# Database user
"USER": "weblate",
# Database password
"PASSWORD": "password",
# Set to empty string for localhost
"HOST": "database.example.com",
# Set to empty string for default
"PORT": "",
},
}
Run migrations and drop any data inserted into the tables:
weblate migrate --database=postgresql
weblate sqlflush --database=postgresql | weblate dbshell --database=postgresql
Dump legacy database and import to PostgreSQL
weblate dumpdata --all --output weblate.json
weblate loaddata weblate.json --database=postgresql
Adjust
DATABASES
to use just PostgreSQL database as default, remove legacy connection.
Weblate should be now ready to run from the PostgreSQL database.
Migrating to PostgreSQL using pgloader¶
The pgloader is a generic migration tool to migrate data to PostgreSQL. You can use it to migrate Weblate database.
Adjust your
settings.py
to use PostgreSQL as a database.Migrate the schema in the PostgreSQL database:
weblate migrate weblate sqlflush | weblate dbshell
Run the pgloader to transfer the data. The following script can be used to migrate the database, but you might want to learn more about pgloader to understand what it does and tweak it to match your setup:
LOAD DATABASE FROM mysql://weblate:password@localhost/weblate INTO postgresql://weblate:password@localhost/weblate WITH include no drop, truncate, create no tables, create no indexes, no foreign keys, disable triggers, reset sequences, data only ALTER SCHEMA 'weblate' RENAME TO 'public' ;
Migrating from Pootle¶
As Weblate was originally written as replacement from Pootle, it is supported
to migrate user accounts from Pootle. You can dump the users from Pootle and
import them using importusers
.
Weblate のバックアップと移動¶
BorgBackup を使用した自動バックアップ¶
バージョン 3.9 で追加.
Weblate は BorgBackup を使用して、サービスでバックアップの作成をする機能を標準搭載しています。Borg はスペース効率の高い暗号化されたバックアップを作成し、クラウドに安全に保存します。バックアップは、管理画面の バックアップ タブからコントロールします。
バージョン 4.4.1 で変更: PostgreSQL と MySQL/MariaDB の両方のデータベースには、自動バックアップが含まれています。
Borg を使用したバックアップは増分バックアップです。 Webrate に設定された常に実施されるバックアップ:
日次バックアップ、過去 14 日分
週次バックアップ、過去 6 週分
月次バックアップ、過去 6 か月分

Borg 暗号鍵¶
BorgBackup は暗号化したバックアップを作成するので、パスフレーズがないと復元できません。パスフレーズは、新しいバックアップ サービスを追加するときに生成されるので、コピーして安全な場所に保管しておくことが必要です。
Weblate 専用のバックアップ ストレージ を使用している場合は、バックアップに接続するための SSH 秘密鍵もバックアップしてください。
参考
Weblate 専用のバックアップ ストレージ¶
Weblate のインスタンスをバックアップする最も簡単な方法は、`backup service at weblate.org `_ を購入することです。導入方法:
https://weblate.org/support/#backup から バックアップ サービス を購入する。
取得したキーを管理画面から入力する。参照: サポートの統合。
Weblate はクラウド サービスに接続し、バックアップのための接続情報を取得する。
バックアップ タブから、新しいバックアップの設定を有効にする。
Borg 資格情報をバックアップして、バックアップを復元できるようにします。参照: Borg 暗号鍵。
ヒント
手動ですべてを有効にすることが必要なのは、安全のためです。ユーザーの同意がなければ、登録の過程で取得したデータはバックアップ リポジトリに送信しません。
独自のバックアップ ストレージの使用¶
バックアップには、独自のストレージも使用できます。SSH を使用してリモート接続先にバックアップを保存できます。対象のサーバーには BorgBackup のインストールが必要です。
参考
Borgドキュメント項目 General
ローカル ファイルシステム¶
It is recommended to specify the absolute path for the local backup, for example /path/to/backup. The directory has to be writable by the user running Weblate (see ファイル システムのアクセス権). If it doesn't exist, Weblate attempts to create it but needs the appropriate permissions to do so.
ヒント
When running Weblate in Docker, please ensure the backup location is exposed as a volume from the Weblate container. Otherwise the backups will be discarded by Docker upon restarting the container it is in.
One option is to place backups into an existing volume, for example
/app/data/borgbackup
. This is an existing volume in the container.
You can also add a new container for the backups in the Docker Compose file
for example by using /borgbackup
:
services:
weblate:
volumes:
- /home/weblate/data:/app/data
- /home/weblate/borgbackup:/borgbackup
The directory where backups will be stored have to be owned by UID 1000, otherwise Weblate won’t be able to write the backups there.
リモート バックアップ¶
In order to create the remote backups, you will have to install BorgBackup onto another server that’s accessible via SSH. Make sure that it accepts the Weblate's client SSH key, i.e. the one it uses to connect to other servers.
ヒント
Weblate 専用のバックアップ ストレージ provides you automated remote backups.
Restoring from BorgBackup¶
Restore access to your backup repository and prepare your backup passphrase.
List all the backups on the server using
borg list REPOSITORY
.Restore the desired backup to the current directory using
borg extract REPOSITORY::ARCHIVE
.Restore the database from the SQL dump placed in the
backup
directory in the Weblate data dir (see Dumped data for backups).Copy the Weblate configuration (
backups/settings.py
, see Dumped data for backups) to the correct location, see 詳細設定.Copy the whole restored data dir to the location configured by
DATA_DIR
.
The Borg session might look like this:
$ borg list /tmp/xxx
Enter passphrase for key /tmp/xxx:
2019-09-26T14:56:08 Thu, 2019-09-26 14:56:08 [de0e0f13643635d5090e9896bdaceb92a023050749ad3f3350e788f1a65576a5]
$ borg extract /tmp/xxx::2019-09-26T14:56:08
Enter passphrase for key /tmp/xxx:
Manual backup¶
Depending on what you want to save, back up the type of data Weblate stores in each respective place.
ヒント
If you are doing the manual backups, you might want to
silence Weblate's warning about a lack of backups by adding weblate.I028
to
SILENCED_SYSTEM_CHECKS
in settings.py
or
WEBLATE_SILENCED_SYSTEM_CHECKS
for Docker.
SILENCED_SYSTEM_CHECKS.append("weblate.I028")
Database¶
The actual storage location depends on your database setup.
ヒント
The database is the most important storage. Set up regular backups of your database. Without the database, all the translations are gone.
Native database backup¶
The recommended approach is to save a dump of the database using database-native tools such as pg_dump or mysqldump. It usually performs better than Django backup, and it restores complete tables with all their data.
You can restore this backup in a newer Weblate release, it will perform all the
necessary migrations when running in migrate
. Please consult
Weblate のアップグレード on more detailed info on how to upgrade between versions.
Django バックアップ データベース¶
Alternatively, you can back up your database using Django's dumpdata
command. That way the backup is database agnostic and can be used in case you
want to change the database backend.
Prior to restoring the database you need to be running exactly the same Weblate
version the backup was made on. This is necessary as the database structure does
change between releases and you would end up corrupting the data in some way.
After installing the same version, run all database migrations using
migrate
.
Afterwards some entries will already be created in the database and you will have them in the database backup as well. The recommended approach is to delete such entries manually using the management shell (see Invoking management commands):
weblate shell
>>> from weblate.auth.models import User
>>> User.objects.get(username='anonymous').delete()
ファイル¶
If you have enough backup space, simply back up the whole DATA_DIR
. This
is a safe bet even if it includes some files you don't want.
The following sections describe what you should back up and what you
can skip in detail.
Dumped data for backups¶
Stored in DATA_DIR
/backups
.
Weblate dumps various data here, and you can include these files for more complete backups. The files are updated daily (requires a running Celery beats server, see Celery を使用するバックグラウンド タスク). Currently, this includes:
Weblate settings as
settings.py
(there is also expanded version insettings-expanded.py
).PostgreSQL database backup as
database.sql
.
The database backups are saved as plain text by default, but they can also be compressed
or entirely skipped using DATABASE_BACKUP
.
Version control repositories¶
Stored in DATA_DIR
/vcs
.
The version control repositories contain a copy of your upstream repositories with Weblate changes. If you have Push on commit enabled for all your translation components, all Weblate changes are included upstream. No need to back up the repositories on the Weblate side as they can be cloned again from the upstream location(s) with no data loss.
SSH and GPG keys¶
Stored in DATA_DIR
/ssh
and DATA_DIR
/home
.
If you are using SSH or GPG keys generated by Weblate, you should back up these locations. Otherwise you will lose the private keys and you will have to regenerate new ones.
User uploaded files¶
Stored in DATA_DIR
/media
.
ユーザーがアップロードしたすべてのファイルのバックアップが必要です(例: Visual context for strings)。
Celery tasks¶
The Celery task queue might contain some info, but is usually not needed for a backup. At most you will lose updates not yet been processed to translation memory. It is recommended to perform the fulltext or repository update upon restoration anyhow, so there is no problem in losing these.
Command line for manual backup¶
Using a cron job, you can set up a Bash command to be executed on a daily basis, for example:
$ XZ_OPT="-9" tar -Jcf ~/backup/weblate-backup-$(date -u +%Y-%m-%d_%H%M%S).xz backups vcs ssh home media fonts secret
The string between the quotes after XZ_OPT allows you to choose your xz options, for instance the amount of memory used for compression; see https://linux.die.net/man/1/xz
You can adjust the list of folders and files to your needs. To avoid saving the translation memory (in backups folder), you can use:
$ XZ_OPT="-9" tar -Jcf ~/backup/weblate-backup-$(date -u +%Y-%m-%d_%H%M%S).xz backups/database.sql backups/settings.py vcs ssh home media fonts secret
Restoring manual backup¶
Restore all data you have backed up.
Update all repositories using
updategit
.weblate updategit --all
Moving a Weblate installation¶
Relocate your installation to a different system by following the backing up and restoration instructions above.
認証¶
ユーザー登録¶
Weblate のデフォルトの設定では、新規ユーザーの登録を処理するために Web サイト上のフォームである python-social-auth を使用します。メールを確認すると、新規ユーザーはサード パーティのサービスを利用して投稿したり承認したりできます。
新規ユーザの登録は、REGISTRATION_OPEN
を使用して無効にもできます。
認証の試行は、接続制限 の対象です。
認証バックエンド¶
Django に標準搭載されているソリューションは、認証のためのさまざまなソーシャル オプションを含む認証に使用されます。これを使用すると、他の Django ベースのプロジェクト(参照: Migrating from Pootle)のユーザ データベースをインポートできます。
Django は他の手段からも認証できるように設定できます。
参考
Authentication settings で、 Docker の公式イメージで認証を設定する方法を説明します。
パスワード認証¶
デフォルトの settings.py
に付属する AUTH_PASSWORD_VALIDATORS
の効果的な検査項目:
パスワードが、他の個人情報と酷似していないこと。
パスワードが、10 文字以上であること。
パスワードが、一般的なパスワードではないこと。
パスワードが、数字だけで構成されていないこと。
パスワードが、単一の文字または半角スペースのみで構成されていないこと。
パスワードが、過去に登録されていないこと。
この設定は、パスワード ポリシーに合わせてカスタマイズできます。
さらに django-zxcvbn-password もインストールできます。これは、入力されたパスワードの難易度をかなり正確に計算できるので、一定のしきい値以下のパスワードを拒否することができます。
SAML 認証¶
バージョン 4.1.1 で追加.
設定については、Python Social Auth の手順に従ってください。注意が必要な違い:
Weblate は、シングルサインオンの IDP に対応しているので、SOCIAL_AUTH_SAML_ENABLED_IDPS から weblate を呼び出すことが必要。
SAML の XML メタデータの URL は、
/accounts/metadata/saml/
。自動的に入力される設定項目:
SOCIAL_AUTH_SAML_SP_ENTITY_ID
,SOCIAL_AUTH_SAML_TECHNICAL_CONTACT
,SOCIAL_AUTH_SAML_SUPPORT_CONTACT
設定例:
# Authentication configuration
AUTHENTICATION_BACKENDS = (
"social_core.backends.email.EmailAuth",
"social_core.backends.saml.SAMLAuth",
"weblate.accounts.auth.WeblateUserBackend",
)
# Social auth backends setup
SOCIAL_AUTH_SAML_SP_PUBLIC_CERT = "-----BEGIN CERTIFICATE-----"
SOCIAL_AUTH_SAML_SP_PRIVATE_KEY = "-----BEGIN PRIVATE KEY-----"
SOCIAL_AUTH_SAML_ENABLED_IDPS = {
"weblate": {
"entity_id": "https://idp.testshib.org/idp/shibboleth",
"url": "https://idp.testshib.org/idp/profile/SAML2/Redirect/SSO",
"x509cert": "MIIEDjCCAvagAwIBAgIBADA ... 8Bbnl+ev0peYzxFyF5sQA==",
"attr_name": "full_name",
"attr_username": "username",
"attr_email": "email",
}
}
LDAP 認証¶
LDAP認証は、django-auth-ldap パッケージを使用することが最適です。通常のインストール方法:
# Using PyPI
pip install django-auth-ldap>=1.3.0
# Using apt-get
apt-get install python-django-auth-ldap
警告
django-auth-ldap が 1.3.0 より古い場合は、新しく作成したユーザーに対して 自動的なグループの割り当て は正常に動作しません。
注釈
Python LDAP 3.1.0 モジュールは一部に互換性がなく、そのバージョンは使用できないことがあります。エラー AttributeError: 'module' object has no attribute '_trace_level' が発生した場合は、python-ldap を 3.0.0 にダウングレードしてみてください。
パッケージのインストール後に、Django 認証にフックする方法:
# Add LDAP backed, keep Django one if you want to be able to sign in
# even without LDAP for admin account
AUTHENTICATION_BACKENDS = (
"django_auth_ldap.backend.LDAPBackend",
"weblate.accounts.auth.WeblateUserBackend",
)
# LDAP server address
AUTH_LDAP_SERVER_URI = "ldaps://ldap.example.net"
# DN to use for authentication
AUTH_LDAP_USER_DN_TEMPLATE = "cn=%(user)s,o=Example"
# Depending on your LDAP server, you might use a different DN
# like:
# AUTH_LDAP_USER_DN_TEMPLATE = 'ou=users,dc=example,dc=com'
# List of attributes to import from LDAP upon sign in
# Weblate stores full name of the user in the full_name attribute
AUTH_LDAP_USER_ATTR_MAP = {
"full_name": "name",
# Use the following if your LDAP server does not have full name
# Weblate will merge them later
# 'first_name': 'givenName',
# 'last_name': 'sn',
# Email is required for Weblate (used in VCS commits)
"email": "mail",
}
# Hide the registration form
REGISTRATION_OPEN = False
注釈
AUTHENTICATION_BACKENDS
の設定から 'social_core.backends.email.EmailAuth'
を削除することが必要です。そうしないと、ユーザーは Weblate でパスワードを設定して使用すると認証できてしまいます。匿名ユーザーが簡単にログインできるアクセス権を作成するには、'weblate.accounts.auth.WeblateUserBackend'
の設定を維持することが必要です。ローカル管理者アカウントが作成されている場合は、ローカル管理者アカウントを使用してサインインすることもできます(例: createadmin
)。
バインド パスワードの使用¶
認証に直接バインドを使用できない場合は、検索を使用し、検索にバインドするユーザーを指定してください。設定例:
import ldap
from django_auth_ldap.config import LDAPSearch
AUTH_LDAP_BIND_DN = ""
AUTH_LDAP_BIND_PASSWORD = ""
AUTH_LDAP_USER_SEARCH = LDAPSearch(
"ou=users,dc=example,dc=com", ldap.SCOPE_SUBTREE, "(uid=%(user)s)"
)
Active Directory の統合¶
import ldap
from django_auth_ldap.config import LDAPSearch, NestedActiveDirectoryGroupType
AUTH_LDAP_BIND_DN = "CN=ldap,CN=Users,DC=example,DC=com"
AUTH_LDAP_BIND_PASSWORD = "password"
# User and group search objects and types
AUTH_LDAP_USER_SEARCH = LDAPSearch(
"CN=Users,DC=example,DC=com", ldap.SCOPE_SUBTREE, "(sAMAccountName=%(user)s)"
)
# Make selected group a superuser in Weblate
AUTH_LDAP_USER_FLAGS_BY_GROUP = {
# is_superuser means user has all permissions
"is_superuser": "CN=weblate_AdminUsers,OU=Groups,DC=example,DC=com",
}
# Map groups from AD to Weblate
AUTH_LDAP_GROUP_SEARCH = LDAPSearch(
"OU=Groups,DC=example,DC=com", ldap.SCOPE_SUBTREE, "(objectClass=group)"
)
AUTH_LDAP_GROUP_TYPE = NestedActiveDirectoryGroupType()
AUTH_LDAP_FIND_GROUP_PERMS = True
# Optionally enable group mirroring from LDAP to Weblate
# AUTH_LDAP_MIRROR_GROUPS = True
CAS 認証¶
CAS 認証は、django-cas-ng などのパッケージを使用して実行できます。
ステップ 1、CAS 経由でユーザーのメールアドレスの入力フィールドを表示させます。これは、CAS サーバー自体に設定することが必要です。、CAS v 1 は属性に一切対応していないため、少なくとも CAS v 2 の実行が必要です。
ステップ 2、Weblate を更新して CAS サーバーと属性を使用します。
django-cas-ng のインストール方法:
pip install django-cas-ng
パッケージをインストールした後に、settings.py
ファイルを変更して Django 認証システムに接続する設定方法:
# Add CAS backed, keep the Django one if you want to be able to sign in
# even without LDAP for the admin account
AUTHENTICATION_BACKENDS = (
"django_cas_ng.backends.CASBackend",
"weblate.accounts.auth.WeblateUserBackend",
)
# CAS server address
CAS_SERVER_URL = "https://cas.example.net/cas/"
# Add django_cas_ng somewhere in the list of INSTALLED_APPS
INSTALLED_APPS = (..., "django_cas_ng")
最後に、signal を使用してメールの入力フィールドをユーザー オブジェクトに設置できます。この機能を使用するには django-cas-ng パッケージから signal をインポートし、この signal を使用してコードに接続することが必要です。設定ファイルに設定すると問題が発生することがあります。推奨する設定方法:
アプリケーションの設定ファイル、
django.apps.AppConfig.ready()
メソッドの中に記述プロジェクト ファイル、
urls.py
の中に記述(モデルが存在しない場合)
from django_cas_ng.signals import cas_user_authenticated
from django.dispatch import receiver
@receiver(cas_user_authenticated)
def update_user_email_address(sender, user=None, attributes=None, **kwargs):
# If your CAS server does not always include the email attribute
# you can wrap the next two lines of code in a try/catch block.
user.email = attributes["email"]
user.save()
サード パーティの Django 認証の設定¶
通常、Django 認証プラグインは Weblate で動作します。プラグインの指示に従い、Weblate user backend をインストールした状態にしておくことに注意が必要です。
通常の、認証バックエンドを AUTHENTICATION_BACKENDS
に追加し、認証アプリケーション(存在する場合)を INSTALLED_APPS
にインストールする方法:
AUTHENTICATION_BACKENDS = (
# Add authentication backend here
"weblate.accounts.auth.WeblateUserBackend",
)
INSTALLED_APPS += (
# Install authentication app here
)
アクセス制御¶
Weblate には、インスタンス全体または限定した範囲のユーザーに、アクセス権を割り当てるための詳細な権限システムを搭載しています。
バージョン 3.0 で変更: Weblate 3.0 以前は、Django の権限システムのみをベースにしていましたが、現在は Weblate 専用に構築されています。古いバージョンを使用する場合は、使用するバージョンのドキュメントを確認してください。
シンプルなアクセス制御¶
If you are not administrating the whole Weblate installation and just have access to manage certain projects (like on Hosted Weblate), your access control management options are limited to following settings. If you don’t need any complex setup, those are sufficient for you.
プロジェクトのアクセス制御¶
注釈
この機能は、 Hosted Weblate で Libre プランを使用するプロジェクトでは利用できません。
You can limit user’s access to individual projects by selecting a different Access control setting. Available options are:
- 公開
公開、ログインしたすべてのユーザーが翻訳できます。
- 保護
公開、選択したユーザーのみ翻訳できます。
- プライベート
選択したユーザーのみ表示および翻訳できます。
- カスタム
User management features will be disabled; by default all users are forbidden to performed any actions on the project. You will have to set up all the permissions using カスタム アクセス制御.
Access control can be changed in the Access tab of the configuration (Manage ↓ Settings) of each respective project.

デフォルト値は DEFAULT_ACCESS_CONTROL
で変更できます。
注釈
Even for Private projects, some info about your project will be exposed: statistics and language summary for the whole instance will include counts for all projects despite the access control setting. Your project name and other information can’t be revealed through this.
注釈
The actual set of permissions available for users by default in Public, Protected, and Private projects can be redefined by Weblate instance administrator using custom settings.
警告
カスタム アクセス制御を有効にすると、Weblate は選択したプロジェクト用に作成したすべての special groups を削除します。Weblate インスタンス全体の管理者権限なしに実行すると、プロジェクトを管理するためのアクセス権を即座に失います。
参考
プロジェクトごとのアクセス制御の管理¶
プロジェクトのアクセス管理 権限(参照: 特権の一覧)があるユーザーは、カスタム 以外のアクセス制御を持つプロジェクトのユーザーを管理できます。ユーザーは、次のいずれかのグループに割り当てることができます。
For Public, Protected and Private projects:
- 管理
プロジェクトで使用できるすべての権限を含みます。
- Review (only if review workflow is turned on)
査読中に翻訳を承認できる。
For Protected and Private projects only:
- 翻訳
プロジェクトを翻訳し、オフラインで作成した翻訳をアップロードできる。
- 原文
原文(プロジェクトの設定 で許可している場合)および 単一言語コンポーネント と原文情報で編集できる。
- 言語
翻訳言語を管理できる(翻訳の追加または削除)。
- 用語集
用語集を管理できる(エントリの追加または削除、またはアップロード)。
- メモリ
翻訳メモリを管理できる。
- スクリーンショット
スクリーンショットを管理できる(追加または削除、原文への関連付け)。
- VCS
VCS を管理し、エクスポートしたリポジトリにアクセスできる。
- 請求
請求情報と設定にアクセスできる(参照: 請求)。
Unfortunately, it’s not possible to change this predefined set of groups for now. Also this way it’s not possible to give just some additional permissions to all users.
注釈
For non-Custom access control an instance of each group described above is
actually defined for each project. The actual name of those groups will be
Project@Group
, also displayed in the Django admin interface this way.
Although they can’t be edited from Weblate user-interface.

These features are available on the Access control page, which can be accessed from the project’s menu Manage ↓ Users.
新しいユーザーの招待¶
Also, besides adding an existing user to the project, it is possible to invite new ones. Any new user will be created immediately, but the account will remain inactive until signing in with a link in the invitation sent via an e-mail. It is not required to have any site-wide privileges in order to do so, access management permission on the project’s scope (e.g. a membership in the Administration group) would be sufficient.
ヒント
If the invited user missed the validity of the invitation, they can set their password using invited e-mail address in the password reset form as the account is created already.
バージョン 3.11 で追加: ユーザーを招待するメールの再送信ができる(以前送信した招待を無効とする)。
The same kind of invitations are available site-wide from the management interface on the Users tab.
プロジェクトごとのアクセス権の管理¶
Weblate のユーザー インターフェイスでは、プロジェクトごとに 保護 または プライベート に設定、さらに manage users に設定できます。
By default this prevents Weblate from granting access provided by Users and Viewers default groups due to these groups’ own configuration. This doesn’t prevent you from granting permissions to those projects site-wide by altering default groups, creating a new one, or creating additional custom settings for individual component as described in カスタム アクセス制御 below.
One of the main benefits of managing permissions through the Weblate user interface is that you can delegate it to other users without giving them the superuser privilege. In order to do so, add them to the Administration group of the project.
カスタム アクセス制御¶
注釈
この機能は、 Hosted Weblate で Libre プランを使用するプロジェクトでは利用できません。
権限システムはグループとロールに基づいています。ロールにはアクセス権のセットを設定し、グループはアクセス権をユーザーと翻訳にリンクさせます。詳細については、ユーザー、ロール、グループ、およびアクセス権 を確認してください。
The most powerful features of the Weblate’s access control system for now are available only through the Django admin interface. You can use it to manage permissions of any project. You don’t necessarily have to switch it to Custom access control to utilize it. However you must have superuser privileges in order to use it.
If you are not interested in details of implementation, and just want to create a simple-enough configuration based on the defaults, or don’t have a site-wide access to the whole Weblate installation (like on Hosted Weblate), please refer to the シンプルなアクセス制御 section.
共通設定¶
This section contains an overview of some common configurations you may be interested in.
サイト全体のアクセス権の管理¶
To manage permissions for a whole instance at once, add users to appropriate default groups:
Users (this is done by default by the automatic group assignment).
Reviewers (if you are using review workflow with dedicated reviewers).
Managers (if you want to delegate most of the management operations to somebody else).
You should keep all projects configured as Public (see プロジェクトのアクセス制御), otherwise the site-wide permissions provided by membership in the Users and Reviewers groups won’t have any effect.
You may also grant some additional permissions of your choice to the default groups. For example, you may want to give a permission to manage screenshots to all the Users.
You can define some new custom groups as well. If you want to keep managing your permissions site-wide for these groups, choose an appropriate value for the Project selection (e.g. All projects or All public projects).
言語、コンポーネント、またはプロジェクトの独自のアクセス権¶
You can create your own dedicated groups to manage permissions for distinct objects such as languages, components, and projects. Although these groups can only grant additional privileges, you can’t revoke any permission granted by site-wide or per-project groups by adding another custom group.
例:
If you want (for whatever reason) to allow translation to a specific language (lets say Czech) only to a closed set of reliable translators while keeping translations to other languages public, you will have to:
Remove the permission to translate Czech from all the users. In the default configuration this can be done by altering the Users default group.
グループ ユーザー¶ 言語の選択
設定に沿う
言語
All but Czech
Add a dedicated group for Czech translators.
グループ チェコ語翻訳者¶ ロール
パワー ユーザー
プロジェクトの選択
すべての公開プロジェクト
言語の選択
設定に沿う
言語
チェコ語
Add users you wish to give the permissions to into this group.
As you can see, permissions management this way is powerful, but can be quite a tedious job. You can’t delegate it to another user, unless granting superuser permissions.
ユーザー、ロール、グループ、およびアクセス権¶
認証モデルを構成している複数のオブジェクト:
- アクセス権
Weblate に設定済みの個別のアクセス権。ユーザーにアクセス権を割り当てることはできません。アクセス権は、ロールを使用してのみ割り当てることができます。
- ロール
ロールは、アクセス権のセットを設定します。これにより、アクセス権のセットを複数の場所で再利用できるため、管理が簡単になります。
- ユーザー
ユーザーは複数のグループに所属できます。
- グループ
グループは、ロール、ユーザー、認証オブジェクト(プロジェクト、言語、コンポーネント リスト)を関連付けます。
注釈
A group can have no roles assigned to it, in that case access to browse the project by anyone is assumed (see below).
プロジェクトを表示させる接続¶
ユーザーは、プロジェクトまたはプロジェクト内のコンポーネントにリンクされたグループの登録者であることが必要です。登録者であるだけで十分で、プロジェクトに表示させるための特定なアクセス権は必要ありません(これはデフォルトの 閲覧者 グループで使用します。参照: グループ一覧)。
コンポーネントを表示させる接続¶
ユーザーは、参加しているプロジェクトにアクセスできれば、コンポーネントへ無制限にアクセスできます(そのプロジェクトに対してユーザーに与えられたすべてのアクセス権があることになります)。アクセス制限 を有効にすると、コンポーネントへアクセスするには、そのコンポーネント(または、そのコンポーネントが含まれるコンポーネント リスト)に対してアクセス権が設定されていることが必要になります。
グループの範囲¶
The scope of the permission assigned by the roles in the groups are applied by the following rules:
If the group specifies any Component list, all the permissions given to members of that group are granted for all the components in the component lists attached to the group, and an access with no additional permissions is granted for all the projects these components are in. Components and Projects are ignored.
If the group specifies any Components, all the permissions given to the members of that group are granted for all the components attached to the group, and an access with no additional permissions is granted for all the projects these components are in. Projects are ignored.
Otherwise, if the group specifies any Projects, either by directly listing them or by having Projects selection set to a value like All public projects, all those permissions are applied to all the projects, which effectively grants the same permissions to access all projects unrestricted components.
The restrictions imposed by a group’s Languages are applied separately, when it’s verified if a user has an access to perform certain actions. Namely, it’s applied only to actions directly related to the translation process itself like reviewing, saving translations, adding suggestions, etc.
ヒント
言語の選択 または プロジェクトの選択 を使用して、すべての言語またはプロジェクトを自動的に一括で設定できます。
例:
Let’s say there is a project
foo
with the components:foo/bar
andfoo/baz
and the following group:
Group Spanish Admin-Reviewers¶ ロール
文字列の査読、リポジトリの管理
コンポーネント
foo/bar
言語
スペイン語
Members of that group will have following permissions (assuming the default role settings):
General (browsing) access to the whole project
foo
including both components in it:foo/bar
andfoo/baz
.Review strings in
foo/bar
Spanish translation (not elsewhere).Manage VCS for the whole
foo/bar
repository e.g. commit pending changes made by translators for all languages.
自動的なグループの割り当て¶
Django admin interface の グループ 編集ページの下で、自動的なグループの割り当て を指定できます。これは、新規に作成したユーザーをメールアドレスに基づいてグループに自動的に割り当てるために使用する正規表現のリストです。この割り当ては、アカウントの作成時にのみ行われます。
The most common use-case for the feature is to assign all new users to some
default group. In order to do so, you will probably want to keep the default
value (^.*$
) in the regular expression field. Another use-case for this option might be to
give some additional privileges to employees of your company by default.
Assuming all of them use corporate e-mail addresses on your domain, this can
be accomplished with an expression like ^.*@mycompany.com
.
注釈
ある Weblate バージョンから別のバージョンにアップグレードすると、ユーザー と 閲覧者 へのグループの自動割り当てが常に再作成されます。これを無効にするときは、正規表現を ^$
(何にも一致しない)に設定してください。
注釈
As for now, there is no way to bulk-add already existing users to some group via the user interface. For that, you may resort to using the REST API.
デフォルトのグループとロール¶
After installation, a default set of groups is created (see グループ一覧).
このロールとグループは、インストール時に作成されます。標準搭載されたロールは、アップグレード時にはデータベースを移行して常に最新の状態に保たれます。実際に変更することはできませんが、独自のアクセス権のセットを設定したい場合は、新しいロールを設定してください。
特権の一覧¶
- 請求(参照: 請求)
請求情報の表示 [Administration, Billing]
- 変更
変更のダウンロード [Administration]
- コメント
コメントの投稿 [Administration, Edit source, Power user, Review strings, Translate]
コメントの削除 [Administration]
- コンポーネント
コンポーネント設定の編集 [Administration]
コンポーネントのロック、翻訳の阻止 [Administration]
- 用語集
用語集へ用語の追加 [Administration, Manage glossary, Power user]
用語集の用語の編集 [Administration, Manage glossary, Power user]
用語集の用語の削除 [Administration, Manage glossary, Power user]
用語集へ用語のアップロード [Administration, Manage glossary, Power user]
- 自動提案
自動提案の使用 [Administration, Edit source, Power user, Review strings, Translate]
- 翻訳メモリ
翻訳メモリの編集 [Administration, `Manage translation memory]
翻訳メモリの削除 [Administration, Manage translation memory]
- プロジェクト
プロジェクト設定の編集 [Administration]
プロジェクトのアクセス管理 [Administration]
- レポート
レポートのダウンロード [Administration]
- スクリーンショット
スクリーンショットの追加 [Administration, Manage screenshots]
スクリーンショットの編集 [Administration, Manage screenshots]
スクリーンショットの削除 [Administration, Manage screenshots]
- 原文
追加の文字列情報の編集 [Administration, Edit source]
- 文字列
新しい原文の追加 [Administration]
文字列の削除 [Administration]
不合格となった検査の除外 [Administration, Edit source, Power user, Review strings, Translate]
文字列の編集 [Administration, Edit source, Power user, Review strings, Translate]
文字列の査読 [Administration, Review strings]
提案の採用時に文字列編集 [Administration, Review strings]
原文の編集 [Administration, Edit source, Power user]
- 提案
提案の採用 [Administration, Edit source, Power user, Review strings, Translate]
提案の追加 [Administration, Edit source, Power user, Review strings, Translate]
提案の削除 [Administration, Power user]
提案に投票 [Administration, Edit source, Power user, Review strings, Translate]
- 翻訳
翻訳用言語の追加 [Administration, Power user, Manage languages]
自動翻訳の実行 [Administration, Manage languages]
翻訳済み文字列の削除 [Administration, Manage languages]
翻訳用に複数の言語の追加 [Administration, Manage languages]
- アップロード
アップロードした翻訳文の署名の設定 [Administration]
既存の文字列をアップロードして上書き [Administration, Edit source, Power user, Review strings, Translate]
翻訳文のアップロード [Administration, Edit source, Power user, Review strings, Translate]
- VCS
内部リポジトリへのアクセス [Administration, Access repository, Power user, Manage repository]
内部リポジトリへの変更点のコミット [Administration, Manage repository]
内部リポジトリからの変更点のプッシュ [Administration, Manage repository]
内部リポジトリの変更点のリセット [Administration, Manage repository]
upstream リポジトリの場所の表示 [Administration, Access repository, Power user, Manage repository]
内部リポジトリの更新 [Administration, Manage repository]
- サイト全体の特権
管理画面の使用
新しいプロジェクトの追加
言語定義の追加
言語定義の管理
グループの管理
ユーザーの管理
ロールの管理
お知らせの管理
翻訳メモリの管理
コンポーネント リストの管理
注釈
サイト全体の特権は、デフォルトのどのロールにも与えられません。これらは強力で、スーパーユーザーの状態と変わりません。ほとんどの場合、インストールした Weblate のすべてのプロジェクトに影響します。
グループ一覧¶
インストール時(または setupgroups
の実行後 )に、以下のグループが作成され、自由に変更できます。ただし、移行によって、削除または名前の変更を行うと、移行によって再作成されます。
- ゲスト
未認証ユーザーのアクセス権の設定。
このグループには、匿名ユーザーのみ含める(参照:
ANONYMOUS_USER_NAME
)。このグループからロールを削除して、未認証ユーザーの権限を制限できる。
デフォルトのロール: Add suggestion、 Access repository
- 閲覧者
このロールにより、すべてのユーザーが公開プロジェクトを参照できる。デフォルトでは、すべてのユーザーがこのグループのメンバーである。
デフォルトでは、automatic group assignment と指定すると、新しい参加者には自動的にこのグループのメンバーのアカウントが作成されます。
デフォルトのロール: none
- ユーザー
すべてのユーザーのデフォルトのグループ。
デフォルトでは、automatic group assignment と指定すると、新しい参加者には自動的にこのグループのメンバーのアカウントが作成されます。
デフォルトのロール: Power user
- 査読者
査読者用のグループ(参照: 翻訳ワークフロー)。
デフォルトのロール: Review strings
- 管理者
管理者用のグループ。
デフォルトのロール: Administration
警告
想定外の問題が発生することあるので、デフォルトで設定済みの Weblate グループとユーザーは決して削除しないでください。これらの権限が不要な場合は、権限をすべて削除できます。
追加のアクセス制限¶
If you want to use your Weblate installation in a less public manner, i.e. allow
new users on an invitational basis only, it can be done by configuring Weblate
in such a way that only known users have an access to it. In order to do so, you can set
REGISTRATION_OPEN
to False
to prevent registrations of any new
users, and set REQUIRE_LOGIN
to /.*
to require logging-in to access
all the site pages. This is basically the way to lock your Weblate installation.
ヒント
You can use built-in invitations to add new users.
翻訳プロジェクト¶
Translation organization¶
Weblate organizes translatable VCS content of project/components into a tree-like structure.
The bottom level object is Project configuration, which should hold all translations belonging together (for example translation of an application in several versions and/or accompanying documentation).
On the level above, Component configuration, which is actually the component to translate, you define the VCS repository to use, and the mask of files to translate.
Above Component configuration there are individual translations, handled automatically by Weblate as translation files (which match File mask defined in Component configuration) appear in the VCS repository.
Weblate supports a wide range of translation formats (both bilingual and monolingual ones) supported by Translate Toolkit, see 対応するファイル形式.
注釈
You can share cloned VCS repositories using Weblate の内部 URL. Using this feature is highly recommended when you have many components sharing the same VCS. It improves performance and decreases required disk space.
Adding translation projects and components¶
バージョン 3.2 で変更: An interface for adding projects and components is included, and you no longer have to use Django 管理画面.
バージョン 3.4 で変更: The process of adding components is now multi staged, with automated discovery of most parameters.
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.
You can view your current billing plan on a separate page:

The project creation can be initiated from there, or using the menu in the navigation bar, filling in basic info about the translation project to complete addition of it:

After creating the project, you are taken directly to the project page:

Creating a new translation component can be initiated via a single click there. The process of creating a component is multi-staged and automatically detects most translation parameters. There are several approaches to creating component:
- バージョン管理から
Creates component from remote version control repository.
- 既存のコンポーネントから
Creates additional component to existing one by choosing different files.
- 追加ブランチ
Creates additional component to existing one, just for different branch.
- 翻訳ファイルのアップロード
Upload translation files to Weblate in case you do not have version control or do not want to integrate it with Weblate. You can later update the content using the web interface or Weblate's REST API.
- ドキュメントの翻訳
Upload single document and translate that.
- ゼロから始める
Create blank translation project and add strings manually.
Once you have existing translation components, you can also easily add new ones for additional files or branches using same repository.
First you need to fill in name and repository location:

On the next page, you are presented with a list of discovered translatable resources:

As a last step, you review the translation component info and fill in optional details:

Project configuration¶
翻訳プロジェクトを作成し、プロジェクトに翻訳用の新しいコンポーネントを追加します。プロジェクトは、実際の翻訳が積み重ねられた棚のようなものです。同じプロジェクト内のすべてのコンポーネントは、提案と辞書を共有します;翻訳は、単一プロジェクト内のすべてのコンポーネント(コンポーネントの設定で無効していない限り)にも自動的に反映されます。参照: 翻訳メモリ。
These basic attributes set up and inform translators of a project:
プロジェクト名¶
Verbose project name, used to display the project name.
URL スラッグ¶
Project name suitable for URLs.
プロジェクトの Web サイト¶
URL where translators can find more info about the project.
This is a required parameter unless turned off by WEBSITE_REQUIRED
.
翻訳についての説明¶
URL to more site with more detailed instructions for translators.
"Language-Team" ヘッダの設定¶
Whether Weblate should manage the Language-Team
header (this is a
GNU gettext only feature right now).
アクセス制御¶
Configure per project access control, see プロジェクトのアクセス制御 for more details.
Default value can be changed by DEFAULT_ACCESS_CONTROL
.
言語の別名¶
Define language codes mapping when importing translations into Weblate. Use this when language codes are inconsistent in your repositories and you want to get a consistent view in Weblate or in case you want to use non-standard naming of your translation files.
The typical use case might be mapping American English to English: en_US:en
Multiple mappings to be separated by comma: en_GB:en,en_US:en
Using non standard code: ia_FOO:ia
ヒント
The language codes are mapped when matching the translation files and the matches are case sensitive, so make sure you use the source language codes in same form as used in the filenames.
参考
Component configuration¶
A component is a grouping of something for translation. You enter a VCS repository location and file mask for which files you want translated, and Weblate automatically fetches from this VCS, and finds all matching translatable files.
You can find some examples of typical configurations in the 対応するファイル形式.
注釈
It is recommended to keep translation components to a reasonable size - split the translation by anything that makes sense in your case (individual apps or addons, book chapters or websites).
Weblate easily handles translations with 10000s of strings, but it is harder to split work and coordinate among translators with such large translation components.
Should the language definition for a translation be missing, an empty definition is created and named as "cs_CZ (generated)". You should adjust the definition and report this back to the Weblate authors, so that the missing languages can be included in next release.
The component contains all important parameters for working with the VCS, and for getting translations out of it:
コンポーネント名¶
Verbose component name, used to display the component name.
コンポーネントのスラッグ¶
Component name suitable for URLs.
Component project¶
Project configuration where the component belongs.
ソースコードのリポジトリ¶
VCS repository used to pull changes.
参考
See リポジトリへの接続 for more details on specifying URLs.
ヒント
This can either be a real VCS URL or weblate://project/component
indicating that the repository should be shared with another component.
See Weblate の内部 URL for more details.
リポジトリの送信先 URL¶
Repository URL used for pushing. This setting is used only for Git and Mercurial and push support is turned off for these when this is empty.
参考
See リポジトリへの接続 for more details on how to specify a repository URL and Pushing changes from Weblate for more details on pushing changes from Weblate.
リポジトリ ブラウザー¶
URL of repository browser used to display source files (location of used messages). When empty, no such links will be generated. You can use テンプレート用のマークアップ.
For example on GitHub, use something like:
https://github.com/WeblateOrg/hello/blob/{{branch}}/{{filename}}#L{{line}}
In case your paths are relative to different folder, you might want to strip leading
directory by parentdir
filter (see テンプレート用のマークアップ):
https://github.com/WeblateOrg/hello/blob/{{branch}}/{{filename|parentdir}}#L{{line}}
エクスポートされたリポジトリ URL¶
URL where changes made by Weblate are exported. This is important when Web サービスを連携した翻訳 is not used, or when there is a need to manually merge changes. You can use Git exporter to automate this for Git repositories.
リポジトリブランチ¶
Which branch to checkout from the VCS, and where to look for translations.
ブランチに push¶
Branch for pushing changes, leave empty to use リポジトリブランチ.
注釈
This is currently only supported for Git, GitLab and GitHub, it is ignored for other VCS integrations.
File mask¶
Mask of files to translate, including path. It should include one "*" replacing language code (see 言語の定義 for info on how this is processed). In case your repository contains more than one translation file (e.g. more gettext domains), you need to create a component for each of them.
例: po/*.po
または locale/*/LC_MESSAGES/django.po
。
In case your filename contains special characters such as [
, ]
, these need
to be escaped as [[]
or []]
.
単一言語のベース言語ファイル¶
Base file containing string definitions for 単一言語コンポーネント.
基本ファイルの編集¶
Whether to allow editing the base file for 単一言語コンポーネント.
中間言語ファイル¶
Intermediate language file for 単一言語コンポーネント. In most cases this is a translation file provided by developers and is used when creating actual source strings.
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 langugage, translating to other languages is prohibited. This provides 原文の品質ゲートウェイ.
新しい翻訳のテンプレート¶
Base file used to generate new translations, e.g. .pot
file with gettext.
ヒント
In many monolingual formats Weblate starts with blank file by default. Use this in case you want to have all strings present with empty value when creating new translation.
ファイル形式¶
Translation file format, see also 対応するファイル形式.
原文ミスの報告先アドレス¶
Email address used for reporting upstream bugs. This address will also receive notification about any source string comments made in Weblate.
翻訳の自動反映の有効化¶
You can turn off propagation of translations to this component from other components within same project. This really depends on what you are translating, sometimes it's desirable to have make use of a translation more than once.
It's usually a good idea to turn this off for monolingual translations, unless you are using the same IDs across the whole project.
Default value can be changed by DEFAULT_TRANSLATION_PROPAGATION
.
提案の有効化¶
Whether translation suggestions are accepted for this component.
翻訳フラグ¶
品質検査やその他の Weblate の動作のカスタマイズ。参照: フラグを使用した動作の設定。
検査の強制¶
List of checks which can not be ignored, see 検査の強制.
注釈
Enforcing the check does not automatically enable it, you still should enabled it using フラグを使用した動作の設定 in 翻訳フラグ or Additional info on source strings.
翻訳のライセンス¶
License of the translation (does not need to be the same as the source code license).
貢献者同意条項¶
ユーザーがこのコンポーネントを翻訳する前に必要な同意書。
新しい翻訳の追加¶
How to handle requests for creation of new languages. Available options:
- 保守担当者に連絡
User can select desired language and the project maintainers will receive a notification about this. It is up to them to add (or not) the language to the repository.
- 翻訳案内の URL を指定
User is presented a link to page which describes process of starting new translations. Use this in case more formal process is desired (for example forming a team of people before starting actual translation).
- 新しい言語ファイルの作成
User can select language and Weblate automatically creates the file for it and translation can begin.
- 新しい翻訳の追加を無効にする
There will be no option for user to start new translation.
ヒント
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 で追加.
Configures whether users in Weblate will be allowed to add new strings and remove existing ones. Adjust this to match your localization workflow - how the new strings are supposed to be introduced.
For bilingual formats, the strings are typically extracted from the source code (for example by using xgettext) and adding new strings in Weblate should be disabled (they would be discarded next time you update the translation files). In Weblate you can manage strings for every translation and it does not enforce the strings in all translations to be consistent.
For monolingual formats, the strings are managed only on source language and are automatically added or removed in the translations. The strings appear in the translation files once they are translated.
マージ スタイル¶
You can configure how updates from the upstream repository are handled. This might not be supported for some VCSs. See Merge or rebase for more details.
Default value can be changed by DEFAULT_MERGE_STYLE
.
Commit, add, delete, merge and addon messages¶
Message used when committing a translation, see テンプレート用のマークアップ.
デフォルト値の変更は次の方法 DEFAULT_ADD_MESSAGE
、DEFAULT_ADDON_MESSAGE
、DEFAULT_COMMIT_MESSAGE
、DEFAULT_DELETE_MESSAGE
、DEFAULT_MERGE_MESSAGE
。
コミット時にプッシュする¶
Whether committed changes should be automatically pushed to the upstream repository. When enabled, the push is initiated once Weblate commits changes to its underlying repository (see Lazy commits). To actually enable pushing Repository push URL has to be configured as well.
コミットするまでの経過時間¶
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.
Default value can be changed by COMMIT_PENDING_HOURS
.
ヒント
There are other situations where pending changes might be committed, see Lazy commits.
エラー時にロック¶
Locks the component (and linked components, see Weblate の内部 URL) upon the first failed push or merge into its upstream repository, or pull from it. This avoids adding another conflicts, which would have to be resolved manually.
The component will be automatically unlocked once there are no repository errors left.
原文の言語¶
Language used for source strings. Change this if you are translating from something else than English.
ヒント
In case you are translating bilingual files from English, but want to be able to do fixes in the English translation as well, choose English (Developer) as a source language to avoid conflict between the name of the source language and the existing translation.
For monolingual translations, you can use intermediate translation in this case, see 中間言語ファイル.
言語フィルター¶
ファイルマスクをスキャンするときに翻訳ファイルをフィルタ処理する正規表現。Weblate が管理する言語のリストを制限するために使用できます。
注釈
You need to list language codes as they appear in the filename.
Some examples of filtering:
Filter description |
正規表現 |
---|---|
Selected languages only |
|
Exclude languages |
|
Filter two letter codes only |
|
Exclude non language files |
|
Include all files (default) |
|
異なる表記を特定する正規表現¶
文字列の異なる表記を特定するために使用する正規表現。参照: 文字列の異なる表記。
注釈
ほとんどのフィールドは、Weblate 管理画面でプロジェクトの所有者または管理者が編集できます。
優先順位¶
翻訳者に対しては、高い優先順位を設定したコンポーネントを先に提示します。
アクセス制限¶
デフォルトでは、コンポーネントに変更を加えることができない場合でも、プロジェクトにアクセスできるすべてのユーザーにコンポーネントが表示されます。これにより、プロジェクト内での翻訳の一貫性が維持しやすくなります。
Restricting access at a component, or component-list level takes over access permission to a component, regardless of project-level permissions. You will have to grant access to it explicitly. This can be done through granting access to a new user group and putting users in it, or using the default custom or private access control groups.
デフォルト値は DEFAULT_RESTRICTED_COMPONENT
で変更できます。
ヒント
これはプロジェクト管理者にも適用されます — ステータスを切り替えた後、コンポーネントに接続できなくならないように注意してください。
用語集として使用¶
バージョン 4.5 で追加.
このコンポーネントを用語集として使用できます。用語集の色 を使用して、リストの表示方法を設定します。
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.
参考
用語集の色¶
Display color for a glossary used when showing word matches.
テンプレート用のマークアップ¶
Weblate では、テキストのレンダリングが必要な複数の場所で、分かりやすいマークアップ言語を使用しています。これは The Django Template Language に基づいているので、非常に強力です。
現在使用している場所:
コミット メッセージの書式設定。参照: Component configuration
- 複数のアドオン
コンポーネントのテンプレートで使用できる変数:
{{ language_code }}
言語コード
{{ language_name }}
言語名
{{ component_name }}
コンポーネント名
{{ component_slug }}
コンポーネントのスラッグ
{{ project_name }}
プロジェクト名
{{ project_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 }}
現在実行しているアドオンの名前。アドオンのコミット メッセージでのみ使用できる。
リポジトリのブラウザまたはエディタのテンプレートで使用できる変数:
{{branch}}
現在のブランチ
{{line}}
ファイル内の行
{{filename}}
ファイル名、
parentdir
フィルタを使用して、先頭の部分の削除もできます。例:{{filename|parentdir}}
フィルタと組み合わせる方法:
{{ 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 }}
...および、その他の Django テンプレート機能。
インポート速度¶
VCS リポジトリの取得と Weblate への翻訳のインポートは、翻訳のサイズにもよりますが、時間のかかる処理になります。解決のヒント:
設定の最適化¶
デフォルトの設定は、Weblate のテストとデバッグには便利ですが、本番環境のセットアップでは、いくつかの調整が必要です。その多くは、パフォーマンスに大きな影響を与えます。詳細については、ref:production を確認してください。特に確認が必要なもの:
バックグラウンド タスクの実行に必要な Celery の設定(参照: Celery を使用するバックグラウンド タスク )
リソース制限の確認¶
大量の翻訳やリポジトリをインポートする場合は、サーバーのリソース制限の影響を受けます。
メモリの空き容量を確認します。オペレーティング システムに翻訳ファイルをキャッシュさせると、パフォーマンスが大幅に向上します。
処理する文字列が多数ある場合、ディスク操作がボトルネックになることがあります—ディスクは Weblate とデータベースの両方から書き込まれます。
CPU コアを追加すると、バックグラウンド タスクのパフォーマンスが向上することがあります(参照: Celery を使用するバックグラウンド タスク )。
不要な検査の無効¶
一部の品質検査は非常にコストがかかる場合があり、不要な場合は省略するとインポート中の時間を短縮できます。 設定の詳細については CHECK_LIST
を確認してください。
コンポーネントの自動生成¶
プロジェクトに多くの翻訳ファイル(例: 異なる gettext ドメインまたは Android アプリの一部)がある場合は、それらを自動的に読み込みたくなります。これは、コマンド行から import_project
または import_json
を使用するか、コンポーネントの検出 アドオンをインストールすることで実行できます。
アドオンを使用するには、まず 1 つの翻訳ファイル(将来的に名前変更または削除する可能性が最も低いものを選択)用のコンポーネントを作成し、このコンポーネントにアドオンをインストールすることが必要です。
管理コマンドの場合は、すべてのコンポーネントを含むプロジェクトを作成してから、import_project
または import_json
の実行が必要です。
言語の定義¶
異なる翻訳を適切に提供するには、言語名、テキストの文字順、複数形の定義、および言語コードに関する情報が必要です。
言語コードの解析¶
翻訳の解析時に、Weblate は言語コード(通常は ISO 639-1 )を既存の言語オブジェクトにマップしようとします。
言語の別名 を使用して、このマッピングをプロジェクト レベルで設定できます。
完全に一致するものが見つからないときには、既存の言語に最適化されます。検索項目:
大文字と小文字を区別しない検索。
アンダースコアとダッシュの正規化。
標準搭載の言語のエイリアスの検索。
言語名での検索。
指定する言語の既定の国コードの無視 --
cs_CZ
ではなくcs
の選択。
これらにも一致しないときは、デフォルト(左から右へのテキスト順、1 つの複数形)を使用して新しい言語定義が作成されます。自動作成されるコード xx_XX
の言語は、xx_XX (generated) と命名されます。後で管理インターフェイスでこれを変更し(参照: 言語定義の変更 )、課題管理ツールに報告して(参照: Weblate に貢献 )、適切な定義を今後の Weblate リリースに追加できます。
ヒント
間違ったものが言語として認識された場合は、言語フィルター を設定して、翻訳の解析時にそのようなファイルを無視することを推奨します。
言語定義の変更¶
言語の定義は、言語インターフェイス(/languages/
URL)で変更できます。
編集中は、すべてのフィールドが正しいことを確認してください(特に複数形とテキスト順))。正しくないと、翻訳者は翻訳文を適切に編集できません。
標準搭載の言語定義¶
約 600 の言語の定義が Weblate に含まれており、リストはリリースごとに拡張されます。Weblate がアップグレードされるたびに(具体的には weblate migrate が実行されるたびに。参照: 一般的なアップグレード方法 )、言語のデータベースが更新され、Weblate に付属するすべての言語定義が拡張されます。
この機能は UPDATE_LANGUAGES
を使用して無効にできます。setuplang
を使用して、Weblate に標準搭載されたデータと一致するようにデータベースを更新することもできます。
参考
The language definitions are in the weblate-language-data repository.
あいまいな言語コードとマクロ言語¶
多くの場合、翻訳にマクロ言語コードを使用することは推奨できません。典型的な問題のあるケースはクルド語であり、アラビア語やラテン語のスクリプトで書かれていることがあります。Weblate で正しく動作させるには、個々の言語コードのみを使用し、マクロ言語は使用しないことを推奨します。
言語の定義¶
各言語を構成するフィールド:
言語コード¶
言語を識別するコード。Weblate は、ISO 639-1 で定義された 2 つの文字コードを優先しますが、2 つの文字コードを持たない言語には ISO 639-2 または ISO 639-3 コードを使用します。BCP 47 で定義された拡張コードにも対応できます。
言語名¶
表示する言語名。Weblate に含まれる言語名も、ユーザーインターフェイスの言語に合わせて現地語化されます。
テキストの方向¶
言語を右から左に書くか、左から右に書くかを指定します。このプロパティは、ほとんどの言語で正しく自動検出されます。
複数形の数¶
言語で使用する複数形の数。
複数形判別式¶
与えられたカウントに、どの複数形を使用するかを決定するために使用する Gettext 互換の複数形式。
新しい翻訳の追加¶
バージョン 2.18 で変更: 2.18 以前のバージョンでは、新しい翻訳の追加の動作はファイル形式別でした。
Weblate では、すべてのファイル形式の新しい翻訳を自動的に開始できます。
形式によっては、空のファイルで始まり、翻訳した文字列のみを含むことを想定しているものもあれば(例: Android string resources )、すべてのキーが存在することを想定しているものもあります(例: GNU gettext )。場合によっては、実際には形式に依存せず、翻訳を処理するために使用するフレームワークに依存します(例: JSON files )。
Component configuration で 新しい翻訳のテンプレート を指定すると、Weblate はこのファイルを使用して新しい翻訳を開始します。既存の翻訳文は、ファイルから削除されます。
新しい翻訳のテンプレート が空で、ファイル形式が対応している場合、空のファイルが作成され、新しい文字列を翻訳するとそこに追加されます。
言語コード スタイル で変更できる、生成したファイル名で使用する言語コード:
- ファイル形式から導き出されるデフォルト
ファイル形式によって異なるが、ほぼ POSIX が使用される。
- アンダースコアを区切り文字とする POSIX 形式
通常、gettext および関連ツールで使用され、
pt_BR
のような言語コードを生成する。- 国コードを含む、下線を区切り文字とする POSIX 形式
必要でない場合でも国コードを含む POSIX 形式の言語コード(例:
cs_CZ
)。- ハイフンを区切り文字とする BCP 形式
通常、Web プラットフォームで使用し、
pt-BR
などの言語コードを生成する。- 国コードを含む、ハイフンを区切り文字とする BCP 形式
必要でない場合でも国コードを含む BCP 形式の言語コード(例:
cs-CZ
)。- Android 形式
Android アプリでのみ使用し、
pt-rBR
のような言語コードを生成する。- Java 形式
Java で使用—主に中国語用のレガシー コードを使用する BCP。
さらに、言語の別名 で定義したマッピングはすべて逆に適用する。
注釈
Weblate は翻訳ファイルを解析するときに、これらのいずれかを認識しますが、上記の設定は新しいファイルがどのように作成されるかにのみ影響します。
Web サービスを連携した翻訳¶
There is infrastructure in place so that your translation closely follows development. This way translators can work on translations the entire time, instead of working through huge amount of new text just prior to release.
参考
Integrating with Weblate describes basic ways to integrate your development with Weblate.
This is the process:
Developers make changes and push them to the VCS repository.
Optionally the translation files are updated (this depends on the file format, see Why does Weblate still show old translation strings when I've updated the template?).
Weblate pulls changes from the VCS repository, see Updating repositories.
Once Weblate detects changes in translations, translators are notified based on their subscription settings.
Translators submit translations using the Weblate web interface, or upload offline changes.
Once the translators are finished, Weblate commits the changes to the local repository (see Lazy commits) and pushes them back if it has permissions to do so (see Pushing changes from Weblate).
Updating repositories¶
You should set up some way of updating backend repositories from their source.
通知フック を使用して統合する、一般的なコード ホスティング サービス:
リポジトリ管理から、または Weblate's REST API あるいは Weblate クライアント を使用して手動で更新を起動させる
AUTO_UPDATE
を有効にして、Weblate インスタンス上のすべてのコンポーネントを自動的に更新させるupdategit
の実行(プロジェクトの選択、または --all の選択ですべて更新)
Weblate がリポジトリを更新するたびに、更新後のアドオンが起動。参照: アドオン。
Avoiding merge conflicts¶
The merge conflicts from Weblate arise when same file was changed both in Weblate and outside it. There are two approaches to deal with that - avoid edits outside Weblate or integrate Weblate into your updating process, so that it flushes changes prior to updating the files outside Weblate.
The first approach is easy with monolingual files - you can add new strings within Weblate and leave whole editing of the files there. For bilingual files, there is usually some kind of message extraction process to generate translatable files from the source code. In some cases this can be split into two parts - one for the extraction generates template (for example gettext POT is generated using xgettext) and then further process merges it into actual translations (the gettext PO files are updated using msgmerge). You can perform the second step within Weblate and it will make sure that all pending changes are included prior to this operation.
The second approach can be achieved by using Weblate's REST API to force Weblate to push all pending changes and lock the translation while you are doing changes on your side.
The script for doing updates can look like this:
# Lock Weblate translation
wlc lock
# Push changes from Weblate to upstream repository
wlc push
# Pull changes from upstream repository to your local copy
git pull
# Update translation files, this example is for Django
./manage.py makemessages --keep-pot -a
git commit -m 'Locale updates' -- locale
# Push changes to upstream repository
git push
# Tell Weblate to pull changes (not needed if Weblate follows your repo
# automatically)
wlc pull
# Unlock translations
wlc unlock
If you have multiple components sharing same repository, you need to lock them all separately:
wlc lock foo/bar
wlc lock foo/baz
wlc lock foo/baj
注釈
The example uses Weblate クライアント, which needs configuration (API keys) to be able to control Weblate remotely. You can also achieve this using any HTTP client instead of wlc, e.g. curl, see Weblate's REST API.
Automatically receiving changes from GitHub¶
Weblate comes with native support for GitHub.
If you are using Hosted Weblate, the recommended approach is to install the Weblate app, that way you will get the correct setup without having to set much up. It can also be used for pushing changes back.
To receive notifications on every push to a GitHub repository, add the Weblate Webhook in the repository settings (Webhooks) as shown on the image below:

For the payload URL, append /hooks/github/
to your Weblate URL, for example
for the Hosted Weblate service, this is https://hosted.weblate.org/hooks/github/
.
You can leave other values at default settings (Weblate can handle both content types and consumes just the push event).
Automatically receiving changes from Bitbucket¶
Weblate has support for Bitbucket webhooks, add a webhook
which triggers upon repository push, with destination to /hooks/bitbucket/
URL
on your Weblate installation (for example
https://hosted.weblate.org/hooks/bitbucket/
).

Automatically receiving changes from GitLab¶
Weblate has support for GitLab hooks, add a project webhook
with destination to /hooks/gitlab/
URL on your Weblate installation
(for example https://hosted.weblate.org/hooks/gitlab/
).
Pagure からの変更を自動的に受信¶
バージョン 3.3 で追加.
Weblate は、Pagure フックに対応しているので、あなたの Weblate のインストール上の /hooks/pagure/
URL に宛先がある WEB フックを追加します(例: https://hosted.weblate.org/hooks/pagure/
)。Project options の中の Activate Web-hooks に設定する方法:

Automatically receiving changes from Azure Repos¶
バージョン 3.8 で追加.
Weblate has support for Azure Repos web hooks, add a webhook for
Code pushed event with destination to /hooks/azure/
URL on your
Weblate installation (for example https://hosted.weblate.org/hooks/azure/
).
This can be done in Service hooks under Project
settings.
Automatically receiving changes from Gitea Repos¶
バージョン 3.9 で追加.
Weblate has support for Gitea webhooks, add a Gitea Webhook for
Push events event with destination to /hooks/gitea/
URL on your
Weblate installation (for example https://hosted.weblate.org/hooks/gitea/
).
This can be done in Webhooks under repository Settings.
Automatically receiving changes from Gitee Repos¶
バージョン 3.9 で追加.
Weblate has support for Gitee webhooks, add a WebHook for
Push event with destination to /hooks/gitee/
URL on your
Weblate installation (for example https://hosted.weblate.org/hooks/gitee/
).
This can be done in WebHooks under repository Management.
Automatically updating repositories nightly¶
Weblate automatically fetches remote repositories nightly to improve
performance when merging changes later. You can optionally turn this into doing
nightly merges as well, by enabling AUTO_UPDATE
.
Pushing changes from Weblate¶
Each translation component can have a push URL set up (see
リポジトリの送信先 URL), and in that case Weblate will be able to push change to
the remote repository. Weblate can be also be configured to automatically push
changes on every commit (this is default, see コミット時にプッシュする).
If you do not want changes to be pushed automatically, you can do that manually
under Repository maintenance or using API via wlc push
.
The push options differ based on the バージョン管理の統合 used, more details are found in that chapter.
Weblate による直接プッシュが不要な場合は、GitHub、GitLab、Pagure のプル リクエストまたは Gerrit 査読に対応しています。これを有効にするには、Component configuration で バージョン管理システム として GitHub、GitLab、Gerrit または Pagure を選択します。
Overall, following options are available with Git, GitHub and GitLab:
Desired setup |
|||
---|---|---|---|
No push |
empty |
empty |
|
Push directly |
SSH URL |
empty |
|
別のブランチに push |
SSH URL |
Branch name |
|
GitHub pull request from fork |
empty |
empty |
|
GitHub pull request from branch |
SSH URL 1 |
Branch name |
|
GitLab merge request from fork |
empty |
empty |
|
GitLab merge request from branch |
SSH URL 1 |
Branch name |
|
フォークからの Pagure マージ リクエスト |
empty |
empty |
|
ブランチからの Pagure マージ リクエスト |
SSH URL 1 |
Branch name |
- 1(1,2,3)
Can be empty in case ソースコードのリポジトリ supports pushing.
注釈
You can also enable automatic pushing of changes after Weblate commits, this can be done in コミット時にプッシュする.
参考
See リポジトリへの接続 for setting up SSH keys, and Lazy commits for info about when Weblate decides to commit changes.
Protected branches¶
If you are using Weblate on protected branch, you can configure it to use pull requests and perform actual review on the translations (what might be problematic for languages you do not know). An alternative approach is to waive this limitation for the Weblate push user.
For example on GitHub this can be done in the repository configuration:

Merge or rebase¶
By default, Weblate merges the upstream repository into its own. This is the safest way in case you also access the underlying repository by other means. In case you don't need this, you can enable rebasing of changes on upstream, which will produce a history with fewer merge commits.
注釈
Rebasing can cause you trouble in case of complicated merges, so carefully consider whether or not you want to enable them.
Interacting with others¶
Weblate makes it easy to interact with others using its API.
Lazy commits¶
The behaviour of Weblate is to group commits from the same author into one commit if possible. This greatly reduces the number of commits, however you might need to explicitly tell it to do the commits in case you want to get the VCS repository in sync, e.g. for merge (this is by default allowed for the Managers group, see 特権の一覧).
The changes in this mode are committed once any of the following conditions are fulfilled:
Somebody else changes an already changed string.
A merge from upstream occurs.
An explicit commit is requested.
Change is older than period defined as コミットするまでの経過時間 on Component configuration.
ヒント
Commits are created for every component. So in case you have many components you will still see lot of commits. You might utilize Git コミットの簡略化 addon in that case.
If you want to commit changes more frequently and without checking of age, you can schedule a regular task to perform a commit:
CELERY_BEAT_SCHEDULE = {
# Unconditionally commit all changes every 2 minutes
"commit": {
"task": "weblate.trans.tasks.commit_pending",
# Ommiting hours will honor per component settings,
# otherwise components with no changes older than this
# won't be committed
"kwargs": {"hours": 0},
# How frequently to execute the job in seconds
"schedule": 120,
}
}
Processing repository with scripts¶
The way to customize how Weblate interacts with the repository is アドオン. Consult アドオンから実行するスクリプト for info on how to execute external scripts through addons.
Keeping translations same across components¶
Once you have multiple translation components, you might want to ensure that the same strings have same translation. This can be achieved at several levels.
Translation propagation¶
With translation propagation enabled (what is the default, see Component configuration), all new translations are automatically done in all components with matching strings. Such translations are properly credited to currently translating user in all components.
注釈
The translation propagation requires the key to be match for monolingual translation formats, so keep that in mind when creating translation keys.
翻訳のライセンス¶
翻訳を、どのライセンスで貢献するかを指定できます。これは、翻訳が公開されている場合には、利用者の使用目的を規定するためにとても重要です。
ライセンス情報を Component configuration に設定することが必要です。可能ではあるが、貢献者に対して使用許諾契約を要求しないことは避けてください。
ライセンス情報¶
ライセンス情報(ライセンス名と URL)を設定すると、それぞれの Component configuration の翻訳情報セクションに表示されます。
通常、明示的な同意を必要としない場合は、ここはライセンス情報を記述するのに最適な場所です。あなたのプロジェクトまたは翻訳が Libre でない場合、おそらく事前の同意が必要となります。
貢献者同意条項¶
貢献者使用条項を設定すると、その契約に同意したユーザーのみが貢献者として翻訳できます。これは、翻訳を開始するときに表示する明確な手順:

入力したテキストは段落に整形されて、外部リンクも記述できます。HTML マークアップは使用できません。
翻訳の処理¶
提案への投票¶
Everyone can add suggestions by default, to be accepted by signed in users. Suggestion voting can be used to make use of a string when more than one signed-in user agrees, by setting up the Component configuration configuration with Suggestion voting to turn on voting, and Autoaccept suggestions to set a threshold for accepted suggestions (this includes a vote from the user making the suggestion if it is cast).
注釈
Once automatic acceptance is set up, normal users lose the privilege to directly save translations or accept suggestions. This can be overridden with the Edit string when suggestions are enforced permission.
You can combine these with access control into one of the following setups:
Users suggest and vote for suggestions and a limited group controls what is accepted. - Turn on voting. - Turn off automatic acceptance. - Don't let users save translations.
Users suggest and vote for suggestions with automatic acceptance once the defined number of them agree. - Turn on voting. - Set the desired number of votes for automatic acceptance.
Optional voting for suggestions. (Can optionally be used by users when they are unsure about a translation by making multiple suggestions.) - Only turn on voting.
Additional info on source strings¶
Enhance the translation process by adding additional info to the strings including explanations, string priorities, check flags and visual context. Some of that info may be extracted from the translation files and some may be added by editing the additional string info:

Access this directly from the translation interface by clicking the "Edit" icon next to Screenshot context or Flags.

Strings prioritization¶
バージョン 2.0 で追加.
String priority can be changed to offer higher priority strings for translation earlier by
using the priority
flag.
ヒント
This can be used to order the flow of translation in a logical manner.
参考
翻訳フラグ¶
バージョン 2.4 で追加.
バージョン 3.3 で変更: Previously called Quality checks flags, it no longer configures only checks.
The default set of translation flags is determined by the translation Component configuration and the translation file. However, you might want to use it to customize this per source string.
参考
説明¶
バージョン 4.1 で変更: In previous versions this has been called Extra context.
Use the explanation to clarify scope or usage of the translation. You can use Markdown to include links and other markup.
Visual context for strings¶
バージョン 2.9 で追加.
You can upload a screenshot showing a given source string in use within your program. This helps translators understand where it is used, and how it should be translated.
The uploaded screenshot is shown in the translation context sidebar:

In addition to Additional info on source strings, screenshots have a separate management interface under the Tools menu. Upload screenshots, assign them to source strings manually, or use optical character recognition to do so.
Once a screenshot is uploaded, this interface handles management and source string association:

検査と修正¶
自動修正のカスタマイズ¶
標準の自動修正に、独自の修正も追加できます。AUTOFIX_LIST
内に記述します。
自動修正は強力ですが、翻訳を破壊することもあります; 記述するときには注意が必要です。
例えば、次の自動修正は、翻訳内のすべての文字列 foo
を bar
に置き換える:
#
# Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
from django.utils.translation import gettext_lazy as _
from weblate.trans.autofixes.base import AutoFix
class ReplaceFooWithBar(AutoFix):
"""Replace foo with bar."""
name = _("Foobar")
def fix_single_target(self, target, source, unit):
if "foo" in target:
return target.replace("foo", "bar"), True
return target, False
独自の自動修正を組み込むには、AUTOFIX_LIST
内で Python クラスへの完全修飾パスを指定します。参照: 品質検査、アドオン、自動修正のカスタマイズ。
フラグを使用した動作の設定¶
Weblate の動作(主に検査)は、原文(原文の査読、参照: Additional info on source strings)、または Component configuration ( 翻訳フラグ)で詳細に設定できます。ファイル フォーマットの中には、フラグを直接フォーマットで指定できるものもあります(参照: 対応するファイル形式)。
フラグはカンマで、パラメーターはコロンで区切ります。引用符を使用して、文字列に空白または特殊文字を含めることができます。設定例:
placeholders:"special:value":"other value", regex:.*
現在、使用可能なフラグ一覧:
rst-text
テキストを reStructuredText 文書として扱う、関連項目 未翻訳の翻訳文。
md-text
テキストを Markdown 文書として扱う。
dos-eol
UNIX の代わりに DOS の改行コードを使用する(
\n
の代わりに\r\n
)。url
文字列は URL のみでなければならない。
safe-html
文字列は HTML セーフでなければならない。参照: 安全でない HTML。
read-only
文字列は読み取り専用なので Weblate で編集しないでください。参照: 編集不可の文字列。
priority:N
文字列の優先順位。優先順位の高い文字列が最初に翻訳されます。デフォルトの優先順位は 100、文字列の優先順位が高いほど、翻訳のために早く使用されます。
max-length:N
文字列の最大長を N 文字に制限する。参照: 翻訳の最大文字数。
xml-text
テキストを XML ドキュメントとして扱う、関連項目: XML 構文 および XML マークアップ。
font-family:NAME
検査結果を表示するフォントの定義。参照: フォントの管理。
font-weight:WEIGHT
検査結果を表示するフォントの太さの定義。参照: フォントの管理。
font-size:SIZE
検査結果を表示するフォント サイズの定義。参照: フォントの管理。
font-spacing:SPACING
表示確認用の文字間隔の設定。参照: フォントの管理。
placeholders:NAME:NAME2:...
翻訳にはプレースホルダー文字列が必要です。参照: プレースホルダー。
replacements:FROM:TO:FROM2:TO2...
結果のテキスト パラメータを検査するときに実行する置換(例 翻訳の文字の最大サイズ または 翻訳の最大文字数)。この一般的な使用例は、テキストが長い名前でも収まるように配置可能な場所を拡張すること、 例:
replacements:%s:"John Doe"
。variants:SOURCE
この文字列を、原文と一致する文字列の異なる表記としてマークします。参照: 文字列の異なる表記。
regex:REGEX
翻訳ファイルを照合する正規表現。参照: 正規表現。
禁止
Indicates forbidden translation in a glossary, see 翻訳禁止.
python-format
、c-format
、php-format
、python-brace-format
、javascript-format
、c-sharp-format
、java-format
、java-messageformat
、lua-format
、auto-java-messageformat
、qt-format
、qt-plural-format
、ruby-format
、vue-format
すべての文字列を書式文字列のように扱う、関連項目: 書式指定文字列, 書式指定文字列、書式指定文字列、書式指定文字列、書式指定文字列、書式指定文字列、書式指定文字列、書式指定文字列、書式指定文字列、書式指定文字列、書式指定文字列、書式指定文字列、書式指定文字列、未翻訳の翻訳文。
strict-same
「未翻訳の翻訳」には、標準搭載されたブラックリストの単語を使用しないようにする。参考 未翻訳の翻訳文。
check-glossary
「用語集に従っていない」の品質検査を有効にする。
ignore-bbcode
「BBcode マークアップ」の品質検査を無効にする。
ignore-duplicate
「重複単語の連続」の品質検査を無効にする。
ignore-check-glossary
「用語集に従っていない」の品質検査を無効にする。
ignore-double-space
「連続したスペース」の品質検査を無効にする。
ignore-angularjs-format
「AngularJS 補間文字列」の品質検査を無効にする。
ignore-c-format
「C 形式」の品質検査を無効にする。
ignore-c-sharp-format
「C# 形式」の品質検査を無効にする。
ignore-es-format
「ECMAScript テンプレート リテラル」の品質検査を無効にする。
ignore-i18next-interpolation
「i18next 補間」の品質検査を無効にする。
ignore-java-format
「Java 形式」の品質検査を無効にする。
ignore-java-messageformat
「Java MessageFormat」の品質検査を無効にする。
ignore-javascript-format
「JavaScript 形式」の品質検査を無効にする。
ignore-lua-format
「Lua 形式」の品質検査を無効にする。
ignore-percent-placeholders
「パーセントのプレースホルダー」の品質検査を無効にする。
ignore-perl-format
「Perl 形式」の品質検査を無効にする。
ignore-php-format
「PHP 形式」の品質検査を無効にする。
ignore-python-brace-format
「Python ブレース形式」の品質検査を無効にする。
ignore-python-format
「Python 形式」の品質検査を無効にする。
ignore-qt-format
「Qt 形式」の品質検査を無効にする。
ignore-qt-plural-format
「Qt 複数形形式」の品質検査を無効にする。
ignore-ruby-format
「Ruby 形式」の品質検査を無効にする。
ignore-vue-format
「Vue I18n 書式」の品質検査を無効にする。
ignore-translated
「翻訳済み」の品質検査を無効にする。
ignore-inconsistent
「一貫性に問題」の品質検査を無効にする。
ignore-kashida
「Kashida 文字の使用」の品質検査を無効にする。
ignore-md-link
「Markdown リンク」の品質検査を無効にする。
ignore-md-reflink
「Markdown の仕様」の品質検査を無効にする。
ignore-md-syntax
「Markdown 構文」の品質検査を無効にする。
ignore-max-length
「翻訳の最大文字数」の品質検査を無効にする。
ignore-max-size
「翻訳の最大サイズ」の品質検査を無効にする。
ignore-escaped-newline
「n の不一致」の品質検査を無効にする。
ignore-end-colon
「コロンの不一致」の品質検査を無効にする。
ignore-end-ellipsis
「省略記号の不一致」の品質検査を無効にする。
ignore-end-exclamation
「感嘆符の不一致」の品質検査を無効にする。
ignore-end-stop
「終止符の不一致」の品質検査を無効にする。
ignore-end-question
「疑問符の不一致」の品質検査を無効にする。
ignore-end-semicolon
「セミコロンの不一致」の品質検査を無効にする。
ignore-newline-count
「改行の不一致」の品質検査を無効にする。
ignore-plurals
「複数形の不備」の品質検査を無効にする。
ignore-placeholders
「プレースホルダー」の品質検査を無効にする。
ignore-punctuation-spacing
「句読点の間隔」の品質検査を無効にする。
ignore-regex
「正規表現」の品質検査を無効にする。
ignore-same-plurals
「同じ複数形」の品質検査を無効にする。
ignore-begin-newline
「先頭の改行」の品質検査を無効にする。
ignore-begin-space
「先頭のスペース」の品質検査を無効にする。
ignore-end-newline
「末尾の改行」の品質検査を無効にする。
ignore-end-space
「末尾のスペース」の品質検査を無効にする。
ignore-same
「未翻訳の翻訳」の品質検査を無効にする。
ignore-safe-html
「安全でない HTML」の品質検査を無効にする。
ignore-url
「URL」の品質検査を無効ににする。
ignore-xml-tags
「XML マークアップ」の品質検査を無効にする。
ignore-xml-invalid
「XML 構文」の品質検査を無効にする。
ignore-zero-width-space
「ゼロ幅スペース」の品質検査を無効にする。
ignore-ellipsis
「省略記号」の品質検査を無効にする。
ignore-long-untranslated
「長期にわたり未翻訳」の品質検査を無効にする。
ignore-multiple-failures
「複数の検査で不合格」の品質検査を無効にする。
ignore-unnamed-format
「複数の名前のない変数」の品質検査を無効にする。
ignore-optional-plural
「複数形の不使用」の品質検査を無効にする。
注釈
基本的に、規則は名前に ignore-*
という識別子がすべての検査に対して付いているため、独自の検査にも使用できます。
このフラグは、Component configuration 、原文ごとの設定、および翻訳ファイル自体(例: GNU gettext)の両方で認識されます。
検査の強制¶
バージョン 3.11 で追加.
Component configuration で 検査の強制 を設定することで、無効にできない検査項目を設定できます。設定した検査項目は、ユーザーインターフェイスで除外にできず、検査で不合格となった文字列は 要編集 (参照: Translation states)と設定されます。
フォントの管理¶
バージョン 3.7 で追加.
ヒント
Weblate にアップロードしたフォントは、 翻訳の文字の最大サイズ 検査のためだけに使用します。Weblate のユーザーインターフェイスには影響しません。
表示したテキストのサイズの計算に使用する 翻訳の文字の最大サイズ 検査は、フォントを Weblate に読み込み、翻訳フラグ(参照: フラグを使用した動作の設定)を使用して選択することが必要です。
翻訳プロジェクトの 管理 メニュー下の フォント にあるフォント管理ツールは、フォントのアップロードと管理のためのインターフェイスを提供します。TrueTypeとOpenTypeフォントがアップロードできるので、フォントグループを設定して検査で使用してください。
フォントグループを使用すると、言語ごとに異なるフォントを定義できます。通常、ラテン言語以外で必要です:

フォント グループは名前で識別し、名前には空白文字や特殊文字を含めることはできません。そこで、簡単に選択して使用する方法:

フォント ファミリーとスタイルは、アップロード後に自動的に認識:

Weblate に登録できる複数のフォントの設定:

文字列の長さを確認するためにフォントを使用するには、適切なフラグ(参照 フラグを使用した動作の設定)を渡します。設定が必要な項目:
max-size:500
最大幅の設定。
font-family:ubuntu
使用するフォント グループの識別子の設定。
font-size:22
フォント サイズの設定。
独自検査の記述¶
幅広い品質検査を標準搭載していますが(参照: 品質検査)、検査したい項目をすべて網羅しているとは限りません。実行する検査の内容は、CHECK_LIST
で設定できます。また、独自の検査も追加できます。
weblate.checks.Check をサブクラス化する
複数の属性を設定する。
check
(コードで複数形を扱う場合)またはcheck_single
メソッド(これはあなたに代わって実行)を実装する。
複数の例:
独自の検査を組み込むには、CHECK_LIST
に Python クラスへの完全修飾パスを指定します。参照: 品質検査、アドオン、自動修正のカスタマイズ。
翻訳テキストに「foo」が含まれていないかの確認¶
これは非常に単純な検査であり、翻訳に文字列「foo」を含まないかの検査をするだけです。
#
# Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
"""Simple quality check example."""
from django.utils.translation import gettext_lazy as _
from weblate.checks.base import TargetCheck
class FooCheck(TargetCheck):
# Used as identifier for check, should be unique
# Has to be shorter than 50 characters
check_id = "foo"
# Short name used to display failing check
name = _("Foo check")
# Description for failing check
description = _("Your translation is foo")
# Real check code
def check_single(self, source, target, unit):
return "foo" in target
チェコ語の翻訳文の複数形が異なっているかの確認¶
言語情報を使用して、チェコ語の 2 つの複数形が同じでないことを検査します。
#
# Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
"""Quality check example for Czech plurals."""
from django.utils.translation import gettext_lazy as _
from weblate.checks.base import TargetCheck
class PluralCzechCheck(TargetCheck):
# Used as identifier for check, should be unique
# Has to be shorter than 50 characters
check_id = "foo"
# Short name used to display failing check
name = _("Foo check")
# Description for failing check
description = _("Your translation is foo")
# Real check code
def check_target_unit(self, sources, targets, unit):
if self.is_language(unit, ("cs",)):
return targets[1] == targets[2]
return False
def check_single(self, source, target, unit):
"""We don't check target strings here."""
return False
機械翻訳¶
複数の機械翻訳サービスに対応した機能を標準搭載しています。管理者は、各サービスを MT_SERVICES
を設定して個別に有効にします。機械翻訳サービスは利用規約の対象となるため、あなたが望む方法で利用できることを確認してください。
原文の言語は、Project configuration から設定します。
amaGama¶
特別にインストールされて動作している、Virtaal の作成者自身が作成した tmserver 。
weblate.machinery.tmserver.AmagamaTranslation
を MT_SERVICES
に追加して、このサービスを有効にします。
Apertium¶
限定した言語セットに対して翻訳を提供する Libre ソフトウェアの機械翻訳プラットフォームです。
Apertium が推奨する使用方法は、Apertium-APy サーバーを独自に実行することです。
このサービスを有効にするには、MT_SERVICES
に weblate.machinery.apertium.ApertiumAPYTranslation
を追加し、MT_APERTIUM_APY
を設定します。
AWS¶
バージョン 3.1 で追加.
Amazon Translate は、対応している多くの言語間でテキストを英語に、またその逆に翻訳したりするためのニューラル機械翻訳サービスです。
1. Turn on this service by adding weblate.machinery.aws.AWSTranslation
to
MT_SERVICES
.
boto3 モジュールをインストールする。
Weblate を設定する。
Baidu API machine translation¶
バージョン 3.2 で追加.
Baidu が提供する機械翻訳サービス。
This service uses an API and you need to obtain an ID and API key from Baidu to use it.
Turn on this service by adding weblate.machinery.baidu.BaiduTranslation
to
MT_SERVICES
and set MT_BAIDU_ID
and
MT_BAIDU_SECRET
.
DeepL¶
バージョン 2.20 で追加.
DeepL is paid service providing good machine translation for a few languages. You need to purchase DeepL API subscription or you can use legacy DeepL Pro (classic) plan.
Turn on this service by adding weblate.machinery.deepl.DeepLTranslation
to
MT_SERVICES
and set MT_DEEPL_KEY
.
ヒント
In case you have subscription for CAT tools, you are supposed to use "v1
API" instead of default "v2" used by Weblate (it is not really an API
version in this case). You can toggle this by MT_DEEPL_API_VERSION
.
Glosbe¶
Free dictionary and translation memory for almost every living language.
The API is gratis to use, but subject to the used data source license. There is a limit of calls that may be done from one IP in a set period of time, to prevent abuse.
Turn on this service by adding weblate.machinery.glosbe.GlosbeTranslation
to
MT_SERVICES
.
Google Translate¶
Google が提供する機械翻訳サービス。
This service uses the Google Translation API, and you need to obtain an API key and turn on billing in the Google API console.
To turn on this service, add weblate.machinery.google.GoogleTranslation
to
MT_SERVICES
and set MT_GOOGLE_KEY
.
Google Translate API V3 (Advanced)¶
Google Cloud サービスが提供する機械翻訳サービス。
This service differs from the former one in how it authenticates.
To enable service, add weblate.machinery.googlev3.GoogleV3Translation
to
MT_SERVICES
and set
If location fails, you may also need to specify MT_GOOGLE_LOCATION
.
Microsoft Cognitive Services Translator¶
バージョン 2.10 で追加.
Cognitive Services のひとつとして Azure portal でマイクロソフトが提供する機械翻訳サービス。
Weblate implements Translator API V3.
To enable this service, add weblate.machinery.microsoft.MicrosoftCognitiveTranslation
to
MT_SERVICES
and set MT_MICROSOFT_COGNITIVE_KEY
.
Translator Text API V2¶
The key you use with Translator API V2 can be used with API 3.
Translator Text API V3¶
Azure ポータルに登録して、そこで取得したキーの使用が必要です。新しい Azure キーを使用する場合は、サービスの言語に対して MT_MICROSOFT_REGION
を設定することも必要です。
Microsoft Terminology Service¶
バージョン 2.19 で追加.
The Microsoft Terminology Service API を使用すると、Web サービスを使用して、言語ポータルで使用できる用語、定義、およびユーザー インターフェイス(UI)文字列にプログラムからアクセスできます。
このサービスを有効にするには、weblate.machinery.microsoftterminology.MicrosoftTerminologyService
を MT_SERVICES
に追加します。
ModernMT¶
バージョン 4.2 で追加.
Turn this service on by adding weblate.machinery.modernmt.ModernMTTranslation
to
MT_SERVICES
and configure MT_MODERNMT_KEY
.
MyMemory¶
Huge translation memory with machine translation.
Free, anonymous usage is currently limited to 100 requests/day, or to 1000
requests/day when you provide a contact e-mail address in MT_MYMEMORY_EMAIL
.
You can also ask them for more.
Turn on this service by adding weblate.machinery.mymemory.MyMemoryTranslation
to
MT_SERVICES
and set MT_MYMEMORY_EMAIL
.
NetEase Sight API machine translation¶
バージョン 3.3 で追加.
Netease が提供する機械翻訳サービス。
This service uses an API, and you need to obtain key and secret from NetEase.
Turn on this service by adding weblate.machinery.youdao.NeteaseSightTranslation
to
MT_SERVICES
and set MT_NETEASE_KEY
and
MT_NETEASE_SECRET
.
tmserver¶
You can run your own translation memory server by using the one bundled with Translate-toolkit and let Weblate talk to it. You can also use it with an amaGama server, which is an enhanced version of tmserver.
First you will want to import some data to the translation memory:
2. Turn on this service by adding weblate.machinery.tmserver.TMServerTranslation
to
MT_SERVICES
.
build_tmdb -d /var/lib/tm/db -s en -t cs locale/cs/LC_MESSAGES/django.po
build_tmdb -d /var/lib/tm/db -s en -t de locale/de/LC_MESSAGES/django.po
build_tmdb -d /var/lib/tm/db -s en -t fr locale/fr/LC_MESSAGES/django.po
Start tmserver to listen to your requests:
tmserver -d /var/lib/tm/db
Configure Weblate to talk to it:
MT_TMSERVER = "http://localhost:8888/tmserver/"
Yandex Translate¶
Yandex が提供する機械翻訳サービス。
This service uses a Translation API, and you need to obtain an API key from Yandex.
Turn on this service by adding weblate.machinery.yandex.YandexTranslation
to
MT_SERVICES
, and set MT_YANDEX_KEY
.
Youdao Zhiyun API machine translation¶
バージョン 3.2 で追加.
Youdao が提供する機械翻訳サービス。
This service uses an API, and you need to obtain an ID and an API key from Youdao.
Turn on this service by adding weblate.machinery.youdao.YoudaoTranslation
to
MT_SERVICES
and set MT_YOUDAO_ID
and
MT_YOUDAO_SECRET
.
Weblate¶
Weblate can be the source of machine translations as well. It is based on the Woosh fulltext engine, and provides both exact and inexact matches.
Turn on these services by adding weblate.machinery.weblatetm.WeblateTranslation
to
MT_SERVICES
.
Weblate Translation Memory¶
バージョン 2.20 で追加.
The 翻訳メモリ can be used as a source for machine translation suggestions as well.
Turn on these services by adding weblate.memory.machine.WeblateMemory
to
the MT_SERVICES
. This service is turned on by
default.
SAP Translation Hub¶
SAP が提供する機械翻訳サービス。
You need to have a SAP account (and enabled the SAP Translation Hub in the SAP Cloud Platform) to use this service.
Turn on this service by adding weblate.machinery.saptranslationhub.SAPTranslationHub
to
MT_SERVICES
and set the appropriate access to either
sandbox or the productive API.
注釈
To access the Sandbox API, you need to set MT_SAP_BASE_URL
and MT_SAP_SANDBOX_APIKEY
.
To access the productive API, you need to set MT_SAP_BASE_URL
,
MT_SAP_USERNAME
and MT_SAP_PASSWORD
.
Custom machine translation¶
You can also implement your own machine translation services using a few lines of
Python code. This example implements machine translation in a fixed list of
languages using dictionary
Python module:
#
# Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
"""Machine translation example."""
import dictionary
from weblate.machinery.base import MachineTranslation
class SampleTranslation(MachineTranslation):
"""Sample machine translation interface."""
name = "Sample"
def download_languages(self):
"""Return list of languages your machine translation supports."""
return {"cs"}
def download_translations(
self,
source,
language,
text: str,
unit,
user,
search: bool,
threshold: int = 75,
):
"""Return tuple with translations."""
for t in dictionary.translate(text):
yield {"text": t, "quality": 100, "service": self.name, "source": text}
You can list own class in MT_SERVICES
and Weblate
will start using that.
アドオン¶
バージョン 2.19 で追加.
アドオンを使用すると、翻訳ワークフローの変更および自動化ができます。管理者は各翻訳コンポーネントの 管理 ↓ アドオン メニューからアドオンの追加と管理ができます。

標準搭載のアドオン¶
自動翻訳¶
バージョン 3.9 で追加.
機械翻訳または他のコンポーネントを使用して文字列を自動的に翻訳します。
起動条件:
コンポーネントに新しい文字列が追加されたとき。
Once in a month for every component, this can be configured using
BACKGROUND_TASKS
.
JavaScript 現地語化 CDN¶
バージョン 4.2 で追加.
JavaScript または HTML の現地語化用に、翻訳をコンテンツ配信ネットワークに公開します。
静的な HTML ページを現地語化したり、JavaScript コードで翻訳を読み込むために使用できます。
HTML のページに挿入して、翻訳を可能にするコンポーネント専用の URL を生成します。詳細については、Translating HTML and JavaScript using Weblate CDN を確認してください。
空白文字列の削除¶
バージョン 4.4 で追加.
翻訳ファイルから翻訳されていない文字列を削除します。
翻訳ファイルに空の文字列を含ませたくない場合使用します(例: 翻訳ライブラリにおいて原文に戻すのではなく、空の文字列が不足していると表示させる場合)。
翻訳ファイルのクリーンアップ¶
単一言語の基本ファイルに合わせてすべての翻訳ファイルを更新します。ほとんどのファイル形式で、基本ファイルに存在しない、無効な翻訳キーを削除します。
不足している言語を追加¶
プロジェクト内のすべてのコンポーネントで一貫した言語のセットが使用されるようにします。
足りない言語は、24 時間ごとに 1 回、さらに新しい言語を Weblate に追加したときに確認します。
他のほとんどのアドオンとは異なり、このアドオンはプロジェクト全体に影響します。
ヒント
新しく追加した文字列を 自動翻訳 で自動翻訳します。
コンポーネントの検出¶
バージョン管理システムのファイル変更に基づいて、プロジェクトコンポーネントを自動的に追加または削除します。
VCS を更新するたびに起動し、その他は、import_project
管理コマンドと同じです。この方法で、1 つの VCS 内で複数の翻訳コンポーネントを追跡できます。
照合は、複雑な設定ができる正規表現を使用して行われますが、そのためにはある程度の知識が必要です。一般的な使用例については、アドオンのヘルプ セクションを確認してください。
保存 をクリックすると、一致するコンポーネントのプレビューを表示し、設定が実際のニーズに合っているか確認する方法:

ヒント
Component discovery addon uses Weblate の内部 URL. It’s a convenient way to share
VCS setup between multiple components. Linked components use the local repository of
the main component set up by filling weblate://project/main-component
into the ソースコードのリポジトリ field (in Manage ↓ Settings ↓
Version control system) of each respective component.
This saves time with configuration and system resources too.
一括編集¶
バージョン 3.11 で追加.
文字列のフラグ、ラベル、状態を一括編集します。
NOT has:label
という検索クエリを使用してラベル付けを自動化し、すべての文字列に必要なラベルが付くまでラベルを追加します。Weblate メタデータに対する他の自動操作も実行できます。
例:
検索クエリ |
|
---|---|
ラベルの追加 |
最近の |
検索クエリ |
|
---|---|
翻訳フラグの追加 |
|
未翻訳の翻訳文に "要編集" フラグを付ける¶
バージョン 3.1 で追加.
VCS からインポートされた新しい翻訳可能な文字列が原文と一致するたびに、Weblate は "要編集" フラグを付けます。特に、未翻訳の文字列に原文が含まれるファイル形式では分かりやすくなります。
新しい原文に "要編集" フラグを付ける¶
新しい原文を VCS からインポートすると、Weblate は毎回 "要編集" フラグを付けます。このため、開発者が作成した原文を簡単にフィルターしたり、編集したりできます。
新しい翻訳に "要編集" フラグを付ける¶
新しい翻訳可能な文章を VCS からインポートすると、Weblate は毎回 "要編集" フラグを付けます。これにより、開発者が作成した翻訳文を簡単にフィルターしたり、編集したりできます。
統計データの生成¶
翻訳状況の詳細情報ファイルを生成します。
Django テンプレートは、ファイル名とコンテンツの両方で使用できます。マークアップの詳細については、マークアップ を確認してください。
例えば、各翻訳の概要ファイルの生成:
- 生成ファイルの名前
locale/{{ language_code }}.json
- 内容
{ "language": "{{ language_code }}", "strings": "{{ stats.all }}", "translated": "{{ stats.translated }}", "last_changed": "{{ stats.last_changed }}", "last_author": "{{ stats.last_author }}", }
疑似言語の生成¶
原文に接頭辞と接尾辞を自動的に追加して、翻訳を生成します。
擬似言語は、翻訳の準備ができていない文字列を検索するのに便利です。これは、すべての翻訳可能な原文を変更したあと、アプリケーションを擬似言語で実行して、変更していない文字列を簡単に見つけ出します。
Finding strings whose localized counterparts might not fit the layout is also possible.
ヒント
テストには実際の言語を使用できますが、 Weblate には専用の疑似言語( en_XA と ar_XB )があります。
コメント内の貢献者情報¶
PO ファイルヘッダのコメントを更新し、貢献者名と貢献した西暦を追加します。
The PO file header will look like this:
# Michal Čihař <michal@cihar.com>, 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 変数の更新¶
新しい翻訳を追加すると、configure
、configure.in
、または任意の configure.ac
ファイルの ALL_LINGUAS 変数を更新します。
gettext 出力のカスタマイズ¶
改行処理など、 gettext の出力動作をカスタマイズできます。
使用できるオプション:
77 文字または改行で行を折り返す
改行でのみ行を折り返す
行を折り返さない
注釈
デフォルトでは、gettext は 77 文字または改行で行を折り返します。--no-wrap
パラメータを指定すると、改行でのみ折り返されます。
LINGUAS ファイルの更新¶
新しい翻訳が追加されたときに LINGUAS ファイルを更新します。
MO ファイルの生成¶
変更された PO ファイルごとに自動的に MO ファイルを生成します。
MO ファイルが生成される場所はカスタマイズでき、フィールドは テンプレート用のマークアップ を使用します。
POT に一致する PO ファイルの更新(msgmerge)¶
msgmerge を使用して POT ファイル( File mask で設定)に一致するように、すべての PO ファイル( 新しい翻訳のテンプレート で設定)を更新します。
新しい変更が upstream リポジトリから新しい変更をプルするたびに起動します。大部分の msgmerge のコマンド ライン オプションはアドオンの設定から設定できます。
Git コミットの簡略化¶
変更をプッシュする前に、Git コミットをスカッシュします。
変更をプッシュする前に Git コミットの内容を簡略化するモードの種類:
バージョン 3.4 で追加.
すべてのコミットを 1 つにまとめる
言語別
ファイル別
バージョン 3.5 で追加.
翻訳者別
元々のコミット メッセージは保持されますが、Per author を選択するか、コミット メッセージに含めるようカスタマイズしない限り、翻訳者情報は失われます。
バージョン 4.1 で追加.
元々のコミット メッセージは、オプションで独自のコミット メッセージに上書きできます。
オプションで、元のコミット メッセージから翻訳者情報( Co-authored-by: …
のようなコミット行)を削除し、簡略化したコミット メッセージの最後に追加できます。これにより、すべての翻訳者に適切な Co-authored-by:
の署名が生成されます。
JSON 出力形式のカスタマイズ¶
インデント処理や並べ替えなど、JSON 出力形式の変更ができます。
Java プロパティ ファイルの整形¶
Java プロパティ ファイルをソートします。
古いコメントの削除¶
バージョン 3.7 で追加.
コメントを削除するまでの期間を設定します。
これは、古くなった可能性のある古いコメントを削除する場合に便利です。コメントが古いからといって、その重要性が失われたわけではないので、注意して使用してください。
古い提案の削除¶
バージョン 3.7 で追加.
提案を削除するまでの期間を設定します。
与えられた時間枠内に必要な賛成票を獲得できなかった提案を、削除する提案投票(参照: 相互評価)に関連して大変便利です。
RESX ファイルの更新¶
バージョン 3.9 で追加.
すべての翻訳ファイルを更新して、上流のモノリンガル基本ファイルに合わせます。使われなくなった文字列は削除され、新しい文字列は原文のコピーとして追加されます。
ヒント
古い翻訳キーのみを削除する場合は、翻訳ファイルのクリーンアップ を使用します。
アドオン一覧のカスタマイズ¶
アドオンの一覧は WEBLATE_ADDONS
で設定します。アドオンを追加するには、設定に絶対クラス名を含めるだけです。
アドオンの作成¶
独自のアドオンも作成できます。サブクラス weblate.addons.base.BaseAddon
を作成してアドオンのメタデータを定義し、処理を行うコールバックを実装します。
参考
アドオンから実行するスクリプト¶
アドオンは、外部スクリプトを実行するためにも使用できます。以前は Weblate に統合されていましたが、現在はスクリプトをアドオンでラップするコードの記述が必要です。
#
# Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
"""Example pre commit script."""
from django.utils.translation import gettext_lazy as _
from weblate.addons.events import EVENT_PRE_COMMIT
from weblate.addons.scripts import BaseScriptAddon
class ExamplePreAddon(BaseScriptAddon):
# Event used to trigger the script
events = (EVENT_PRE_COMMIT,)
# Name of the addon, has to be unique
name = "weblate.example.pre"
# Verbose name and long descrption
verbose = _("Execute script before commit")
description = _("This addon 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
¶ Upstream リポジトリの URL。
-
WL_PATH
¶ VCS リポジトリへの絶対パス。
-
WL_BRANCH
¶ バージョン 2.11 で追加.
現在のコンポーネントに設定したリポジトリのブランチ。
-
WL_FILEMASK
¶ 現在のコンポーネントのファイルマスク。
-
WL_TEMPLATE
¶ 単一言語翻訳用のテンプレートのファイル名(空欄でも可)。
-
WL_NEW_BASE
¶ バージョン 2.14 で追加.
新しい翻訳の作成用のファイル名(空欄でも可)。
-
WL_FILE_FORMAT
¶ 現在のコンポーネントで使用するファイル形式。
-
WL_LANGUAGE
¶ 現在実行中の翻訳言語(コンポーネント レベルのフックでは使用できません)。
-
WL_PREVIOUS_HEAD
¶ 更新前の HEAD(更新後のフックを実行した後にのみ利用可能)。
-
WL_COMPONENT_SLUG
¶ バージョン 3.9 で追加.
コンポーネント URL の設定時に使用するスラッグ。
-
WL_PROJECT_SLUG
¶ バージョン 3.9 で追加.
プロジェクト URL の設定時に使用するスラッグ。
-
WL_COMPONENT_NAME
¶ バージョン 3.9 で追加.
コンポーネント名。
-
WL_PROJECT_NAME
¶ バージョン 3.9 で追加.
プロジェクト名。
-
WL_COMPONENT_URL
¶ バージョン 3.9 で追加.
コンポーネント URL。
-
WL_ENGAGE_URL
¶ バージョン 3.9 で追加.
プロジェクト参加 URL。
更新後のリポジトリ処理¶
VCS の upstream ソースが変更されたときに翻訳ファイルを更新するために使用できます。これを実現するには、 Weblate は VCS にコミットされたファイルだけを確認するので、スクリプトの一部として変更をコミットする必要があることに注意してください。
以下のコードを使用した、Gulp の例:
#! /bin/sh
gulp --gulpfile gulp-i18n-extract.js
git commit -m 'Update source strings' src/languages/en.lang.json
翻訳メモリ¶
バージョン 2.20 で追加.
Weblate comes with a built-in translation memory consisting of the following:
Manually imported translation memory (see User interface).
Automatically stored translations performed in Weblate (depending on Translation memory scopes).
Automatically imported past translations.
Content in the translation memory can be applied one of two ways:
Manually, 自動提案 view while translating.
Automatically, by translating strings using 自動翻訳, or 自動翻訳 addon.
For installation tips, see Weblate Translation Memory, which is turned on by default.
Translation memory scopes¶
バージョン 3.2 で追加: In earlier versions translation memory could be only loaded from a file corresponding to the current imported translation memory scope.
The translation memory scopes are there to allow both privacy and sharing of translations, to suit the desired behavior.
Imported translation memory¶
Importing arbitrary translation memory data using the import_memory
command makes memory content available to all users and projects.
Per user translation memory¶
Stores all user translations automatically in the personal translation memory of each respective user.
Per project translation memory¶
All translations within a project are automatically stored in a project translation memory only available for this project.
Managing translation memory¶
User interface¶
バージョン 3.2 で追加.
In the basic user interface you can manage per user and per project translation memories. It can be used to download, wipe or import translation memory.
ヒント
Translation memory in JSON can be imported into Weblate, TMX is provided for interoperability with other tools.

管理画面¶
There are several management commands to manipulate the translation memory content. These operate on the translation memory as whole, unfiltered by scopes (unless requested by parameters):
dump_memory
Exports the memory into JSON
import_memory
Imports TMX or JSON files into the translation memory
設定¶
すべての設定は settings.py
に保存されます(Django の通常の方法)。
注釈
これらの設定の変更後、Weblate(WSGI プロセスと Celery プロセスの両方)の再起動が必要です。
mod_wsgi
として実行する場合は、Apache を再起動して設定のリロードが必要です。
参考
Django 自体の設定パラメーターについては、Django's documentation も確認してください。
AUTH_LOCK_ATTEMPTS¶
バージョン 2.14 で追加.
接続制限が適用されるまでに失敗した認証試行の最大回数。
現在、適用している場所:
ログイン。アカウント パスワードを削除し、ユーザーが新しいパスワードを要求しなければサインインできないようにしています。
パスワードのリセット。新しいメールが送信されないようにして、パスワードのリセット試行回数が多すぎるユーザーへのスパムを回避します。
デフォルトは 10 回です。
参考
接続制限,
AUTO_UPDATE¶
バージョン 3.2 で追加.
バージョン 3.11 で変更: 元々の on/off オプションを変更し、どの文字列を受け付けるかを区別するために変更しました。
すべてのリポジトリを毎日更新。
ヒント
Weblate リポジトリを自動的に更新するために 通知フック を使用していない場合に便利です。
注釈
後方互換性のために、文字列選択の他に on/off のオプションがあります。
オプションとは:
"none"
毎日の更新はなし。
"remote"
およびFalse
リモートのみを更新。
"full"
およびTrue
リモートを更新し、作業コピーをマージする。
注釈
これには、Celery を使用するバックグラウンド タスク が動作していることが必要で、再起動後に有効になります。
AVATAR_URL_PREFIX¶
アバター URL を作成するための接頭辞: ${AVATAR_URL_PREFIX}/avatar/${MAIL_HASH}?${PARAMS}
。動作することが判明しているサービス:
- Gravatar (デフォルト)、https://gravatar.com/ より
AVATAR_URL_PREFIX = 'https://www.gravatar.com/'
- Libravatar、https://www.libravatar.org/ より
AVATAR_URL_PREFIX = 'https://www.libravatar.org/'
AUTH_TOKEN_VALID¶
バージョン 2.14 で追加.
パスワード リセット メールを送信してからの認証トークンと仮パスワードの有効期間。秒数で設定し、デフォルトは 172800(2 日)。
AUTH_PASSWORD_DAYS¶
バージョン 2.15 で追加.
同じパスワードを使用できる日数。
注釈
Weblate 2.15 以前に行われたパスワードの変更は、このポリシーには含まれません。
デフォルトは 180 日です。
AUTOFIX_LIST¶
文字列を保存するときに適用する自動修正の一覧。
注釈
autofixer インターフェースを実装した Python クラスへの完全修飾パスを提供します。
修正項目の設定方法:
weblate.trans.autofixes.whitespace.SameBookendingWhitespace
文字列の最初と最後の空白を原文と一致させる。
weblate.trans.autofixes.chars.ReplaceTrailingDotsWithEllipsis
原文に省略記号(…)が付いている場合は、末尾のドット(...)を置き換える。
weblate.trans.autofixes.chars.RemoveZeroSpace
原文にゼロ幅のスペース文字が含まれていない場合、ゼロ幅のスペース文字を削除する。
weblate.trans.autofixes.chars.RemoveControlChars
原文に制御文字が含まれていない場合は、制御文字を削除する。
weblate.trans.autofixes.html.BleachHTML
safe-html
のフラグが付いた文字列から安全でない HTML マークアップを削除する(参照: 安全でない HTML)。
使用する項目の選択方法:
AUTOFIX_LIST = (
"weblate.trans.autofixes.whitespace.SameBookendingWhitespace",
"weblate.trans.autofixes.chars.ReplaceTrailingDotsWithEllipsis",
)
参考
BACKGROUND_TASKS¶
バージョン 4.5.2 で追加.
Defines how often lengthy maintenance tasks should be triggered for a component.
Right now this controls:
可能な選択肢:
``毎月``(これがデフォルト)
weekly
daily
never
注釈
Increasing the frequency is not recommended when Weblate contains thousands of components.
BASIC_LANGUAGES¶
バージョン 4.4 で追加.
新しい翻訳を開始するためにユーザーに提供する言語の一覧。指定しない場合は、一般的に使用されているすべての言語を含む組み込みリストを使用するが、国別の固有の異なる表記は含みません。
これは、特権のないユーザーが不要な言語を追加することを制限するだけです。プロジェクト管理者には、選択肢にすべての Weblate に設定済みの言語が引き続き表示されます。
注釈
これは Weblate に新しい言語を定義するものではなく、データベース内の既存の言語をフィルター処理するだけです。
例:
BASIC_LANGUAGES = {"cs", "it", "ja", "en"}
参考
CSP_SCRIPT_SRC、CSP_IMG_SRC、CSP_CONNECT_SRC、CSP_STYLE_SRC、CSP_FONT_SRC¶
Weblate の Content-Security-Policy
ヘッダーをカスタマイズします。ヘッダーは、サード パーティのサービス(Matomo、Google アナリティクス、Sentry、…)との統合が有効として自動的に生成されます。
これらのデフォルトはすべて空のリストになります。
例:
# Enable Cloudflare Javascript optimizations
CSP_SCRIPT_SRC = ["ajax.cloudflare.com"]
CHECK_LIST¶
翻訳に対して実行する品質検査のリストです。
注釈
check インタフェースを実装する Python クラスへの完全修飾パスを指定します。
検査項目を選択して、関連する検査を含めます。
デフォルトでは、標準搭載したすべての 品質検査 が有効なっているので、ここで設定を変更できます。デフォルトでは、設定例 でコメント化されているため、デフォルト値が使用されます。その後は、Weblate の新しいバージョンのリリースのたびに新しい検査が行われます。
すべての検査を無効にする方法:
CHECK_LIST = ()
指定する項目のみを有効にする方法:
CHECK_LIST = (
"weblate.checks.chars.BeginNewlineCheck",
"weblate.checks.chars.EndNewlineCheck",
"weblate.checks.chars.MaxLengthCheck",
)
注釈
この設定を変更すると、新しく変更した翻訳のみ検査されて、過去の検査結果は引き続きデータベースに保存されたままです。保存されている翻訳にも、新しい検査を適用するには、updatechecks
を実行します。
CONTACT_FORM¶
バージョン 4.6 で追加.
Configures how e-mail from the contact form is being sent. Choose a configuration that matches your mail server configuration.
"reply-to"
The sender is used in as Reply-To, this is the default behaviour.
"from"
The sender is used in as From. Your mail server needs to allow sending such e-mails.
DATA_DIR¶
Weblate フォルダには、すべてのデータが格納されます。このフォルダには、VCS リポジトリへのリンク、フル テキスト インデックス、外部ツール用の各種設定ファイルが含まれています。
通常存在する、サブディレクトリ一覧:
home
スクリプトを起動するためのホーム ディレクトリ。
ssh
SSH 鍵と設定。
static
STATIC_ROOT
で指定する、静的 Django ファイルのデフォルトの場所。参照: 静的ファイルの提供。media
MEDIA_ROOT
で指定する、Django メディア ファイルのデフォルトの場所。アップロードされたスクリーンショットが含まれています。vcs
翻訳用のバージョン管理リポジトリ。
backups
毎日のバックアップ データ、詳細は Dumped data for backups を確認してください。
celery
Celery スケジューラ データ。参照: Celery を使用するバックグラウンド タスク。
fonts
:User-uploaded fonts, see フォントの管理.
注釈
このディレクトリは、Weblate が書き込み可能であることが必要です。uWSGI として実行するには、www-data
ユーザーに書き込み権限が必要です。
これを実現する最も簡単な、ユーザーをディレクトリの所有者にする方法:
sudo chown www-data:www-data -R $DATA_DIR
デフォルトは $BASE_DIR/data
です。
DATABASE_BACKUP¶
バージョン 3.1 で追加.
データベース バックアップをプレーン テキストとして保存するか、圧縮するか、スキップするかを指定します。許可される値:
"plain"
"compressed"
"none"
DEFAULT_ACCESS_CONTROL¶
バージョン 3.3 で追加.
新しいプロジェクトのデフォルトのアクセス制御設定方法:
0
パブリック
1
プロテクト
100
プライベート
200
カスタム
ACL を手動で管理する場合は、カスタム を使用します。これは、Weblate の内部管理に依存しないという意味です。
DEFAULT_AUTO_WATCH¶
バージョン 4.5 で追加.
Configures whether Automatically watch projects on contribution
should be turned on for new users. Defaults to True
.
参考
DEFAULT_ADD_MESSAGE、DEFAULT_ADDON_MESSAGE、DEFAULT_COMMIT_MESSAGE、DEFAULT_DELETE_MESSAGE、DEFAULT_MERGE_MESSAGE¶
違う操作のデフォルトのコミット メッセージです。詳細は Component configuration を確認してください。
DEFAULT_ADDONS¶
作成したすべてのコンポーネントにインストールするデフォルトのアドオン。
注釈
この設定は、新しく作成したコンポーネントにのみ適用されます。
例:
DEFAULT_ADDONS = {
# Addon with no parameters
"weblate.flags.target_edit": {},
# Addon with parameters
"weblate.autotranslate.autotranslate": {
"mode": "suggest",
"filter_type": "todo",
"auto_source": "mt",
"component": "",
"engines": ["weblate-translation-memory"],
"threshold": "80",
},
}
DEFAULT_LANGUAGE¶
バージョン 4.3.2 で追加.
原文の言語 などで使用するデフォルトの原文の言語。
デフォルトは en です。一致する言語オブジェクトがデータベースに存在していることが必要です。
DEFAULT_PULL_MESSAGE¶
新しいプル リクエストのタイトル、デフォルトは 'Update from Weblate'
です。
ENABLE_AVATARS¶
ユーザーに対して Gravatar - ベースのアバターを有効化するかどうか。デフォルトでは、有効。
アバターはサーバー上で取得およびキャッシュされ、個人情報が漏洩するリスクが低くなり、ユーザー体験が高速化します。
ENABLE_HTTPS¶
Weblate へのリンクを HTTPS または HTTP として送信するかどうか。この設定は、送信したメールおよび生成した絶対 URL に影響します。
デフォルトの設定では、これは HTTPS に関連する複数の Django 設定にも使用されます - セキュアな Cookie を有効にしたり、HSTS を切り替えたり、HTTPS URL へのリダイレクションを有効にしたりします。
HTTPS リダイレクトには問題が発生することがあります。また、Django にプロトコル ヘッダーを正しく渡さない SSL 終了を行うリバース プロキシを使用している場合は、無限リダイレクトの問題が発生することがあります。X-Forwarded-Proto
または Forwarded
ヘッダーを出力するようにリバース プロキシを設定するか、Django が SSL ステータスを正しく検出できるように SECURE_PROXY_SSL_HEADER
を設定してください。
ENABLE_SHARING¶
ユーザーが翻訳の進捗状況をソーシャル ネットワーク上で共有できるように、共有 メニューの on/off を切り替えます。
GITLAB_CREDENTIALS¶
バージョン 4.3 で追加.
GitLab サーバーの資格情報の一覧。
ヒント
Weblate を多くの GitLab エンドポイントと相互作用させたい場合、単一の GitLab エンドポイントの GITLAB_USERNAME
および GITLAB_TOKEN
を貼り付けて使用します。
GITLAB_CREDENTIALS = {
"gitlab.com": {
"username": "weblate",
"token": "your-api-token",
},
"gitlab.example.com": {
"username": "weblate",
"token": "another-api-token",
},
}
GITHUB_CREDENTIALS¶
バージョン 4.3 で追加.
GitHub サーバーの資格情報の一覧。
ヒント
Weblate を多くの GitHub エンドポイントと相互作用させたい場合、単一の GitHub エンドポイントの GITHUB_USERNAME
および GITHUB_TOKEN
を貼り付けて使用します。
GITHUB_CREDENTIALS = {
"api.github.com": {
"username": "weblate",
"token": "your-api-token",
},
"github.example.com": {
"username": "weblate",
"token": "another-api-token",
},
}
GOOGLE_ANALYTICS_ID¶
Google アナリティクス ID を使用して Weblate の監視を有効にします。
HIDE_REPO_CREDENTIALS¶
Web インターフェイスのリポジトリの認証情報を非表示にします。リポジトリの URL にユーザーとパスワードが設定されている場合、関連情報をユーザーに表示するときには、Weblate がその URL を非表示にします。
例えば https://user:password@git.example.com/repo.git
の代わりに https://git.example.com/repo.git`
を表示します。VCS のエラーメッセージも同様の方法で消去を試します。
注釈
これはデフォルトで有効です。
HIDE_VERSION¶
バージョン 4.3.1 で追加.
認証していないユーザーにはバージョン情報を表示しません。また、これにより、すべてのドキュメントリンクは、現在インストールされているバージョンに一致するドキュメントではなく、最新バージョンを参照します。
一部の企業ではバージョンの非表示が推奨されていますが、攻撃者が動作を調査してバージョンを特定することを阻止できません。
注釈
デフォルトで無効です。
IP_BEHIND_REVERSE_PROXY¶
バージョン 2.14 で追加.
Weblate がリバース プロキシの背後で動作しているかどうかを示します。
True
に設定されている場合、Weblate は IP_PROXY_HEADER
で定義したヘッダーから IP アドレスを取得します。
警告
リバース プロキシを実際に使用していること、およびリバース プロキシがこのヘッダーを設定していることを確認します。リバース プロキシを使用していない場合、ユーザーは IP アドレスを偽装できます。
注釈
これはデフォルトで無効です。
IP_PROXY_HEADER¶
バージョン 2.14 で追加.
IP_BEHIND_REVERSE_PROXY
が有効の場合、Weblate がどのヘッダーから IP アドレスを取得するかを示します。
デフォルトは HTTP_X_FORWARDED_FOR
です。
IP_PROXY_OFFSET¶
バージョン 2.14 で追加.
クライアントの IP アドレスとして IP_PROXY_HEADER
のどの部分が使用されているかを示します。
設定により、このヘッダーが複数の IP アドレス(例: X-Forwarded-For: a, b, client-ip
)で構成されることがあります。ここで、ヘッダーのどのアドレスをクライアント IP アドレスとして使用するかどうかを設定できます。
警告
これを設定すると、インストールのセキュリティに影響します。IP アドレスの決定に信頼できるプロキシを使用するように設定するだけです。
デフォルトは 0 です。
LEGAL_URL¶
バージョン 3.5 で追加.
Weblate インスタンスが法的文書を表示する URL。
ヒント
Weblateの外部で法的な文書をホスティングしている場合、Weblateの内部に埋め込むのに便利です。詳細は 法律上の告知事項 を確認してください。
例:
LEGAL_URL = "https://weblate.org/terms/"
LICENSE_EXTRA¶
ライセンスの選択肢に含める追加ライセンス。
注釈
各ライセンス定義は、短い名前、長い名前、および URL のタプルであることが必要です。
例:
LICENSE_EXTRA = [
(
"AGPL-3.0",
"GNU Affero General Public License v3.0",
"https://www.gnu.org/licenses/agpl-3.0-standalone.html",
),
]
LICENSE_FILTER¶
バージョン 4.3 で変更: これを空の値に設定すると、ライセンス警告が無効になります。
表示するライセンスのフィルタ リスト。これにより、空に設定した場合のライセンス警告も無効になります。
注釈
このフィルタは、短いライセンス名を使用します。
例:
LICENSE_FILTER = {"AGPL-3.0", "GPL-3.0-or-later"}
ライセンス警告を無効にする方法:
LICENSE_FILTER = set()
LIMIT_TRANSLATION_LENGTH_BY_SOURCE_LENGTH¶
与えられた翻訳の長さを制限するかどうか。制限は、原文の文字列の長さ * 10 文字です。
ヒント
これを False
に設定すると、原文の長さに関係なく、より長い翻訳(10,000 文字まで)が可能になります。
注釈
デフォルトは True
です。
LOCALIZE_CDN_URL および LOCALIZE_CDN_PATH¶
これらの設定は JavaScript 現地語化 CDN アドオンを設定します。 LOCALIZE_CDN_URL
は現地語化 CDN が利用可能なルート URL を定義し、LOCALIZE_CDN_PATH
は LOCALIZE_CDN_URL
で提供される生成ファイルを Weblate がどこに保存するかパスを定義します。
ヒント
Hosted Weblate では、https://weblate-cdn.com/
を使用します。
LOGIN_REQUIRED_URLS¶
ログインが必要な URL の一覧。(Weblate に標準設定済み以外の規則)。
ヒント
これにより、以下方法でインストール全体をパスワードで保護:
LOGIN_REQUIRED_URLS = (r"/(.*)$",)
REST_FRAMEWORK["DEFAULT_PERMISSION_CLASSES"] = [
"rest_framework.permissions.IsAuthenticated"
]
ヒント
上記の例に示すように、API 接続も隔離することが望ましいです。
LOGIN_REQUIRED_URLS_EXCEPTIONS¶
LOGIN_REQUIRED_URLS
の例外リスト。指定しない場合、ユーザーはサイン イン ページにアクセスできます。
含めたい例外の設定方法:
LOGIN_REQUIRED_URLS_EXCEPTIONS = (
r"/accounts/(.*)$", # Required for sign in
r"/static/(.*)$", # Required for development mode
r"/widgets/(.*)$", # Allowing public access to widgets
r"/data/(.*)$", # Allowing public access to data exports
r"/hooks/(.*)$", # Allowing public access to notification hooks
r"/api/(.*)$", # Allowing access to API
r"/js/i18n/$", # JavaScript localization
)
MATOMO_URL¶
Weblate の使用を追跡するために使用する Matomo(以前の Piwik)インストールの完全な URL(末尾のスラッシュを含む)。詳細は <https://matomo.org/> を確認してください。
ヒント
この統合は、Matomo タグ マネージャーに対応していません。
例:
MATOMO_SITE_ID = 1
MATOMO_URL = "https://example.matomo.cloud/"
MT_SERVICES¶
バージョン 3.0 で変更: 設定名は、他の機械翻訳設定と整合性を保つため MACHINE_TRANSLATION_SERVICES
から MT_SERVICES
に変更しました。
使用できる有効な機械翻訳サービスの一覧。
注釈
多くのサービスは API 鍵のような追加の設定が必要ですが、詳細については 機械翻訳 のドキュメントをご覧ください。
MT_SERVICES = (
"weblate.machinery.apertium.ApertiumAPYTranslation",
"weblate.machinery.deepl.DeepLTranslation",
"weblate.machinery.glosbe.GlosbeTranslation",
"weblate.machinery.google.GoogleTranslation",
"weblate.machinery.microsoft.MicrosoftCognitiveTranslation",
"weblate.machinery.microsoftterminology.MicrosoftTerminologyService",
"weblate.machinery.mymemory.MyMemoryTranslation",
"weblate.machinery.tmserver.AmagamaTranslation",
"weblate.machinery.tmserver.TMServerTranslation",
"weblate.machinery.yandex.YandexTranslation",
"weblate.machinery.weblatetm.WeblateTranslation",
"weblate.machinery.saptranslationhub.SAPTranslationHub",
"weblate.memory.machine.WeblateMemory",
)
MT_APERTIUM_APY¶
Apertium-APy サーバーの URL、 https://wiki.apertium.org/wiki/Apertium-apy
MT_BAIDU_ID¶
Baidu Zhiyun API のクライアント ID は、https://api.fanyi.baidu.com/api/trans/product/index から登録
MT_BAIDU_SECRET¶
Baidu Zhiyun API のクライアント シークレットは、https://api.fanyi.baidu.com/api/trans/product/index から登録
MT_DEEPL_API_VERSION¶
バージョン 4.1.1 で追加.
DeepL サービスで使用する API のバージョン。バージョンによって利用範囲が制限されます。
- v1
CAT ツール用であり、ユーザー ベースのサブスクリプションで使用できます。
- v2
API の使用を想定しており、サブスクリプションは使用量ベースです。
以前 Weblate は DeepL によって CAT ツールとして分類されていたため、v1 API を使用することになっていましたが、現在は v2 API を使用することになっています。そのため、デフォルトは v2 になっており、デフォルトの CAT サブスクリプションを持っていて Weblate がそのサブスクリプションを使用したい場合は v1 に変更できます。
MT_GOOGLE_KEY¶
Google Translate API v2 の API 鍵、register at https://cloud.google.com/translate/docs から登録
MT_GOOGLE_CREDENTIALS¶
Google クラウド コンソールで取得した API v3 JSON 認証情報ファイル。完全な OS のパスを指定してください。資格情報は、特定のプロジェクトと関連付けられているサービス アカウントごとに行われます。詳細は https://cloud.google.com/docs/authentication/getting-started を確認してください。
MT_GOOGLE_PROJECT¶
Google クラウド API v3 プロジェクト ID で、翻訳サービスと請求が有効になっています。詳細は https://cloud.google.com/appengine/docs/standard/nodejs/building-app/creating-project を確認してください
MT_GOOGLE_LOCATION¶
API v3 Google クラウド アプリ エンジンは、ロケーション固有の設定があります。デフォルトの global
フォールバックが機能しない場合は、状況に応じて変更してください。
詳細は https://cloud.google.com/appengine/docs/locations を確認してください
MT_MICROSOFT_BASE_URL¶
"Base URLs" セクション で定義されているリージョン ベース URL ドメイン。
Azure グローバルのデフォルトは api.cognitive.microsofttranslator.com
です。
Azure China の場合は、api.translator.azure.cn
を使用してください。
MT_MICROSOFT_COGNITIVE_KEY¶
Microsoft Cognitive Services Translator API のクライアント鍵です。
MT_MICROSOFT_REGION¶
"マルチ サービス リソースによる認証" セクションで定義されているリージョン接頭辞。
MT_MICROSOFT_ENDPOINT_URL¶
"アクセス トークンを使用した認証" セクション で定義されているアクセス トークンのリージョン エンドポイント URL ドメイン 。
Azure グローバルのデフォルトは api.cognitive.microsoft.com
です。
Azure China の場合は、Azure ポータルからエンドポイントを使用してください。
MT_MODERNMT_URL¶
ModernMT の URL。クラウド サービスのデフォルトは https://api.modernmt.com/
です。
MT_MYMEMORY_EMAIL¶
MyMemory 識別用のメールアドレス。1 日あたり 1000 件のリクエストを許可します。
MT_MYMEMORY_KEY¶
プライベート翻訳メモリ用の MyMemory アクセス鍵は、MT_MYMEMORY_USER
とセットで使用します。
MT_MYMEMORY_USER¶
プライベート翻訳メモリ用の MyMemory ユーザー ID は、MT_MYMEMORY_KEY
とセットで使用します。
MT_NETEASE_KEY¶
NetEase Sight API の App key、https://sight.youdao.com/ から登録
MT_NETEASE_SECRET¶
NetEase Sight API の App secret、https://sight.youdao.com/ から登録
MT_YANDEX_KEY¶
Yandex Translate API の API key、https://yandex.com/dev/translate/ から登録
MT_YOUDAO_ID¶
Youdao Zhiyun API のクライアント ID は、https://ai.youdao.com/product-fanyi-text.s から登録
MT_YOUDAO_SECRET¶
Youdao Zhiyun API の Client secret は、https://ai.youdao.com/product-fanyi-text.s から登録
MT_SAP_USE_MT¶
用語データベースに追加して、機械翻訳サービスも使用するかどうか。指定できる値: True
または False
PAGURE_CREDENTIALS¶
バージョン 4.3.2 で追加.
Pagure サーバーの資格情報の一覧です。
ヒント
Weblate を多くの Pagure エンドポイントと相互作用させたい場合、単一の Pagure エンドポイントの PAGURE_USERNAME
および PAGURE_TOKEN
を貼り付けて使用します。
PAGURE_CREDENTIALS = {
"pagure.io": {
"username": "weblate",
"token": "your-api-token",
},
"pagure.example.com": {
"username": "weblate",
"token": "another-api-token",
},
}
REGISTRATION_ALLOW_BACKENDS¶
バージョン 4.1 で追加.
登録を許可する認証バックエンドの一覧。これは新しい登録のみを制限し、ユーザーは設定済みのすべての認証バックエンドを使用して認証を行い、認証を追加できます。
登録バックエンドを制限しながら REGISTRATION_OPEN
を有効にしておくことを推奨しますが、それ以外の場合、ユーザーは登録できるが、Weblate ではユーザー インターフェイスに登録するためのリンクは表示されません。
例:
REGISTRATION_ALLOW_BACKENDS = ["azuread-oauth2", "azuread-tenant-oauth2"]
ヒント
バックエンド名は、認証用の URL で使用する名前と一致させます。
REGISTRATION_CAPTCHA¶
新規アカウント登録を CAPTCHA で保護するかどうかを示す値を True
または False
で指定します。この設定はオプションであり、指定しなかった場合はデフォルトの True
が設定されます。
有効にすると、ユーザーがメール アドレスを入力して CAPTCHA が追加されるすべてのページ:
新規アカウント登録。
パスワードの回復。
アカウントへのメールアドレスの追加。
サイン インしていないユーザーへの連絡フォーム。
REGISTRATION_EMAIL_MATCH¶
バージョン 2.17 で追加.
登録できるメール アドレスをフィルタ処理できます。
デフォルトは .*
、どのようなメールアドレスでも登録できます。
登録を単一のメール アドレスドメインに制限する方法:
REGISTRATION_EMAIL_MATCH = r"^.*@weblate\.org$"
REGISTRATION_OPEN¶
現在、新規アカウントの登録を許可しているかどうか。このオプションの設定はデフォルトの True
のままでも False
に変更してもかまいません。
この設定はメールアドレスによる標準搭載の認証や Python Social Auth による認証に影響します(:setting:`REGISTRATION_ALLOW_BACKENDS`で特定のバックエンドをホワイトリストに登録できます)。
注釈
LDAP 認証 などのサード パーティ認証方法を使用している場合、登録フォームは非表示になりますが、新しいユーザーがサイン インしてアカウントを作成できることがあります。
REQUIRE_LOGIN¶
バージョン 4.1 で追加.
これにより LOGIN_REQUIRED_URLS
が有効になり、REST フレームワークがすべての API エンドポイントに対して認証を要求するように設定されます。
注釈
これは 設定例 に実装されています。Docker の場合は WEBLATE_REQUIRE_LOGIN
を使用します。
SESSION_COOKIE_AGE_AUTHENTICATED¶
バージョン 4.3 で追加.
認証済みユーザーのセッションの有効期限を設定します。これは認証されていないユーザーのために使用される SESSION_COOKIE_AGE
を補完するものです。
SIMPLIFY_LANGUAGES¶
デフォルトの言語と国の組み合わせには単純な言語コードを使用します。例えば fr_FR
の翻訳は fr
の言語コードを使用します。これは通常、デフォルトの組み合わせの言語の一覧を簡単化する理想的な方法です。
つづりごとに異なる翻訳を行う場合は、この機能を無効にします。
SITE_DOMAIN¶
サイト ドメインを設定します。これは、多くの範囲(例: アクティベーション メールアドレス、通知、RSS フィード)で正しい絶対リンクを生成するために必要です。
Weblate を非標準ポートで実行している場合は、ここにも含めてください。
例:
# Production site with domain name
SITE_DOMAIN = "weblate.example.com"
# Local development with IP address and port
SITE_DOMAIN = "127.0.0.1:8000"
注釈
この設定には、ドメイン名だけを含めてください。プロトコルの設定(HTTPS の有効化と強制)には ENABLE_HTTPS
を使用し、URL の変更には URL_PREFIX
を使用します。
ヒント
Docker コンテナ上では、サイト ドメインは WEBLATE_ALLOWED_HOSTS
で設定します。
SITE_TITLE¶
Web サイトおよびメール送信に使用するサイト名。
SINGLE_PROJECT¶
バージョン 3.8 で追加.
ダッシュボードを表示する代わりに、プロジェクトまたはコンポーネントにユーザーを直接リダイレクトします。True
に設定できるが、この場合は、実際に Weblate にプロジェクトが 1 つしか存在していない場合にのみ機能します。または、プロジェクトのスラッグを設定すると、このプロジェクトに無条件にリダイレクトされます。
バージョン 3.11 で変更: この設定では、単一のプロジェクトを強制的に表示するために、プロジェクトのスラッグも受け付けるようになりました。
例:
SINGLE_PROJECT = "test"
STATUS_URL¶
Weblate インスタンスが状況を報告する URL。
UPDATE_LANGUAGES¶
バージョン 4.3.2 で追加.
データベースを移行する場合、言語データベースを更新するかどうかを判断します。デフォルトは有効。この設定は setuplang
の呼び出しには影響しません。
参考
URL_PREFIX¶
この設定では、Weblate を指定したパスで実行できます(そうでない場合は、Weblate サーバーのルートからの実行に依存します)。
注釈
この設定を使用するには、この接頭辞を削除してサーバーを設定してください。例えば WSGI では、WSGIScriptAlias
を設定して実行できます。
ヒント
接頭辞は /
で開始してください。
例:
URL_PREFIX = "/translations"
注釈
この設定は Django に標準搭載されたサーバーでは動作しません。urls.py
を設定して接頭辞を含めることが必要です。
VCS_BACKENDS¶
使用可能な VCS バックエンドの設定。
注釈
Weblate は、対応しているすべてのバックエンドの使用を試します。
ヒント
これを使用して、選択を制限したり、カスタム VCS バックエンドを追加できます。
VCS_BACKENDS = ("weblate.vcs.git.GitRepository",)
参考
VCS_CLONE_DEPTH¶
バージョン 3.10.2 で追加.
Weblate がリポジトリをディープ クローンする深さを設定します。
注釈
現在のところ、これは Git でのみ対応しています。デフォルトでは、Weblate はリポジトリの浅いクローンを作成します。使い方によっては(例: カスタムの アドオン を使用している場合など)、この値を 0 に設定して浅いクローンを完全に無効にしたり、深さを増やすこともできます。
ヒント
Weblate からプッシュするときに fatal: protocol error: expected old/new/ref, got 'shallow <commit hash>'
エラーが発生した場合は、以下を設定して浅いクローンを完全に無効にします。
VCS_CLONE_DEPTH = 0
WEBLATE_ADDONS¶
使用可能なアドオンの一覧。これらを使用するには、特定の翻訳コンポーネントに対して有効にすることが必要です。デフォルトでは、標準搭載のアドオンはすべて含まれますが、一覧を増やす場合は、デフォルトのアドオンを有効することが必要です。
WEBLATE_ADDONS = (
# Built-in addons
"weblate.addons.gettext.GenerateMoAddon",
"weblate.addons.gettext.UpdateLinguasAddon",
"weblate.addons.gettext.UpdateConfigureAddon",
"weblate.addons.gettext.MsgmergeAddon",
"weblate.addons.gettext.GettextCustomizeAddon",
"weblate.addons.gettext.GettextAuthorComments",
"weblate.addons.cleanup.CleanupAddon",
"weblate.addons.consistency.LangaugeConsistencyAddon",
"weblate.addons.discovery.DiscoveryAddon",
"weblate.addons.flags.SourceEditAddon",
"weblate.addons.flags.TargetEditAddon",
"weblate.addons.flags.SameEditAddon",
"weblate.addons.flags.BulkEditAddon",
"weblate.addons.generate.GenerateFileAddon",
"weblate.addons.json.JSONCustomizeAddon",
"weblate.addons.properties.PropertiesSortAddon",
"weblate.addons.git.GitSquashAddon",
"weblate.addons.removal.RemoveComments",
"weblate.addons.removal.RemoveSuggestions",
"weblate.addons.resx.ResxUpdateAddon",
"weblate.addons.autotranslate.AutoTranslateAddon",
"weblate.addons.yaml.YAMLCustomizeAddon",
"weblate.addons.cdn.CDNJSAddon",
# Addon you want to include
"weblate.addons.example.ExampleAddon",
)
注釈
Weblate一覧からアドオンを削除しても、コンポーネントからはアンインストールされません。その場合、Weblate はクラッシュします。この一覧から削除する前に、すべてのコンポーネントからアドオンをアンインストールしてください。
WEBLATE_GPG_IDENTITY¶
バージョン 3.1 で追加.
Weblate が Git コミットに署名するために使用する ID。設定例:
WEBLATE_GPG_IDENTITY = "Weblate <weblate@example.com>"
Weblate GPG キーリングは、一致するキーを探します(DATA_DIR
の下で home/.gnupg
)。見つからない場合はキーが生成されます、詳細は Signing Git commits with GnuPG を確認してください。
WEBSITE_REQUIRED¶
Defines whether プロジェクトの Web サイト has to be specified when creating a project. Turned on by default as that suits public server setups.
設定例¶
Weblate が設定例として同梱している weblate/settings_example.py
:
#
# Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
import os
import platform
from logging.handlers import SysLogHandler
#
# Django settings for Weblate project.
#
DEBUG = True
ADMINS = (
# ("Your Name", "your_email@example.com"),
)
MANAGERS = ADMINS
DATABASES = {
"default": {
# Use "postgresql" or "mysql".
"ENGINE": "django.db.backends.postgresql",
# Database name.
"NAME": "weblate",
# Database user.
"USER": "weblate",
# Name of role to alter to set parameters in PostgreSQL,
# use in case role name is different than user used for authentication.
# "ALTER_ROLE": "weblate",
# Database password.
"PASSWORD": "",
# Set to empty string for localhost.
"HOST": "127.0.0.1",
# Set to empty string for default.
"PORT": "",
# Customizations for databases.
"OPTIONS": {
# In case of using an older MySQL server,
# which has MyISAM as a default storage
# "init_command": "SET storage_engine=INNODB",
# Uncomment for MySQL older than 5.7:
# "init_command": "SET sql_mode='STRICT_TRANS_TABLES'",
# Set emoji capable charset for MySQL:
# "charset": "utf8mb4",
# Change connection timeout in case you get MySQL gone away error:
# "connect_timeout": 28800,
},
}
}
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Data directory
DATA_DIR = os.path.join(BASE_DIR, "data")
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# In a Windows environment this must be set to your system time zone.
TIME_ZONE = "UTC"
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = "en-us"
LANGUAGES = (
("ar", "العربية"),
("az", "Azərbaycan"),
("be", "Беларуская"),
("be@latin", "Biełaruskaja"),
("bg", "Български"),
("br", "Brezhoneg"),
("ca", "Català"),
("cs", "Čeština"),
("da", "Dansk"),
("de", "Deutsch"),
("en", "English"),
("el", "Ελληνικά"),
("en-gb", "English (United Kingdom)"),
("es", "Español"),
("fi", "Suomi"),
("fr", "Français"),
("gl", "Galego"),
("he", "עברית"),
("hu", "Magyar"),
("hr", "Hrvatski"),
("id", "Indonesia"),
("is", "Íslenska"),
("it", "Italiano"),
("ja", "日本語"),
("kab", "Taqbaylit"),
("kk", "Қазақ тілі"),
("ko", "한국어"),
("nb", "Norsk bokmål"),
("nl", "Nederlands"),
("pl", "Polski"),
("pt", "Português"),
("pt-br", "Português brasileiro"),
("ro", "Română"),
("ru", "Русский"),
("sk", "Slovenčina"),
("sl", "Slovenščina"),
("sq", "Shqip"),
("sr", "Српски"),
("sr-latn", "Srpski"),
("sv", "Svenska"),
("tr", "Türkçe"),
("uk", "Українська"),
("zh-hans", "简体字"),
("zh-hant", "正體字"),
)
SITE_ID = 1
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale.
USE_L10N = True
# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = True
# Type of automatic primary key, introduced in Django 3.2
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
# URL prefix to use, please see documentation for more details
URL_PREFIX = ""
# Absolute filesystem path to the directory that will hold user-uploaded files.
MEDIA_ROOT = os.path.join(DATA_DIR, "media")
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
MEDIA_URL = f"{URL_PREFIX}/media/"
# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
STATIC_ROOT = os.path.join(DATA_DIR, "static")
# URL prefix for static files.
STATIC_URL = f"{URL_PREFIX}/static/"
# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
"django.contrib.staticfiles.finders.FileSystemFinder",
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
"compressor.finders.CompressorFinder",
)
# Make this unique, and don't share it with anybody.
# You can generate it using weblate/examples/generate-secret-key
SECRET_KEY = ""
_TEMPLATE_LOADERS = [
"django.template.loaders.filesystem.Loader",
"django.template.loaders.app_directories.Loader",
]
if not DEBUG:
_TEMPLATE_LOADERS = [("django.template.loaders.cached.Loader", _TEMPLATE_LOADERS)]
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"OPTIONS": {
"context_processors": [
"django.contrib.auth.context_processors.auth",
"django.template.context_processors.debug",
"django.template.context_processors.i18n",
"django.template.context_processors.request",
"django.template.context_processors.csrf",
"django.contrib.messages.context_processors.messages",
"weblate.trans.context_processors.weblate_context",
],
"loaders": _TEMPLATE_LOADERS,
},
}
]
# GitHub username and token for sending pull requests.
# Please see the documentation for more details.
GITHUB_USERNAME = None
GITHUB_TOKEN = None
# GitLab username and token for sending merge requests.
# Please see the documentation for more details.
GITLAB_USERNAME = None
GITLAB_TOKEN = None
# Authentication configuration
AUTHENTICATION_BACKENDS = (
"social_core.backends.email.EmailAuth",
# "social_core.backends.google.GoogleOAuth2",
# "social_core.backends.github.GithubOAuth2",
# "social_core.backends.bitbucket.BitbucketOAuth",
# "social_core.backends.suse.OpenSUSEOpenId",
# "social_core.backends.ubuntu.UbuntuOpenId",
# "social_core.backends.fedora.FedoraOpenId",
# "social_core.backends.facebook.FacebookOAuth2",
"weblate.accounts.auth.WeblateUserBackend",
)
# Custom user model
AUTH_USER_MODEL = "weblate_auth.User"
# Social auth backends setup
SOCIAL_AUTH_GITHUB_KEY = ""
SOCIAL_AUTH_GITHUB_SECRET = ""
SOCIAL_AUTH_GITHUB_SCOPE = ["user:email"]
SOCIAL_AUTH_BITBUCKET_KEY = ""
SOCIAL_AUTH_BITBUCKET_SECRET = ""
SOCIAL_AUTH_BITBUCKET_VERIFIED_EMAILS_ONLY = True
SOCIAL_AUTH_FACEBOOK_KEY = ""
SOCIAL_AUTH_FACEBOOK_SECRET = ""
SOCIAL_AUTH_FACEBOOK_SCOPE = ["email", "public_profile"]
SOCIAL_AUTH_FACEBOOK_PROFILE_EXTRA_PARAMS = {"fields": "id,name,email"}
SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = ""
SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = ""
# Social auth settings
SOCIAL_AUTH_PIPELINE = (
"social_core.pipeline.social_auth.social_details",
"social_core.pipeline.social_auth.social_uid",
"social_core.pipeline.social_auth.auth_allowed",
"social_core.pipeline.social_auth.social_user",
"weblate.accounts.pipeline.store_params",
"weblate.accounts.pipeline.verify_open",
"social_core.pipeline.user.get_username",
"weblate.accounts.pipeline.require_email",
"social_core.pipeline.mail.mail_validation",
"weblate.accounts.pipeline.revoke_mail_code",
"weblate.accounts.pipeline.ensure_valid",
"weblate.accounts.pipeline.remove_account",
"social_core.pipeline.social_auth.associate_by_email",
"weblate.accounts.pipeline.reauthenticate",
"weblate.accounts.pipeline.verify_username",
"social_core.pipeline.user.create_user",
"social_core.pipeline.social_auth.associate_user",
"social_core.pipeline.social_auth.load_extra_data",
"weblate.accounts.pipeline.cleanup_next",
"weblate.accounts.pipeline.user_full_name",
"weblate.accounts.pipeline.store_email",
"weblate.accounts.pipeline.notify_connect",
"weblate.accounts.pipeline.password_reset",
)
SOCIAL_AUTH_DISCONNECT_PIPELINE = (
"social_core.pipeline.disconnect.allowed_to_disconnect",
"social_core.pipeline.disconnect.get_entries",
"social_core.pipeline.disconnect.revoke_tokens",
"weblate.accounts.pipeline.cycle_session",
"weblate.accounts.pipeline.adjust_primary_mail",
"weblate.accounts.pipeline.notify_disconnect",
"social_core.pipeline.disconnect.disconnect",
"weblate.accounts.pipeline.cleanup_next",
)
# Custom authentication strategy
SOCIAL_AUTH_STRATEGY = "weblate.accounts.strategy.WeblateStrategy"
# Raise exceptions so that we can handle them later
SOCIAL_AUTH_RAISE_EXCEPTIONS = True
SOCIAL_AUTH_EMAIL_VALIDATION_FUNCTION = "weblate.accounts.pipeline.send_validation"
SOCIAL_AUTH_EMAIL_VALIDATION_URL = f"{URL_PREFIX}/accounts/email-sent/"
SOCIAL_AUTH_LOGIN_ERROR_URL = f"{URL_PREFIX}/accounts/login/"
SOCIAL_AUTH_EMAIL_FORM_URL = f"{URL_PREFIX}/accounts/email/"
SOCIAL_AUTH_NEW_ASSOCIATION_REDIRECT_URL = f"{URL_PREFIX}/accounts/profile/#account"
SOCIAL_AUTH_PROTECTED_USER_FIELDS = ("email",)
SOCIAL_AUTH_SLUGIFY_USERNAMES = True
SOCIAL_AUTH_SLUGIFY_FUNCTION = "weblate.accounts.pipeline.slugify_username"
# Password validation configuration
AUTH_PASSWORD_VALIDATORS = [
{
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator" # noqa: E501, pylint: disable=line-too-long
},
{
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
"OPTIONS": {"min_length": 10},
},
{"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator"},
{"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"},
{"NAME": "weblate.accounts.password_validation.CharsPasswordValidator"},
{"NAME": "weblate.accounts.password_validation.PastPasswordsValidator"},
# Optional password strength validation by django-zxcvbn-password
# {
# "NAME": "zxcvbn_password.ZXCVBNValidator",
# "OPTIONS": {
# "min_score": 3,
# "user_attributes": ("username", "email", "full_name")
# }
# },
]
# Password hashing (prefer Argon)
PASSWORD_HASHERS = [
"django.contrib.auth.hashers.Argon2PasswordHasher",
"django.contrib.auth.hashers.PBKDF2PasswordHasher",
"django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher",
"django.contrib.auth.hashers.BCryptSHA256PasswordHasher",
]
# Allow new user registrations
REGISTRATION_OPEN = True
# Shortcut for login required setting
REQUIRE_LOGIN = False
# Middleware
MIDDLEWARE = [
"weblate.middleware.RedirectMiddleware",
"weblate.middleware.ProxyMiddleware",
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"weblate.accounts.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"social_django.middleware.SocialAuthExceptionMiddleware",
"weblate.accounts.middleware.RequireLoginMiddleware",
"weblate.api.middleware.ThrottlingMiddleware",
"weblate.middleware.SecurityMiddleware",
]
ROOT_URLCONF = "weblate.urls"
# Django and Weblate apps
INSTALLED_APPS = [
# Weblate apps on top to override Django locales and templates
"weblate.addons",
"weblate.auth",
"weblate.checks",
"weblate.formats",
"weblate.glossary",
"weblate.machinery",
"weblate.trans",
"weblate.lang",
"weblate_language_data",
"weblate.memory",
"weblate.screenshots",
"weblate.fonts",
"weblate.accounts",
"weblate.configuration",
"weblate.utils",
"weblate.vcs",
"weblate.wladmin",
"weblate.metrics",
"weblate",
# Optional: Git exporter
"weblate.gitexport",
# Standard Django modules
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"django.contrib.admin.apps.SimpleAdminConfig",
"django.contrib.admindocs",
"django.contrib.sitemaps",
"django.contrib.humanize",
# Third party Django modules
"social_django",
"crispy_forms",
"compressor",
"rest_framework",
"rest_framework.authtoken",
"django_filters",
]
# Custom exception reporter to include some details
DEFAULT_EXCEPTION_REPORTER_FILTER = "weblate.trans.debug.WeblateExceptionReporterFilter"
# Default logging of Weblate messages
# - to syslog in production (if available)
# - otherwise to console
# - you can also choose "logfile" to log into separate file
# after configuring it below
# Detect if we can connect to syslog
HAVE_SYSLOG = False
if platform.system() != "Windows":
try:
handler = SysLogHandler(address="/dev/log", facility=SysLogHandler.LOG_LOCAL2)
handler.close()
HAVE_SYSLOG = True
except OSError:
HAVE_SYSLOG = False
if DEBUG or not HAVE_SYSLOG:
DEFAULT_LOG = "console"
else:
DEFAULT_LOG = "syslog"
DEFAULT_LOGLEVEL = "DEBUG" if DEBUG else "INFO"
# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error when DEBUG=False.
# See http://docs.djangoproject.com/en/stable/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
"version": 1,
"disable_existing_loggers": True,
"filters": {"require_debug_false": {"()": "django.utils.log.RequireDebugFalse"}},
"formatters": {
"syslog": {"format": "weblate[%(process)d]: %(levelname)s %(message)s"},
"simple": {"format": "[%(asctime)s: %(levelname)s/%(process)s] %(message)s"},
"logfile": {"format": "%(asctime)s %(levelname)s %(message)s"},
"django.server": {
"()": "django.utils.log.ServerFormatter",
"format": "[%(server_time)s] %(message)s",
},
},
"handlers": {
"mail_admins": {
"level": "ERROR",
"filters": ["require_debug_false"],
"class": "django.utils.log.AdminEmailHandler",
"include_html": True,
},
"console": {
"level": "DEBUG",
"class": "logging.StreamHandler",
"formatter": "simple",
},
"django.server": {
"level": "INFO",
"class": "logging.StreamHandler",
"formatter": "django.server",
},
"syslog": {
"level": "DEBUG",
"class": "logging.handlers.SysLogHandler",
"formatter": "syslog",
"address": "/dev/log",
"facility": SysLogHandler.LOG_LOCAL2,
},
# Logging to a file
# "logfile": {
# "level":"DEBUG",
# "class":"logging.handlers.RotatingFileHandler",
# "filename": "/var/log/weblate/weblate.log",
# "maxBytes": 100000,
# "backupCount": 3,
# "formatter": "logfile",
# },
},
"loggers": {
"django.request": {
"handlers": ["mail_admins", DEFAULT_LOG],
"level": "ERROR",
"propagate": True,
},
"django.server": {
"handlers": ["django.server"],
"level": "INFO",
"propagate": False,
},
# Logging database queries
# "django.db.backends": {
# "handlers": [DEFAULT_LOG],
# "level": "DEBUG",
# },
"weblate": {"handlers": [DEFAULT_LOG], "level": DEFAULT_LOGLEVEL},
# Logging VCS operations
"weblate.vcs": {"handlers": [DEFAULT_LOG], "level": DEFAULT_LOGLEVEL},
# Python Social Auth
"social": {"handlers": [DEFAULT_LOG], "level": DEFAULT_LOGLEVEL},
# Django Authentication Using LDAP
"django_auth_ldap": {"handlers": [DEFAULT_LOG], "level": DEFAULT_LOGLEVEL},
# SAML IdP
"djangosaml2idp": {"handlers": [DEFAULT_LOG], "level": DEFAULT_LOGLEVEL},
},
}
# Remove syslog setup if it's not present
if not HAVE_SYSLOG:
del LOGGING["handlers"]["syslog"]
# List of machine translations
MT_SERVICES = (
# "weblate.machinery.apertium.ApertiumAPYTranslation",
# "weblate.machinery.baidu.BaiduTranslation",
# "weblate.machinery.deepl.DeepLTranslation",
# "weblate.machinery.glosbe.GlosbeTranslation",
# "weblate.machinery.google.GoogleTranslation",
# "weblate.machinery.googlev3.GoogleV3Translation",
# "weblate.machinery.microsoft.MicrosoftCognitiveTranslation",
# "weblate.machinery.microsoftterminology.MicrosoftTerminologyService",
# "weblate.machinery.modernmt.ModernMTTranslation",
# "weblate.machinery.mymemory.MyMemoryTranslation",
# "weblate.machinery.netease.NeteaseSightTranslation",
# "weblate.machinery.tmserver.AmagamaTranslation",
# "weblate.machinery.tmserver.TMServerTranslation",
# "weblate.machinery.yandex.YandexTranslation",
# "weblate.machinery.saptranslationhub.SAPTranslationHub",
# "weblate.machinery.youdao.YoudaoTranslation",
"weblate.machinery.weblatetm.WeblateTranslation",
"weblate.memory.machine.WeblateMemory",
)
# Machine translation API keys
# URL of the Apertium APy server
MT_APERTIUM_APY = None
# DeepL API key
MT_DEEPL_KEY = None
# Microsoft Cognitive Services Translator API, register at
# https://portal.azure.com/
MT_MICROSOFT_COGNITIVE_KEY = None
MT_MICROSOFT_REGION = None
# ModernMT
MT_MODERNMT_KEY = None
# MyMemory identification email, see
# https://mymemory.translated.net/doc/spec.php
MT_MYMEMORY_EMAIL = None
# Optional MyMemory credentials to access private translation memory
MT_MYMEMORY_USER = None
MT_MYMEMORY_KEY = None
# Google API key for Google Translate API v2
MT_GOOGLE_KEY = None
# Google Translate API3 credentials and project id
MT_GOOGLE_CREDENTIALS = None
MT_GOOGLE_PROJECT = None
# Baidu app key and secret
MT_BAIDU_ID = None
MT_BAIDU_SECRET = None
# Youdao Zhiyun app key and secret
MT_YOUDAO_ID = None
MT_YOUDAO_SECRET = None
# Netease Sight (Jianwai) app key and secret
MT_NETEASE_KEY = None
MT_NETEASE_SECRET = None
# API key for Yandex Translate API
MT_YANDEX_KEY = None
# tmserver URL
MT_TMSERVER = None
# SAP Translation Hub
MT_SAP_BASE_URL = None
MT_SAP_SANDBOX_APIKEY = None
MT_SAP_USERNAME = None
MT_SAP_PASSWORD = None
MT_SAP_USE_MT = True
# Title of site to use
SITE_TITLE = "Weblate"
# Site domain
SITE_DOMAIN = ""
# Whether site uses https
ENABLE_HTTPS = False
# Use HTTPS when creating redirect URLs for social authentication, see
# documentation for more details:
# https://python-social-auth-docs.readthedocs.io/en/latest/configuration/settings.html#processing-redirects-and-urlopen
SOCIAL_AUTH_REDIRECT_IS_HTTPS = ENABLE_HTTPS
# Make CSRF cookie HttpOnly, see documentation for more details:
# https://docs.djangoproject.com/en/1.11/ref/settings/#csrf-cookie-httponly
CSRF_COOKIE_HTTPONLY = True
CSRF_COOKIE_SECURE = ENABLE_HTTPS
# Store CSRF token in session
CSRF_USE_SESSIONS = True
# Customize CSRF failure view
CSRF_FAILURE_VIEW = "weblate.trans.views.error.csrf_failure"
SESSION_COOKIE_SECURE = ENABLE_HTTPS
SESSION_COOKIE_HTTPONLY = True
# SSL redirect
SECURE_SSL_REDIRECT = ENABLE_HTTPS
# Sent referrrer only for same origin links
SECURE_REFERRER_POLICY = "same-origin"
# SSL redirect URL exemption list
SECURE_REDIRECT_EXEMPT = (r"healthz/$",) # Allowing HTTP access to health check
# Session cookie age (in seconds)
SESSION_COOKIE_AGE = 1000
SESSION_COOKIE_AGE_AUTHENTICATED = 1209600
SESSION_COOKIE_SAMESITE = "Lax"
# Increase allowed upload size
DATA_UPLOAD_MAX_MEMORY_SIZE = 50000000
# Apply session coookie settings to language cookie as ewll
LANGUAGE_COOKIE_SECURE = SESSION_COOKIE_SECURE
LANGUAGE_COOKIE_HTTPONLY = SESSION_COOKIE_HTTPONLY
LANGUAGE_COOKIE_AGE = SESSION_COOKIE_AGE_AUTHENTICATED * 10
LANGUAGE_COOKIE_SAMESITE = SESSION_COOKIE_SAMESITE
# Some security headers
SECURE_BROWSER_XSS_FILTER = True
X_FRAME_OPTIONS = "DENY"
SECURE_CONTENT_TYPE_NOSNIFF = True
# Optionally enable HSTS
SECURE_HSTS_SECONDS = 31536000 if ENABLE_HTTPS else 0
SECURE_HSTS_PRELOAD = ENABLE_HTTPS
SECURE_HSTS_INCLUDE_SUBDOMAINS = ENABLE_HTTPS
# HTTPS detection behind reverse proxy
SECURE_PROXY_SSL_HEADER = None
# URL of login
LOGIN_URL = f"{URL_PREFIX}/accounts/login/"
# URL of logout
LOGOUT_URL = f"{URL_PREFIX}/accounts/logout/"
# Default location for login
LOGIN_REDIRECT_URL = f"{URL_PREFIX}/"
# Anonymous user name
ANONYMOUS_USER_NAME = "anonymous"
# Reverse proxy settings
IP_PROXY_HEADER = "HTTP_X_FORWARDED_FOR"
IP_BEHIND_REVERSE_PROXY = False
IP_PROXY_OFFSET = 0
# Sending HTML in mails
EMAIL_SEND_HTML = True
# Subject of emails includes site title
EMAIL_SUBJECT_PREFIX = f"[{SITE_TITLE}] "
# Enable remote hooks
ENABLE_HOOKS = True
# By default the length of a given translation is limited to the length of
# the source string * 10 characters. Set this option to False to allow longer
# translations (up to 10.000 characters)
LIMIT_TRANSLATION_LENGTH_BY_SOURCE_LENGTH = True
# Use simple language codes for default language/country combinations
SIMPLIFY_LANGUAGES = True
# Render forms using bootstrap
CRISPY_TEMPLATE_PACK = "bootstrap3"
# List of quality checks
# CHECK_LIST = (
# "weblate.checks.same.SameCheck",
# "weblate.checks.chars.BeginNewlineCheck",
# "weblate.checks.chars.EndNewlineCheck",
# "weblate.checks.chars.BeginSpaceCheck",
# "weblate.checks.chars.EndSpaceCheck",
# "weblate.checks.chars.DoubleSpaceCheck",
# "weblate.checks.chars.EndStopCheck",
# "weblate.checks.chars.EndColonCheck",
# "weblate.checks.chars.EndQuestionCheck",
# "weblate.checks.chars.EndExclamationCheck",
# "weblate.checks.chars.EndEllipsisCheck",
# "weblate.checks.chars.EndSemicolonCheck",
# "weblate.checks.chars.MaxLengthCheck",
# "weblate.checks.chars.KashidaCheck",
# "weblate.checks.chars.PunctuationSpacingCheck",
# "weblate.checks.format.PythonFormatCheck",
# "weblate.checks.format.PythonBraceFormatCheck",
# "weblate.checks.format.PHPFormatCheck",
# "weblate.checks.format.CFormatCheck",
# "weblate.checks.format.PerlFormatCheck",
# "weblate.checks.format.JavaScriptFormatCheck",
# "weblate.checks.format.LuaFormatCheck",
# "weblate.checks.format.SchemeFormatCheck",
# "weblate.checks.format.CSharpFormatCheck",
# "weblate.checks.format.JavaFormatCheck",
# "weblate.checks.format.JavaMessageFormatCheck",
# "weblate.checks.format.PercentPlaceholdersCheck",
# "weblate.checks.format.VueFormattingCheck",
# "weblate.checks.format.I18NextInterpolationCheck",
# "weblate.checks.format.ESTemplateLiteralsCheck",
# "weblate.checks.angularjs.AngularJSInterpolationCheck",
# "weblate.checks.qt.QtFormatCheck",
# "weblate.checks.qt.QtPluralCheck",
# "weblate.checks.ruby.RubyFormatCheck",
# "weblate.checks.consistency.PluralsCheck",
# "weblate.checks.consistency.SamePluralsCheck",
# "weblate.checks.consistency.ConsistencyCheck",
# "weblate.checks.consistency.TranslatedCheck",
# "weblate.checks.chars.EscapedNewlineCountingCheck",
# "weblate.checks.chars.NewLineCountCheck",
# "weblate.checks.markup.BBCodeCheck",
# "weblate.checks.chars.ZeroWidthSpaceCheck",
# "weblate.checks.render.MaxSizeCheck",
# "weblate.checks.markup.XMLValidityCheck",
# "weblate.checks.markup.XMLTagsCheck",
# "weblate.checks.markup.MarkdownRefLinkCheck",
# "weblate.checks.markup.MarkdownLinkCheck",
# "weblate.checks.markup.MarkdownSyntaxCheck",
# "weblate.checks.markup.URLCheck",
# "weblate.checks.markup.SafeHTMLCheck",
# "weblate.checks.placeholders.PlaceholderCheck",
# "weblate.checks.placeholders.RegexCheck",
# "weblate.checks.duplicate.DuplicateCheck",
# "weblate.checks.source.OptionalPluralCheck",
# "weblate.checks.source.EllipsisCheck",
# "weblate.checks.source.MultipleFailingCheck",
# "weblate.checks.source.LongUntranslatedCheck",
# "weblate.checks.format.MultipleUnnamedFormatsCheck",
# "weblate.checks.glossary.GlossaryCheck",
# )
# List of automatic fixups
# AUTOFIX_LIST = (
# "weblate.trans.autofixes.whitespace.SameBookendingWhitespace",
# "weblate.trans.autofixes.chars.ReplaceTrailingDotsWithEllipsis",
# "weblate.trans.autofixes.chars.RemoveZeroSpace",
# "weblate.trans.autofixes.chars.RemoveControlChars",
# )
# List of enabled addons
# WEBLATE_ADDONS = (
# "weblate.addons.gettext.GenerateMoAddon",
# "weblate.addons.gettext.UpdateLinguasAddon",
# "weblate.addons.gettext.UpdateConfigureAddon",
# "weblate.addons.gettext.MsgmergeAddon",
# "weblate.addons.gettext.GettextCustomizeAddon",
# "weblate.addons.gettext.GettextAuthorComments",
# "weblate.addons.cleanup.CleanupAddon",
# "weblate.addons.cleanup.RemoveBlankAddon",
# "weblate.addons.consistency.LangaugeConsistencyAddon",
# "weblate.addons.discovery.DiscoveryAddon",
# "weblate.addons.autotranslate.AutoTranslateAddon",
# "weblate.addons.flags.SourceEditAddon",
# "weblate.addons.flags.TargetEditAddon",
# "weblate.addons.flags.SameEditAddon",
# "weblate.addons.flags.BulkEditAddon",
# "weblate.addons.generate.GenerateFileAddon",
# "weblate.addons.generate.PseudolocaleAddon",
# "weblate.addons.json.JSONCustomizeAddon",
# "weblate.addons.properties.PropertiesSortAddon",
# "weblate.addons.git.GitSquashAddon",
# "weblate.addons.removal.RemoveComments",
# "weblate.addons.removal.RemoveSuggestions",
# "weblate.addons.resx.ResxUpdateAddon",
# "weblate.addons.yaml.YAMLCustomizeAddon",
# "weblate.addons.cdn.CDNJSAddon",
# )
# E-mail address that error messages come from.
SERVER_EMAIL = "noreply@example.com"
# Default email address to use for various automated correspondence from
# the site managers. Used for registration emails.
DEFAULT_FROM_EMAIL = "noreply@example.com"
# List of URLs your site is supposed to serve
ALLOWED_HOSTS = ["*"]
# Configuration for caching
CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://127.0.0.1:6379/1",
# If redis is running on same host as Weblate, you might
# want to use unix sockets instead:
# "LOCATION": "unix:///var/run/redis/redis.sock?db=1",
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
"PARSER_CLASS": "redis.connection.HiredisParser",
# If you set password here, adjust CELERY_BROKER_URL as well
"PASSWORD": None,
"CONNECTION_POOL_KWARGS": {},
},
"KEY_PREFIX": "weblate",
},
"avatar": {
"BACKEND": "django.core.cache.backends.filebased.FileBasedCache",
"LOCATION": os.path.join(DATA_DIR, "avatar-cache"),
"TIMEOUT": 86400,
"OPTIONS": {"MAX_ENTRIES": 1000},
},
}
# Store sessions in cache
SESSION_ENGINE = "django.contrib.sessions.backends.cache"
# Store messages in session
MESSAGE_STORAGE = "django.contrib.messages.storage.session.SessionStorage"
# REST framework settings for API
REST_FRAMEWORK = {
# Use Django's standard `django.contrib.auth` permissions,
# or allow read-only access for unauthenticated users.
"DEFAULT_PERMISSION_CLASSES": [
# Require authentication for login required sites
"rest_framework.permissions.IsAuthenticated"
if REQUIRE_LOGIN
else "rest_framework.permissions.IsAuthenticatedOrReadOnly"
],
"DEFAULT_AUTHENTICATION_CLASSES": (
"rest_framework.authentication.TokenAuthentication",
"weblate.api.authentication.BearerAuthentication",
"rest_framework.authentication.SessionAuthentication",
),
"DEFAULT_THROTTLE_CLASSES": (
"weblate.api.throttling.UserRateThrottle",
"weblate.api.throttling.AnonRateThrottle",
),
"DEFAULT_THROTTLE_RATES": {"anon": "100/day", "user": "5000/hour"},
"DEFAULT_PAGINATION_CLASS": ("rest_framework.pagination.PageNumberPagination"),
"PAGE_SIZE": 20,
"VIEW_DESCRIPTION_FUNCTION": "weblate.api.views.get_view_description",
"UNAUTHENTICATED_USER": "weblate.auth.models.get_anonymous",
}
# Fonts CDN URL
FONTS_CDN_URL = None
# Django compressor offline mode
COMPRESS_OFFLINE = False
COMPRESS_OFFLINE_CONTEXT = [
{"fonts_cdn_url": FONTS_CDN_URL, "STATIC_URL": STATIC_URL, "LANGUAGE_BIDI": True},
{"fonts_cdn_url": FONTS_CDN_URL, "STATIC_URL": STATIC_URL, "LANGUAGE_BIDI": False},
]
# Require login for all URLs
if REQUIRE_LOGIN:
LOGIN_REQUIRED_URLS = (r"/(.*)$",)
# In such case you will want to include some of the exceptions
# LOGIN_REQUIRED_URLS_EXCEPTIONS = (
# rf"{URL_PREFIX}/accounts/(.*)$", # Required for login
# rf"{URL_PREFIX}/admin/login/(.*)$", # Required for admin login
# rf"{URL_PREFIX}/static/(.*)$", # Required for development mode
# rf"{URL_PREFIX}/widgets/(.*)$", # Allowing public access to widgets
# rf"{URL_PREFIX}/data/(.*)$", # Allowing public access to data exports
# rf"{URL_PREFIX}/hooks/(.*)$", # Allowing public access to notification hooks
# rf"{URL_PREFIX}/healthz/$", # Allowing public access to health check
# rf"{URL_PREFIX}/api/(.*)$", # Allowing access to API
# rf"{URL_PREFIX}/js/i18n/$", # JavaScript localization
# rf"{URL_PREFIX}/contact/$", # Optional for contact form
# rf"{URL_PREFIX}/legal/(.*)$", # Optional for legal app
# )
# Silence some of the Django system checks
SILENCED_SYSTEM_CHECKS = [
# We have modified django.contrib.auth.middleware.AuthenticationMiddleware
# as weblate.accounts.middleware.AuthenticationMiddleware
"admin.E408"
]
# Celery worker configuration for testing
# CELERY_TASK_ALWAYS_EAGER = True
# CELERY_BROKER_URL = "memory://"
# CELERY_TASK_EAGER_PROPAGATES = True
# Celery worker configuration for production
CELERY_TASK_ALWAYS_EAGER = False
CELERY_BROKER_URL = "redis://localhost:6379"
CELERY_RESULT_BACKEND = CELERY_BROKER_URL
# Celery settings, it is not recommended to change these
CELERY_WORKER_MAX_MEMORY_PER_CHILD = 200000
CELERY_BEAT_SCHEDULE_FILENAME = os.path.join(DATA_DIR, "celery", "beat-schedule")
CELERY_TASK_ROUTES = {
"weblate.trans.tasks.auto_translate*": {"queue": "translate"},
"weblate.accounts.tasks.notify_*": {"queue": "notify"},
"weblate.accounts.tasks.send_mails": {"queue": "notify"},
"weblate.utils.tasks.settings_backup": {"queue": "backup"},
"weblate.utils.tasks.database_backup": {"queue": "backup"},
"weblate.wladmin.tasks.backup": {"queue": "backup"},
"weblate.wladmin.tasks.backup_service": {"queue": "backup"},
"weblate.memory.tasks.*": {"queue": "memory"},
}
# Enable plain database backups
DATABASE_BACKUP = "plain"
# Enable auto updating
AUTO_UPDATE = False
# PGP commits signing
WEBLATE_GPG_IDENTITY = None
# Third party services integration
MATOMO_SITE_ID = None
MATOMO_URL = None
GOOGLE_ANALYTICS_ID = None
SENTRY_DSN = None
SENTRY_ENVIRONMENT = None
AKISMET_API_KEY = None
Management commands¶
注釈
Running management commands under a different user than the one running your webserver can result in files getting wrong permissions, please check ファイル システムのアクセス権 for more details.
You will find basic management commands (available as ./manage.py
in the Django sources,
or as an extended set in a script called weblate installable atop Weblate).
Invoking management commands¶
As mentioned before, invocation depends on how you installed Weblate.
If using virtualenv for Weblate, you can either specify the full path to weblate, or activate the virtualenv prior to invoking it:
# Direct invocation
~/weblate-env/bin/weblate
# Activating virtualenv adds it to search path
. ~/weblate-env/bin/activate
weblate
If you are using source code directly (either from a tarball or Git checkout), the
management script is ./manage.py
available in the Weblate sources.
To run it:
python ./manage.py list_versions
If you've installed Weblate using the pip or pip3 installer, or by using the ./setup.py
script, the weblate is installed to your path (or virtualenv path),
from where you can use it to control Weblate:
weblate list_versions
For the Docker image, the script is installed like above, and you can run it using docker exec:
docker exec --user weblate <container> weblate list_versions
For docker-compose the process is similar, you just have to use docker-compose exec:
docker-compose exec --user weblate weblate weblate list_versions
In case you need to pass it a file, you can temporary add a volume:
docker-compose exec --user weblate /tmp:/tmp weblate weblate importusers /tmp/users.json
add_suggestions¶
-
weblate add_suggestions <project> <component> <language> <file>
¶
バージョン 2.5 で追加.
Imports a translation from the file to use as a suggestion for the given translation. It skips duplicated translations; only different ones are added.
E-mail of author for the suggestions. This user has to exist prior to importing (you can create one in the admin interface if needed).
例:
weblate --author michal@cihar.com add_suggestions weblate application cs /tmp/suggestions-cs.po
auto_translate¶
-
weblate auto_translate <project> <component> <language>
¶
バージョン 2.5 で追加.
バージョン 4.6 で変更: 翻訳モードのパラメータを追加しました。
Performs automatic translation based on other component translations.
-
--source
PROJECT/COMPONENT
¶ Specifies the component to use as source available for translation. If not specified all components in the project are used.
-
--user
USERNAME
¶ Specify username listed as author of the translations. "Anonymous user" is used if not specified.
-
--overwrite
¶
Whether to overwrite existing translations.
-
--add
¶
Automatically add language if a given translation does not exist.
-
--mt
MT
¶ Use machine translation instead of other components as machine translations.
-
--threshold
THRESHOLD
¶ Similarity threshold for machine translation, defaults to 80.
-
--mode
MODE
¶ Specify translation mode, default is "translate" but "fuzzy" or "suggest" can be used.
例:
weblate auto_translate --user nijel --inconsistent --source weblate/application weblate website cs
参考
checkgit¶
-
weblate checkgit <project|project/component>
¶
Prints current state of the back-end Git repository.
You can either define which project or component to update (for example
weblate/application
), or use --all
to update all existing components.
commitgit¶
-
weblate commitgit <project|project/component>
¶
Commits any possible pending changes to the back-end Git repository.
You can either define which project or component to update (for example
weblate/application
), or use --all
to update all existing components.
commit_pending¶
-
weblate commit_pending <project|project/component>
¶
Commits pending changes older than a given age.
You can either define which project or component to update (for example
weblate/application
), or use --all
to update all existing components.
-
--age
HOURS
¶ Age in hours for committing. If not specified the value configured in Component configuration is used.
注釈
This is automatically performed in the background by Weblate, so there no real need to invoke this manually, besides forcing an earlier commit than specified by Component configuration.
cleanuptrans¶
-
weblate cleanuptrans
¶
Cleans up orphaned checks and translation suggestions. There is normally no need to run this manually, as the cleanups happen automatically in the background.
createadmin¶
-
weblate createadmin
¶
Creates an admin
account with a random password, unless it is specified.
-
--password
PASSWORD
¶ Provides a password on the command-line, to not generate a random one.
-
--no-password
¶
Do not set password, this can be useful with --update.
-
--username
USERNAME
¶ Use the given name instead of
admin
.
-
--email
USER@EXAMPLE.COM
¶ Specify the admin e-mail address.
-
--name
¶
Specify the admin name (visible).
-
--update
¶
Update the existing user (you can use this to change passwords).
バージョン 2.9 で変更: Added parameters --username
, --email
, --name
and --update
.
dump_memory¶
-
weblate dump_memory
¶
バージョン 2.20 で追加.
Export a JSON file containing Weblate Translation Memory content.
dumpuserdata¶
-
weblate dumpuserdata <file.json>
¶
Dumps userdata to a file for later use by importuserdata
ヒント
This comes in handy when migrating or merging Weblate instances.
import_demo¶
-
weblate import_demo
¶
バージョン 4.1 で追加.
Creates a demo project with components based on <https://github.com/WeblateOrg/demo>.
This can be useful when developing Weblate.
import_json¶
-
weblate import_json <json-file>
¶
バージョン 2.7 で追加.
Batch import of components based on JSON data.
The imported JSON file structure pretty much corresponds to the component
object (see GET /api/components/(string:project)/(string:component)/
).
You have to include the name
and filemask
fields.
-
--project
PROJECT
¶ Specifies where the components will be imported from.
-
--main-component
COMPONENT
¶ Use the given VCS repository from this component for all of them.
-
--ignore
¶
Skip (already) imported components.
-
--update
¶
Update (already) imported components.
バージョン 2.9 で変更: The parameters --ignore
and --update
are there to deal with already
imported components.
Example of JSON file:
[
{
"slug": "po",
"name": "Gettext PO",
"file_format": "po",
"filemask": "po/*.po",
"new_lang": "none"
},
{
"name": "Android",
"filemask": "android/values-*/strings.xml",
"template": "android/values/strings.xml",
"repo": "weblate://test/test",
"file_format": "aresource"
}
]
import_memory¶
-
weblate import_memory <file>
¶
バージョン 2.20 で追加.
Imports a TMX or JSON file into the Weblate translation memory.
-
--language-map
LANGMAP
¶ Allows mapping languages in the TMX to the Weblate translation memory. The language codes are mapped after normalization usually done by Weblate.
--language-map en_US:en
will for example import allen_US
strings asen
ones.これは、TMX ファイルの言語が Weblate で使用しているものと一致しない場合に便利です。
import_project¶
-
weblate import_project <project> <gitrepo> <branch> <filemask>
¶
バージョン 3.0 で変更: The import_project command is now based on the コンポーネントの検出 addon, leading to some changes in behavior and what parameters are accepted.
Batch imports components into project based on filemask.
<project> names an existing project, into which the components are to be imported.
The <gitrepo> defines the Git repository URL to use, and <branch> signifies the Git branch. To import additional translation components from an existing Weblate component, use a weblate://<project>/<component> URL for the <gitrepo>.
The <filemask> defines file discovery for the repository. It can be either be made simple using wildcards, or it can use the full power of regular expressions.
The simple matching uses **
for component name and *
for language, for
example: **/*.po
The regular expression has to contain groups named component and language.
For example: (?P<language>[^/]*)/(?P<component>[^-/]*)\.po
The import matches existing components based on files and adds the ones that do not exist. It does not change already existing ones.
-
--name-template
TEMPLATE
¶ Customize the name of a component using Django template syntax.
For example:
Documentation: {{ component }}
-
--base-file-template
TEMPLATE
¶ Customize the base file for monolingual translations.
For example:
{{ component }}/res/values/string.xml
-
--new-base-template
TEMPLATE
¶ Customize the base file for addition of new translations.
For example:
{{ component }}/ts/en.ts
-
--file-format
FORMAT
¶ You can also specify the file format to use (see 対応するファイル形式), the default is auto-detection.
-
--language-regex
REGEX
¶ You can specify language filtering (see Component configuration) with this parameter. It has to be a valid regular expression.
-
--main-component
¶
You can specify which component will be chosen as the main one—the one actually containing the VCS repository.
-
--license
NAME
¶ Specify the overall, project or component translation license.
-
--license-url
URL
¶ Specify the URL where the translation license is to be found.
-
--vcs
NAME
¶ In case you need to specify which version control system to use, you can do it here. The default version control is Git.
To give you some examples, let's try importing two projects.
First The Debian Handbook translations, where each language has separate a folder with the translations of each chapter:
weblate import_project \
debian-handbook \
git://anonscm.debian.org/debian-handbook/debian-handbook.git \
squeeze/master \
'*/**.po'
Then the Tanaguru tool, where the file format needs be specified, along with the base file template, and how all components and translations are located in single folder:
weblate import_project \
--file-format=properties \
--base-file-template=web-app/tgol-web-app/src/main/resources/i18n/%s-I18N.properties \
tanaguru \
https://github.com/Tanaguru/Tanaguru \
master \
web-app/tgol-web-app/src/main/resources/i18n/**-I18N_*.properties
More complex example of parsing of filenames to get the correct component and
language out of a filename like
src/security/Numerous_security_holes_in_0.10.1.de.po
:
weblate import_project \
tails \
git://git.tails.boum.org/tails master \
'wiki/src/security/(?P<component>.*)\.(?P<language>[^.]*)\.po$'
Filtering only translations in a chosen language:
./manage import_project \
--language-regex '^(cs|sk)$' \
weblate \
https://github.com/WeblateOrg/weblate.git \
'weblate/locale/*/LC_MESSAGES/**.po'
Importing Sphinx documentation split to multiple files:
$ weblate import_project --name-template 'Documentation: %s' \
--file-format po \
project https://github.com/project/docs.git master \
'docs/locale/*/LC_MESSAGES/**.po'
Importing Sphinx documentation split to multiple files and directories:
$ weblate import_project --name-template 'Directory 1: %s' \
--file-format po \
project https://github.com/project/docs.git master \
'docs/locale/*/LC_MESSAGES/dir1/**.po'
$ weblate import_project --name-template 'Directory 2: %s' \
--file-format po \
project https://github.com/project/docs.git master \
'docs/locale/*/LC_MESSAGES/dir2/**.po'
参考
More detailed examples can be found in the Starting with internationalization chapter,
alternatively you might want to use import_json
.
importuserdata¶
-
weblate importuserdata <file.json>
¶
Imports user data from a file created by dumpuserdata
importusers¶
-
weblate importusers --check <file.json>
¶
Imports users from JSON dump of the Django auth_users database.
-
--check
¶
With this option it will just check whether a given file can be imported and report possible conflicts arising from usernames or e-mails.
You can dump users from the existing Django installation using:
weblate dumpdata auth.User > users.json
install_addon¶
バージョン 3.2 で追加.
-
weblate install_addon --addon ADDON <project|project/component>
¶
Installs an addon to a set of components.
-
--addon
ADDON
¶ Name of the addon to install. For example
weblate.gettext.customize
.
-
--configuration
CONFIG
¶ JSON encoded configuration of an addon.
-
--update
¶
Update the existing addon configuration.
You can either define which project or component to install the addon in (for example
weblate/application
), or use --all
to include all existing components.
To install gettext 出力のカスタマイズ for all components:
weblate install_addon --addon weblate.gettext.customize --config '{"width": -1}' --update --all
参考
list_languages¶
-
weblate list_languages <locale>
¶
Lists supported languages in MediaWiki markup - language codes, English names and localized names.
This is used to generate <https://wiki.l10n.cz/Slovn%C3%ADk_s_n%C3%A1zvy_jazyk%C5%AF>.
list_translators¶
-
weblate list_translators <project|project/component>
¶
Lists translators by contributed language for the given project:
[French]
Jean Dupont <jean.dupont@example.com>
[English]
John Doe <jd@example.com>
-
--language-code
¶
List names by language code instead of language name.
You can either define which project or component to use (for example
weblate/application
), or use --all
to list translators from all existing
components.
loadpo¶
-
weblate loadpo <project|project/component>
¶
Reloads translations from disk (for example in case you have done some updates in the VCS repository).
-
--force
¶
Force update, even if the files should be up-to-date.
-
--lang
LANGUAGE
¶ Limit processing to a single language.
You can either define which project or component to update (for example
weblate/application
), or use --all
to update all existing components.
注釈
You seldom need to invoke this, Weblate will automatically load changed files for every VCS update. This is needed in case you manually changed an underlying Weblate VCS repository or in some special cases following an upgrade.
lock_translation¶
-
weblate lock_translation <project|project/component>
¶
Prevents further translation of a component.
ヒント
Useful in case you want to do some maintenance on the underlying repository.
You can either define which project or component to update (for example
weblate/application
), or use --all
to update all existing components.
move_language¶
-
weblate move_language source target
¶
バージョン 3.0 で追加.
Allows you to merge language content. This is useful when updating to a new version which contains aliases for previously unknown languages that have been created with the (generated) suffix. It moves all content from the source language to the target one.
例:
weblate move_language cze cs
After moving the content, you should check whether there is anything left (this is subject to race conditions when somebody updates the repository meanwhile) and remove the (generated) language.
pushgit¶
-
weblate pushgit <project|project/component>
¶
Pushes committed changes to the upstream VCS repository.
-
--force-commit
¶
Force commits any pending changes, prior to pushing.
You can either define which project or component to update (for example
weblate/application
), or use --all
to update all existing components.
注釈
Weblate pushes changes automatically if コミット時にプッシュする in Component configuration is turned on, which is the default.
unlock_translation¶
-
weblate unlock_translation <project|project/component>
¶
Unlocks a given component, making it available for translation.
ヒント
Useful in case you want to do some maintenance on the underlying repository.
You can either define which project or component to update (for example
weblate/application
), or use --all
to update all existing components.
setupgroups¶
-
weblate setupgroups
¶
Configures default groups and optionally assigns all users to that default group.
-
--no-privs-update
¶
Turns off automatic updating of existing groups (only adds new ones).
-
--no-projects-update
¶
Prevents automatic updates of groups for existing projects. This allows adding newly added groups to existing projects, see プロジェクトのアクセス制御.
参考
setuplang¶
-
weblate setuplang
¶
Updates list of defined languages in Weblate.
-
--no-update
¶
Turns off automatic updates of existing languages (only adds new ones).
updatechecks¶
-
weblate updatechecks <project|project/component>
¶
Updates all checks for all strings.
ヒント
Useful for upgrades which do major changes to checks.
You can either define which project or component to update (for example
weblate/application
), or use --all
to update all existing components.
お知らせ¶
バージョン 4.0 で変更: 以前のリリースでは、この機能はホワイトボード メッセージと呼んでいました。
サイト全体、プロジェクトごと、コンポーネントごと、言語ごとにお知らせを投稿して、翻訳者に情報を提供します。
翻訳の目的、期限、状態、目標値の設定を告知します。
ユーザーは、監視中のプロジェクトのお知らせの通知を受け取ります(拒否しない限り)。
Web サイトの目的の告知から翻訳の目標の通知まで、さまざまな場面で役立ちます。
各レベルへのお知らせを、Manage メニューの Post announcement を使用して投稿する方法:

同じことを、管理画面を使用して追加する方法:

お知らせを、指定したコンテキストに基づいて表示する方法:
コンテキストを指定しない場合
ダッシュボード(ランディング ページ)に表示。
プロジェクトを指定した場合
プロジェクト内で、すべてのコンポーネントと翻訳を含めて表示。
コンポーネントを指定した場合
指定したコンポーネントと、そのすべての翻訳に対して表示。
言語を指定した場合
言語の概要と、その言語のすべての翻訳に表示。
言語の概要ページに表示される内容:

コンポーネント リスト¶
ユーザーのダッシュボード画面に表示する選択肢として、コンポーネントのリストを作成できます。複数のリストを設定すると、ユーザーはデフォルト画面に表示するリストを 1 つ選択できます。詳細については、ダッシュボード を確認してください。
バージョン 2.20 で変更: ダッシュボードにコンポーネント リストごとに翻訳状況を表示します。
各コンポーネント リストの名前と内容は、管理インターフェイスの コンポーネント リスト セクションから設定します。各コンポーネント リストには、ユーザーに表示する名前と、URL に使用するスラッグの両方が必要です。
バージョン 2.13 で変更: 管理画面で設定する、匿名ユーザーのためのダッシュボードは、認証されていないユーザーのためのダッシュボードに変更します。
コンポーネント リストの自動割り当て¶
バージョン 2.13 で追加.
スラッグに基づいてコンポーネントを自動的にリストに追加するには、コンポーネント リストの自動割り当て の規則を作成します。
大規模な導入時に、コンポーネント リストを管理する場合、または導入済みの Weblate のすべてのコンポーネントを 1 つのコンポーネント リストにまとめる場合に便利です。
ヒント
導入済みの Weblate のすべてのコンポーネントをまとめたコンポーネント リストを作成します。
1. Define Automatic component list assignment with ^.*$
as regular expression
in both the project and the component fields, as shown on this image:

Optional Weblate modules¶
Several optional modules are available for your setup.
Git exporter¶
バージョン 2.10 で追加.
Provides you read-only access to the underlying Git repository using HTTP(S).
導入¶
Add
weblate.gitexport
to installed apps insettings.py
:
INSTALLED_APPS += ("weblate.gitexport",)
Export existing repositories by migrating your database after installation:
weblate migrate
Usage¶
The module automatically hooks into Weblate and sets the exported repository URL in
the Component configuration.
The repositories are accessible under the /git/
part of the Weblate URL, for example
https://example.org/git/weblate/main/
.
Repositories for publicly available projects can be cloned without authentication:
git clone 'https://example.org/git/weblate/main/'
Access to browse the repositories with restricted access (with Private
access control or when REQUIRE_LOGIN
is enabled)
requires an API token which can be obtained in your
user profile:
git clone 'https://user:KEY@example.org/git/weblate/main/'
ヒント
By default members or Users group and anonymous user have access to the repositories for public projects via Access repository and Power user roles.
請求¶
バージョン 2.4 で追加.
This is used on Hosted Weblate to define billing plans, track invoices and usage limits.
導入¶
1. Add weblate.billing
to installed apps in
settings.py
:
INSTALLED_APPS += ("weblate.billing",)
Run the database migration to optionally install additional database structures for the module:
weblate migrate
Usage¶
After installation you can control billing in the admin interface. Users with billing enabled will get new Billing tab in their ユーザー情報.
The billing module additionally allows project admins to create new projects and components without being superusers (see Adding translation projects and components). This is possible when following conditions are met:
The billing is in its configured limits (any overusage results in blocking of project/component creation) and paid (if its price is non zero)
The user is admin of existing project with billing or user is owner of billing (the latter is necessary when creating new billing for users to be able to import new projects).
Upon project creation user is able to choose which billing should be charged for the project in case he has access to more of them.
法律上の告知事項¶
バージョン 2.15 で追加.
This is used on Hosted Weblate to provide required legal documents. It comes provided with blank documents, and you are expected to fill out the following templates in the documents:
legal/documents/tos.html
Terms of service document
legal/documents/privacy.html
Privacy policy document
legal/documents/summary.html
Short overview of the terms of service and privacy policy
注釈
Legal documents for the Hosted Weblate service are available in this Git repository <https://github.com/WeblateOrg/wllegal/tree/main/wllegal/templates/legal/documents>.
Most likely these will not be directly usable to you, but might come in handy as a starting point if adjusted to meet your needs.
導入¶
1. Add weblate.legal
to installed apps in
settings.py
:
INSTALLED_APPS += ("weblate.legal",)
# Optional:
# Social auth pipeline to confirm TOS upon registration/subsequent sign in
SOCIAL_AUTH_PIPELINE += ("weblate.legal.pipeline.tos_confirm",)
# Middleware to enforce TOS confirmation of signed in users
MIDDLEWARE += [
"weblate.legal.middleware.RequireTOSMiddleware",
]
Run the database migration to optionally install additional database structures for the module:
weblate migrate
Edit the legal documents in the
weblate/legal/templates/legal/
folder to match your service.
Usage¶
After installation and editing, the legal documents are shown in the Weblate UI.
Avatars¶
Avatars are downloaded and cached server-side to reduce information leaks to the sites serving them
by default. The built-in support for fetching avatars from e-mails addresses configured for it can be
turned off using ENABLE_AVATARS
.
Weblate currently supports:
Spam protection¶
You can protect against spamming by users by using the Akismet service.
Install the akismet Python module (this is already included in the official Docker image).
Obtain the Akismet API key.
Store it as
AKISMET_API_KEY
orWEBLATE_AKISMET_API_KEY
in Docker.
Following content is sent to Akismet for checking:
認証されていないユーザーからの提案
プロジェクトとコンポーネントの説明とリンク
注釈
This (among other things) relies on IP address of the client, please see リバース プロキシの背後で実行 for properly configuring that.
Signing Git commits with GnuPG¶
バージョン 3.1 で追加.
All commits can be signed by the GnuPG key of the Weblate instance.
1. Turn on WEBLATE_GPG_IDENTITY
. (Weblate will generate a GnuPG
key when needed and will use it to sign all translation commits.)
This feature needs GnuPG 2.1 or newer installed.
You can find the key in the DATA_DIR
and the public key is shown on
the "About" page:

2. Alternatively you can also import existing keys into Weblate, just set
HOME=$DATA_DIR/home
when invoking gpg.
接続制限¶
バージョン 3.2 で変更: 接続制限は、さらに詳細な設定が可能になりました。
バージョン 4.6 で変更: The rate limiting no longer applies to superusers.
Weblate の一部の操作は接続回数が制限されています。 RATELIMIT_WINDOW
秒以内で最大 RATELIMIT_ATTEMPTS
回の試行が許可されています。その後、ユーザーは RATELIMIT_LOCKOUT
秒間遮断されます。RATELIMIT_CONTACT_ATTEMPTS
や RATELIMIT_TRANSLATE_ATTEMPTS
などの、アクセス範囲を限定した設定もあります。次の表は、すべての使用可能なアクセス範囲の一覧です。
接続制限が対象の操作:
名前 |
アクセス範囲 |
試行回数限度 |
試行可能秒数 |
接続遮断秒数 |
---|---|---|---|---|
登録 |
|
5 |
300 |
600 |
管理者へメッセージの送信 |
|
5 |
300 |
600 |
サイン イン時のパスワード認証 |
|
5 |
300 |
600 |
サイト全体の検索 |
|
6 |
60 |
60 |
翻訳 |
|
30 |
60 |
600 |
用語集に用語を追加 |
|
30 |
60 |
600 |
新しい言語での翻訳の開始 |
|
2 |
300 |
600 |
ユーザーがログインに AUTH_LOCK_ATTEMPTS
回失敗した場合、パスワードのリセット処理を完了するまで、アカウントのパスワード認証を無効にします。
The settings can be also applied in the Docker container by adding WEBLATE_
prefix to the setting name, for example RATELIMIT_ATTEMPTS
becomes WEBLATE_RATELIMIT_ATTEMPTS
.
API には、個別の接続制限があります。参照: API 接続制限。
Fedora Messaging の統合¶
Fedora Messaging is AMQP-based publisher for all changes happening in Weblate. You can hook additional services on changes happening in Weblate using this.
The Fedora Messaging integration is available as a separate Python module
weblate-fedora-messaging
. Please see
<https://github.com/WeblateOrg/fedora_messaging/> for setup instructions.
Customizing Weblate¶
Extend and customize using Django and Python. Contribute your changes upstream so that everybody can benefit. This reduces your maintenance costs; code in Weblate is taken care of when changing internal interfaces or refactoring the code.
警告
Neither internal interfaces nor templates are considered a stable API. Please review your own customizations for every upgrade, the interfaces or their semantics might change without notice.
参考
Creating a Python module¶
If you are not familiar with Python, you might want to look into Python For Beginners, explaining the basics and pointing to further tutorials.
To write some custom Python code (called a module), a
place to store it is needed, either in the system path (usually something like
/usr/lib/python3.7/site-packages/
) or in the Weblate directory, which
is also added to the interpreter search path.
Better yet, turn your customization into a proper Python package:
Create a folder for your package (we will use weblate_customization).
Within it, create a
setup.py
file to describe the package:from setuptools import setup setup( name="weblate_customization", version="0.0.1", author="Your name", author_email="yourname@example.com", description="Sample Custom check for Weblate.", license="GPLv3+", keywords="Weblate check example", packages=["weblate_customization"], )
Create a folder for the Python module (also called
weblate_customization
) for the customization code.Within it, create a
__init__.py
file to make sure Python can import the module.This package can now be installed using pip install -e. More info to be found in “Editable” Installs.
Once installed, the module can be used in the Weblate configuration (for example
weblate_customization.checks.FooCheck
).
Your module structure should look like this:
weblate_customization
├── setup.py
└── weblate_customization
├── __init__.py
├── addons.py
└── checks.py
You can find an example of customizing Weblate at <https://github.com/WeblateOrg/customize-example>, it covers all the topics described below.
Changing the logo¶
上書きしたい静的ファイルを含む単純な Django アプリケーションを作成します(参照:Creating a Python module)。
Branding appears in the following files:
icons/weblate.svg
Logo shown in the navigation bar.
logo-*.png
Web icons depending on screen resolution and web-browser.
favicon.ico
Web icon used by legacy browsers.
weblate-*.png
Avatars for bots or anonymous users. Some web-browsers use these as shortcut icons.
email-logo.png
Used in notifications e-mails.
Add it to
INSTALLED_APPS
:INSTALLED_APPS = ( # Add your customization as first "weblate_customization", # Weblate apps are here… )
Run
weblate collectstatic --noinput
, to collect static files served to clients.
品質検査、アドオン、自動修正のカスタマイズ¶
自動修正のカスタマイズ、独自検査の記述、または アドオンの作成 のコードを Weblate にインストールする方法:
Weblate のカスタマイズを含む、Python モジュール内にファイルを置く(参照: Creating a Python module)。
Python クラスへの完全修飾パスを専用設定に追加する(
WEBLATE_ADDONS
、CHECK_LIST
またはAUTOFIX_LIST
):
# Checks
CHECK_LIST += ("weblate_customization.checks.FooCheck",)
# Autofixes
AUTOFIX_LIST += ("weblate_customization.autofix.FooFixer",)
# Addons
WEBLATE_ADDONS += ("weblate_customization.addons.ExamplePreAddon",)
管理画面¶
管理画面は、/manage/
URL の下に提供します。管理者権限でログインしたユーザーがアクセスできる。アクセスするには右上のスパナのアイコンから:

Weblate の基本的な概要:
サポート状況。参照: Weblate からのサポートを受ける
バックアップ。参照: Weblate のバックアップと移動
共有翻訳メモリ。参照: 翻訳メモリ
Weblate の健全性や Celery のキューの長さを確認する性能レポート
SSH 鍵管理。参照: SSH リポジトリ
すべてのコンポーネントのアラートの概要。参照: Translation component alerts
Django 管理画面¶
警告
使用は推奨されないので、将来削除予定です。ほとんどの機能は Weblate で直接管理できます。
ここでは、ユーザー、翻訳、その他の設定など、データベースに保存しているオブジェクトを管理できます。

Reports セクションでは、サイトの状態を確認したり、本番環境の設定 用に設定したり、リポジトリへの接続 へのアクセスに使用する SSH 鍵を管理できます。
各セクションでデータベース オブジェクトを管理します。特に興味深いのはおそらく Weblate translations であり、翻訳可能なプロジェクトを管理できます。参照: Project configuration および Component configuration。
Weblate languages に言語設定を保管しています。詳細については、言語の定義 を確認してください。
プロジェクトの追加¶
プロジェクトを追加すると、すべてのコンポーネントのコンテナとして機能します。通常の、1 つのソフトウェアやブックにつき 1 つのプロジェクトを作成する方法(個々のパラメータについては、Project configuration を参照):

単一言語コンポーネント¶
これらを簡単に翻訳するには、メッセージ ID と各原文の言語(通常は英語)とのマッピングを含めたテンプレート ファイルを用意します。(個々のパラメータについては、Component configuration を確認):

Weblate からのサポートを受ける¶
Weblate はコミュニティによる支援がある、コピーレフトな Libre ソフトウェアです。サブスクライバ(定期購入者)は、追加料金なしで優先的なサポートを受けられます。事前購入のヘルプ パッケージ(一時的な緊急サポート)は、誰でも申し込めます。現在提供されているサポートの詳細については、<https://weblate.org/support/> を確認してください。
サポートの統合¶
バージョン 3.8 で追加.
購入したサポート パッケージはオプションとして Weblate サブスクリプションの管理 画面からリンクを見つけて統合できます。インストールに関する基本インスタンスの詳細も、この方法で Weblate に報告されます。

Weblate に送信したデータ¶
Weblate インスタンスが設定されている URL
サイトのタイトル
実行している Weblate のバージョン
Weblate データベース内の一部のオブジェクト(プロジェクト、コンポーネント、言語、原文、およびユーザー)の集計
インスタンスの SSH 公開鍵
Additionally, when Weblate の探索 is turned on:
List of public projects (name, URL and website)
他のデータは送信していません。
Weblate の探索¶
バージョン 4.5.2 で追加.
注釈
この機能は現在、初期のベータ版です。
Discover Weblate is an opt-in service that makes it easier for users to find Weblate servers and communities. Users can browse registered services on <https://weblate.org/discover/>, and find there projects to contribute.
リストに掲載する¶
ヒント
Participating in Discover Weblate makes Weblate submit some information about your server, please see Weblate に送信したデータ.
To list your server with an active support subscription (see サポートの統合) in Discover Weblate all you need to do is turn this on in the management panel:

Listing your server without a support subsription in Discover Weblate:
<https://weblate.org/user/> から自分で登録する
Weblate サーバーを検索データベース <https://weblate.org/subscription/discovery/> に登録する
Confirm the service activation in your Weblate and turn on the discovery listing in your Weblate management page using Enable discovery button:

リストのカスタマイズ¶
You can customize the listing by providing a text and image (570 x 260 pixels) at <https://weblate.org/user/>.
Legal documents¶
注釈
Herein you will find various legal information you might need to operate Weblate in certain legal jurisdictions. It is provided as a means of guidance, without any warranty of accuracy or correctness. It is ultimately your responsibility to ensure that your use of Weblate complies with all applicable laws and regulations.
ITAR and other export controls¶
Weblate can be run within your own datacenter or virtual private cloud. As such, it can be used to store ITAR or other export-controlled information, however, end users are responsible for ensuring such compliance.
The Hosted Weblate service has not been audited for compliance with ITAR or other export controls, and does not currently offer the ability to restrict translations access by country.
US encryption controls¶
Weblate does not contain any cryptographic code, but might be subject export controls as it uses third party components utilizing cryptography for authentication, data-integrity and -confidentiality.
Most likely Weblate would be classified as ECCN 5D002 or 5D992 and, as publicly available libre software, it should not be subject to EAR (see Encryption items NOT Subject to the EAR).
Software components used by Weblate (listing only components related to cryptographic function):
- Python
See https://wiki.python.org/moin/PythonSoftwareFoundationLicenseFaq#Is_Python_subject_to_export_laws.3F
- GnuPG
Optionally used by Weblate
- Git
Optionally used by Weblate
- curl
Used by Git
- OpenSSL
Used by Python and cURL
The strength of encryption keys depends on the configuration of Weblate and the third party components it interacts with, but in any decent setup it will include all export restricted cryptographic functions:
In excess of 56 bits for a symmetric algorithm
Factorisation of integers in excess of 512 bits for an asymmetric algorithm
Computation of discrete logarithms in a multiplicative group of a finite field of size greater than 512 bits for an asymmetric algorithm
Discrete logarithms in a group different than above in excess of 112 bits for an asymmetric algorithm
Weblate doesn't have any cryptographic activation feature, but it can be configured in a way where no cryptography code would be involved. The cryptographic features include:
Accessing remote servers using secure protocols (HTTPS)
Generating signatures for code commits (PGP)
Starting with internationalization¶
Have a project and want to translate it into several languages? This guide will help you do so. Several typical situations are showcased, but most of the examples are generic and can be applied to other scenarios as well.
Before translating any software, you should realize that languages around the world are really different and you should not make any assumption based on your experience. For most of languages it will look weird if you try to concatenate a sentence out of translated segments. You also should properly handle plural forms because many languages have complex rules for that and the internationalization framework you end up using should support this.
Last but not least, sometimes it might be necessary to add some context to the
translated string. Imagine a translator would get string Sun
to translate.
Without context most people would translate that as our closest star, but it
might be actually used as an abbreviation for Sunday.
Choosing internationalization framework¶
Choose whatever is standard on your platform, try to avoid reinventing the wheel by creating your own framework to handle localizations. Weblate supports most of the widely used frameworks, see 対応するファイル形式 for more information (especially Translation types capabilities).
Our personal recommendation for some platforms is in the following table. This is based on our experience, but that can not cover all use cases, so always consider your environment when doing the choice.
Platform |
Recommended format |
---|---|
Android |
|
iOS |
|
Qt |
|
Python |
|
PHP |
|
C/C++ |
|
C# |
|
Perl |
|
Ruby |
|
Web extensions |
|
Java |
|
JavaScript |
- 1
The native Gettext support in PHP is buggy and often missing on Windows builds, it is recommended to use third party library motranslator instead.
- 2
You can also use Java properties if plurals are not needed.
- 3
You can also use plain JSON files if plurals are not needed.
The more detailed workflow for some formats is described in following chapters:
Integrating with Weblate¶
Weblate の基本¶
プロジェクトとコンポーネントの構造¶
Weblate では、翻訳はプロジェクトとコンポーネントで構成されています。各プロジェクトには複数のコンポーネントを含めることができ、コンポーネントには個々の言語への翻訳を含めることができます。コンポーネントは、翻訳可能な 1 つのファイル(例: GNU gettext や Android string resources)に対応します。プロジェクトは、コンポーネントを論理的なまとまりに分類(例えば、1 つのアプリケーション内で使用するすべての翻訳をグループ化)するのに便利です。
内部ではデフォルトで、各プロジェクトごとに、共通する文字列の翻訳はプロジェクト内の他のコンポーネントに自動反映させます。これにより、反復や複数バージョンの翻訳の負担を軽減します。コンポーネント独自の翻訳が望ましい場合は、翻訳の反映を Component configuration ごとに無効にできます。
現地語化プロジェクトを Weblate にインポート¶
Weblate has been developed with VCS integration in mind as it’s core feature, so the easiest way is to grant Weblate the access to your repository. The import process will guide you through configuring your translations into components.
Alternatively, you can use Weblate to set up a local repository containing all the translations without integration.
更新された翻訳を Weblate から取得¶
To fetch updated strings from Weblate, you can simply fetch the underlying Git repository (either from filesystem, or it can be made available through Git exporter). Prior to this, you might want to commit any pending changes (see Lazy commits). You can do so in the user interface (in the Repository maintenance) or from the command line using Weblate クライアント.
This can be automated if you grant Weblate push access to your repository and configure リポジトリの送信先 URL in the Component configuration, see Pushing changes from Weblate.
Alternatively, you can use Weblate's REST API to update translations to match their latest version.
リモート変更を Weblate にフェッチ¶
To fetch the strings newly updated in your repository into Weblate, just let it pull from the upstream repository. This can be achieved in the user interface (in the Repository maintenance), or from the command line using Weblate クライアント.
This can be automated by setting a webhook in your repository to trigger Weblate whenever there is a new commit, see Updating repositories for more details.
If you’re not using a VCS integration, you can use UI or Weblate's REST API to update translations to match your code base.
新しい文字列の追加¶
In case your translation files are stored in a VCS together with the code, you most likely have an existing workflow for developers to introduce new strings. Any way of adding strings will be picked up, but consider using 原文の品質ゲートウェイ to avoid introducing errors.
When the translation files are separate from the code, there are following ways to introduce new strings into Weblate.
Manually, using Add new translation string from Tools menu in the language used as the source for translations.
プログラムのように、 API を使用します
POST /api/translations/(string:project)/(string:component)/(string:language)/units/
.By uploading source file as Replace existing translation file (this overwrites existing strings, so please make sure the file includes both old and new strings) or Add new strings, see インポート方法.
注釈
Availability of adding strings in Weblate depends on 文字列の管理.
翻訳対象の言語ファイルの更新¶
For monolingual files (see 対応するファイル形式) Weblate might add new translation strings not present in the 単一言語のベース言語ファイル, and not in actual translations. It does not however perform any automatic cleanup of stale strings as that might have unexpected outcomes. If you want to do this, please install 翻訳ファイルのクリーンアップ addon which will handle the cleanup according to your requirements.
Weblate also will not try to update bilingual files in any way, so if you need
po
files being updated from pot
, you need to do it yourself
using Update source strings インポート方法 or using
POT に一致する PO ファイルの更新(msgmerge) addon.
GNU gettext を使用するソフトウェアによる翻訳¶
GNU gettext is one of the most widely used tool for internationalization of free software. It provides a simple yet flexible way to localize the software. It has great support for plurals, it can add further context to the translated string and there are quite a lot of tools built around it. Of course it has great support in Weblate (see GNU gettext file format description).
注釈
If you are about to use it in proprietary software, please consult licensing first, it might not be suitable for you.
GNU gettext can be used from a variety of languages (C, Python, PHP, Ruby, JavaScript and many more) and usually the UI frameworks already come with some support for it. The standard usage is through the gettext() function call, which is often aliased to _() to make the code simpler and easier to read.
Additionally it provides pgettext() call to provide additional context to translators and ngettext() which can handle plural types as defined for target language.
As a widely spread tool, it has many wrappers which make its usage really simple, instead of manual invoking of gettext described below, you might want to try one of them, for example intltool.
ワークフローの概要¶
The GNU gettext uses several files to manage the localization:
PACKAGE.pot
contains strings extracted from your source code, typically using xgettext or some high level wrappers such as intltool.LANGUAGE.po
contains strings with a translation to single language. It has to be updated by msgmerge once thePACKAGE.pot
is updated. You can create new language files using msginit or within Weblate.LANGUAGE.mo
contains binary representation ofLANGUAGE.po
and is used at application runtime. Typically it is not kept under version control, but generated at compilation time using msgfmt. In case you want to have it in the version control, you can generate it in Weblate using MO ファイルの生成 addon.
Overall the GNU gettext workflow looks like this:
Sample program¶
The simple program in C using gettext might look like following:
#include <libintl.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int count = 1;
setlocale(LC_ALL, "");
bindtextdomain("hello", "/usr/share/locale");
textdomain("hello");
printf(
ngettext(
"Orangutan has %d banana.\n",
"Orangutan has %d bananas.\n",
count
),
count
);
printf("%s\n", gettext("Thank you for using Weblate."));
exit(0);
}
Extracting translatable strings¶
Once you have code using the gettext calls, you can use xgettext to extract messages from it and store them into a .pot:
$ xgettext main.c -o po/hello.pot
注釈
There are alternative programs to extract strings from the code, for example pybabel.
This creates a template file, which you can use for starting new translations (using msginit) or updating existing ones after code change (you would use msgmerge for that). The resulting file is simply a structured text file:
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-10-23 11:02+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
#: main.c:14
#, c-format
msgid "Orangutan has %d banana.\n"
msgid_plural "Orangutan has %d bananas.\n"
msgstr[0] ""
msgstr[1] ""
#: main.c:20
msgid "Thank you for using Weblate."
msgstr ""
Each msgid
line defines a string to translate, the special empty string
in the beginning is the file header containing metadata about the translation.
Starting new translation¶
With the template in place, we can start our first translation:
$ msginit -i po/hello.pot -l cs --no-translator -o po/cs.po
Created cs.po.
The just created cs.po
already has some information filled in. Most
importantly it got the proper plural forms definition for chosen language and you
can see number of plurals have changed according to that:
# Czech translations for PACKAGE package.
# Copyright (C) 2015 THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# Automatically generated, 2015.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-10-23 11:02+0200\n"
"PO-Revision-Date: 2015-10-23 11:02+0200\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: cs\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=ASCII\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
#: main.c:14
#, c-format
msgid "Orangutan has %d banana.\n"
msgid_plural "Orangutan has %d bananas.\n"
msgstr[0] ""
msgstr[1] ""
msgstr[2] ""
#: main.c:20
msgid "Thank you for using Weblate."
msgstr ""
This file is compiled into an optimized binary form, the .mo file used by the GNU gettext functions at runtime.
Updating strings¶
Once you add more strings or change some strings in your program, you execute again xgettext which regenerates the template file:
$ xgettext main.c -o po/hello.pot
Then you can update individual translation files to match newly created templates (this includes reordering the strings to match new template):
$ msgmerge --previous --update po/cs.po po/hello.pot
Importing to Weblate¶
To import such translation into Weblate, all you need to define are the following fields when creating component (see Component configuration for detailed description of the fields):
Field |
Value |
---|---|
ソースコードのリポジトリ |
URL of the VCS repository with your project |
File mask |
|
新しい翻訳のテンプレート |
|
ファイル形式 |
gettext PO file の選択 |
新しい言語 |
Choose Create new language file |
And that's it, you're now ready to start translating your software!
参考
You can find a gettext example with many languages in the Weblate Hello project on GitHub: <https://github.com/WeblateOrg/hello>.
Translating documentation using Sphinx¶
Sphinx is a tool for creating beautiful documentation. It uses simple reStructuredText syntax and can generate output in many formats. If you're looking for an example, this documentation is also built using it. The very useful companion for using Sphinx is the Read the Docs service, which will build and publish your documentation for free.
I will not focus on writing documentation itself, if you need guidance with
that, just follow instructions on the Sphinx website. Once you have
documentation ready, translating it is quite easy as Sphinx comes with support
for this and it is quite nicely covered in their 国際化. It's
matter of few configuration directives and invoking of the sphinx-intl
tool.
If you are using Read the Docs service, you can start building translated documentation on the Read the Docs. Their Localization of Documentation covers pretty much everything you need - creating another project, set its language and link it from main project as a translation.
Now all you need is translating the documentation content. Sphinx generates PO
file for each directory or top level file, what can lead to quite a lot of
files to translate (depending on gettext_compact
settings).
You can import the index.po
into Weblate as an initial component and
then configure コンポーネントの検出 addon to automatically
discover all others.
|
|
|
|
|
|
gettext PO file |
|
|
翻訳ファイルを照合する正規表現 |
|
コンポーネント名のカスタマイズ |
|
新しい翻訳に対する基本ファイルの定義 |
|
ヒント
Would you prefer Sphinx to generate just single PO file? Since Sphinx 3.3.0 you can achieve this using:
gettext_compact = "docs"
You can find several documentation projects being translated using this approach:
Weblate documentation (you are reading that now)
Translating HTML and JavaScript using Weblate CDN¶
Starting with Weblate 4.2 it is possible to export localization to a CDN using JavaScript 現地語化 CDN addon.
注釈
This feature is configured on Hosted Weblate. It requires additional
configuration on your installation, see LOCALIZE_CDN_URL
and
LOCALIZE_CDN_PATH
.
Upon installation into your component it will push committed translations (see Lazy commits) to the CDN and these can be used in your web pages to localize them.
コンポーネントの作成¶
First, you need to create a monolingual component which will hold your strings, see Adding translation projects and components for generic instructions on that.
(例: HTML ファイルを含むファイル)で始まる既存のリポジトリがある場合、リポジトリ内に原文の言語(参照: 原文の言語 )用の空の JSON ファイルを作成します。内容は空のオブジェクトを示す {}
であるべきです。それができたら、リポジトリを Weblate にインポートして、アドオン設定から開始できます。
ヒント
In case you have existing translations, you can place them into the language JSON files and those will be used in Weblate.
For those who do not want to use existing repository (or do not have one), choose Start from scratch when creating component and choose JSON file as a file format (it is okay to choose any monolingual format at this point).
Weblate CDN アドオンの設定¶
The JavaScript 現地語化 CDN addon provides few configuration options.
- 翻訳目標のしきい値
Translations translated above this threshold will be included in the CDN.
- CSS セレクタ
Configures which strings from the HTML documents are translatable, see Weblate CDN の文字列抽出 and Weblate CDN を使用した HTML の現地化.
- 言語 Cookie 名
Name of cookie which contains user selected language. Used in the JavaScript snippet for Weblate CDN を使用した HTML の現地化.
- HTMLファイルから文字列を抽出
List of files in the repository or URLs where Weblate will look for translatable strings and offer them for a translation, see Weblate CDN の文字列抽出.
Weblate CDN の文字列抽出¶
The translation strings have to be present in Weblate. You can either manage these manually, use API to create them or list files or URLs using Extract strings from HTML files and Weblate will extract them automatically. The files have to present in the repository or contain remote URLs which will be download and parsed regularly by Weblate.
The default configuration for CSS selector extracts elements with
CSS class l10n
, for example it would extract two strings from following
snippets:
<section class="content">
<div class="row">
<div class="wrap">
<h1 class="section-title min-m l10n">Maintenance in progress</h1>
<div class="page-desc">
<p class="l10n">We're sorry, but this site is currently down for maintenance.</p>
</div>
</div>
</div>
</section>
In case you don't want to modify existing code, you can also use *
as a
selector to process all elements.
注釈
Right now, only text of the elements is extracted. This addon doesn't support localization of element attributes or elements with childs.
Weblate CDN を使用した HTML の現地化¶
To localize a HTML document, you need to load the weblate.js
script:
<script src="https://weblate-cdn.com/a5ba5dc29f39498aa734528a54b50d0a/weblate.js" async></script>
Upon loading, this will automatically find all matching translatable elements (based on CSS selector configuration) and replace their text with a translation.
The user language is detected from the configured cookie and falls back to user preferred languages configured in the browser.
The Language cookie name can be useful for integration with other
applications (for example choose django_language
when using Django).
JavaScript の現地語化¶
The individual translations are exposed as bilingual JSON files under the CDN. To fetch one you can use following code:
fetch(("https://weblate-cdn.com/a5ba5dc29f39498aa734528a54b50d0a/cs.json")
.then(response => response.json())
.then(data => console.log(data));
The actual localization logic needs to be implemented in this case.
Translation component alerts¶
Shows errors in the Weblate configuration or the translation project for any given translation component. Guidance on how to address found issues is also offered.
Currently the following is covered:
Duplicated source strings in translation files
Duplicated languages within translations
Merge or update failures in the source repository
Unused new base in component settings
Parse errors in the translation files
Duplicate filemask used for linked components
Broken URLs
ライセンスがありません
Alerts are listed on each respective component page as Alerts. If it is missing, the component clears all current checks. Alerts can not be ignored, but will disappear once the underlying problem has been fixed.
A component with both duplicated strings and languages looks like this:

参考
Building translators community¶
現地化コミュニティのチェックリスト¶
バージョン 3.9 で追加.
The Community localization checklist which can be found in the menu of each component can give you guidance to make your localization process easy for community translators.

Managing translations¶
新しい翻訳の追加¶
New strings can be made available for translation when they appear in the base file, called Template for new translations (see Component configuration). If your file format doesn't require such a file, as is the case with most monolingual translation flows, you can start with blank files).
New languages can be added right away when requested by a user in Weblate, or a notification will be sent to project admins for approval and manual addition. This can be done using 新しい翻訳の追加 in Component configuration.
注釈
If you add a language file in connected remote repository, respective translation will be added to the component when Weblate updates local repository.
More info on the repository update settings can be found on the Updating repositories.
既存の翻訳の削除¶
Languages, components, or the projects they are in, can be removed (deleted from Weblate and remote repository if used) from the menu Manage ↓ Removal of each project, component, or language.
Initiating the Removal action shows the list of components to be removed. You have to enter the object's slug to confirm the removal. The slug is the project's, language's, or component's pathname as it can be seen in the URL.
If you want to remove just some specific strings, there are following ways:
Manually in the source file. They will be removed from the translation project as well upon Weblate's repository update.
バージョン 4.5 で追加.
In Weblate’s UI via button Tools ↓ Remove while editing the string. This has differences between file formats, see: 文字列の管理
注釈
If you delete a language file in connected remote repository, respective translation will be removed from the component when Weblate updates local repository.
More info on the repository update settings can be found on the Updating repositories.
文字列の異なる表記¶
文字列の異なる表記は、複数の文字列をグループ化して、翻訳者が文字列のすべての異なる表記を 1 つの場所で確認できて便利です。
ヒント
Abbreviations (shortened forms, contractions) are a good example of variants.
自動化されたキーを元にした異なる表記¶
バージョン 3.11 で追加.
You can define regular expression to group the strings based on the key of monolingual translations in the Component configuration:

In case the Key matches the expression, the matching part is removed to generate root key of the variant. Then all the strings with the same root key become part of a single variant group, also including the string with the key exactly matching the root key.
The following table lists some usage examples:
Use case |
Regular expression variant |
Matched translation keys |
---|---|---|
Suffix identification |
|
|
Inline identification |
|
|
異なる表記の手動設定¶
バージョン 4.5 で追加.
You can manually link specific strings using variant:SOURCE
flag. This can
be useful for bilingual translations which do not have keys to group strings
automatically, or to group strings which keys are not matching, but
should be considered together when translating.
The additional variant for a string can also be added using the Tools while translating (when 文字列の管理 is turned on):

注釈
There the variant source string has to at most 768 characters long. This is technical limitation due to compatibility with MySQL database.
String labels¶
Split component translation strings into categories by text and colour in the project configuration.

ヒント
Labels can be assigned to units in Additional info on source strings by bulk editing, or using the 一括編集 addon.
Reviewing strings¶
Activity reports¶
Activity reports check changes of translations, for projects, components or individual users.
The activity reports for a project or component is accessible from its dashboard, on the Info tab.

More reports are accessible on the Insights tab, selecting Translation reports.
The activity of the currently signed in user can be seen by clicking on Profile from the user menu on the top right.
Source strings checks¶
There are many 品質検査, some of them focus on improving the quality of source strings. Many failing checks suggest a hint to make source strings easier to translate. All types of failing source checks are displayed on the Source tab of every component.
Translation string checks¶
Erroneous failing translation string checks indicate the problem is with the source string. Translators sometimes fix mistakes in the translation instead of reporting it - a typical example is a missing full stop at the end of a sentence.
Reviewing all failing checks can provide valuable feedback to improve its source strings. To make source strings review easier, Weblate automatically creates a translation for the source language and shows you source level checks there:

One of the most interesting checks here is the 複数の検査で不合格 - it is triggered whenever there is failure on multiple translations of a given string. Usually this is something to look for, as this is a string which translators have problems translating properly.
The detailed listing is a per language overview:

原文のフィードバックの受信¶
Translators can comment on both translation and source strings. Each Component configuration can be configured to receive such comments to an e-mail address (see 原文ミスの報告先アドレス), and using the developers mailing list is usually the best approach. This way you can keep an eye on when problems arise in translation, take care of them, and fix them quickly.
参考
Promoting the translation¶
Weblate provides you widgets to share on your website or other sources to promote the translation project. It also has a nice welcome page for new contributors to give them basic information about the translation. Additionally you can share information about translation using Facebook or Twitter. All these possibilities can be found on the Share tab:

All these badges are provided with the link to simple page which explains users how to translate using Weblate:

翻訳の進捗状況レポート¶
Reporting features give insight into how a translation progresses over a given period. A summary of contributions to any given component over time is provided. The reporting tool is found in the Insights menu of any translation component, project or on the dashboard:

Several reporting tools are available on this page and all can produce output in HTML, reStructuredText or JSON. The first two formats are suitable for embedding statistics into existing documentation, while JSON is useful for further processing of the data.
Translator credits¶
Generates a document usable for crediting translators - sorted by language and lists all contributors to a given language:
* Czech
* Michal Čihař <michal@cihar.com> (10)
* John Doe <john@example.com> (5)
* Dutch
* Jane Doe <jane@example.com> (42)
次のように表示:
チェコ語
Michal Čihař <michal@cihar.com> (10)
John Doe <john@example.com> (5)
オランダ語
Jane Doe <jane@example.com> (42)
ヒント
The number in parenthesis indicates number of contributions in given period.
貢献者の統計情報¶
Generates the number of translated words and strings by translator name:
======================================== ======================================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ========================
Name Email Count total Source words total Source chars total Target words total Target chars total Count new Source words new Source chars new Target words new Target chars new Count approved Source words approved Source chars approved Target words approved Target chars approved Count edited Source words edited Source chars edited Target words edited Target chars edited
======================================== ======================================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ========================
Michal Čihař michal@cihar.com 1 3 24 3 21 1 3 24 3 21 0 0 0 0 0 0 0 0 0 0
Allan Nordhøy allan@example.com 2 5 25 4 28 2 3 24 3 21 0 0 0 0 0 0 0 0 0 0
======================================== ======================================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ======================== ========================
そして、次のように表示:
名前 |
Count total |
Source words total |
Source chars total |
Target words total |
Target chars total |
Count new |
Source words new |
Source chars new |
Target words new |
Target chars new |
Count approved |
Source words approved |
Source chars approved |
Target words approved |
Target chars approved |
Count edited |
Source words edited |
Source chars edited |
Target words edited |
Target chars edited |
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Michal Čihař |
1 |
3 |
24 |
3 |
21 |
1 |
3 |
24 |
3 |
21 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
Allan Nordhøy |
2 |
5 |
25 |
4 |
28 |
2 |
3 |
24 |
3 |
21 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
It can be useful if you pay your translators based on amount of work, it gives you various stats on translators work.
すべての統計で使用できる 3 種類:
- Total
Overall number of edited strings.
- New
Newly translated strings which didn't have translation before.
- Approved
Count for string approvals in review workflow (see 専任の査読者).
- Edited
Edited strings which had translation before.
The following metrics are available for each:
- Count
Number of strings.
- Edits
Number of edits in the string, measured in Damerau–Levenshtein distance.
- Source words
Number of words in the source string.
- Source characters
Number of characters in the source string.
- Target words
Number of words in the translated string.
- Target characters
Number of characters in the translated string.
Weblate に貢献¶
Weblate に貢献する方法はたくさんあります。納得して選択できるコーディング、グラフィックデザイン、ドキュメンテーション、スポンサーシップ、アイデアなど:
Weblate の翻訳¶
Weblate は、Weblate 自体を用いて継続的に 翻訳されています 。できるだけ多くの人間の言語で Weblate を利用できるようにする取り組みに気軽に参加してください。Weblate の敷居が下がります!
If you find a possible mistake in the source string, you can mark it with a comment in the Weblate editor. This way, it can be discussed and corrected. If you’re certain, you can also click on the link in the Source string location section and submit a PR with your correction.
Weblateドキュメントへの貢献¶
You are welcome to improve the documentation page of your choice. Do it easily by clicking the Edit on GitHub button in the top-right corner of the page.
Please respect these guidelines while writing:
Don’t remove part of the documentation if it’s valid.
Use clear and easily-understandable language. You are writing tech docs, not a poem. Not all docs readers are native speakers, be thoughtful.
Don’t be affraid to ask if you are not certain. If you have to ask about some feature while editing, don’t change its docs before you have the answer. This means: You change or ask. Don’t do both at the same time.
Verify your changes by performing described actions while following the docs.
Send PR with changes in small chunks to make it easier and quicker to review and merge.
If you want to rewrite and change the structure of a big article, do it in two steps:
Rewrite
Once the rewrite is reviewed, polished, and merged, change the structure of the paragraphs in another PR.
ヒント
You can translate the docs.
Weblate の議論¶
If you have an idea and not sure if it’s suitable for an issue, don’t worry. You can join the community in GitHub discussions.
Weblate 開発に資金提供¶
Weblate の開発を加速させるには donate page をご利用ください。集められた資金は、Libre ソフトウェア プロジェクトの無料ホスティング、および Weblate のさらなる開発を可能にするために使用されます。資金提供の目標や、資金提供者への報酬などのオプションの詳細は 寄付ページ をご覧ください。
Weblate に資金提供した支援者¶
Weblate 支援者名簿:
Yashiro Ccs
Cheng-Chia Tseng
Timon Reinhard
Loic Dachary
Marozed
GNU Solidario (GNU Health)
Richard Nespithal
支援者名簿に掲載しませんか?Weblate に寄付をする の選択から選んでください。
Weblate にコードの提供開始¶
Weblate のソース コードを理解するには、まず Weblate のソース コード、Weblate フロントエンド、Weblate の内部 を確認してください。
コードベースから始める¶
good first issue というラベルの付いたバグを試して、Weblate コードベースに慣れてください。
Weblate をローカルで実行¶
Weblate の開発を始める最も快適な方法は、ソースからインストール に従うことです。編集可能な Weblate のソースを付属した virtualenv を入手します。
Weblate ソースコードのクローン:
git clone https://github.com/WeblateOrg/weblate.git cd weblate
virtualenv の作成:
virtualenv .venv .venv/bin/activate
Weblate のインストール(そのためには複数のシステム依存関係が必要。参照: ソースからインストール):
pip install -e .
開発に便利な依存関係をすべてインストール:
pip install -r requirements-dev.txt
開発サーバーの起動:
weblate runserver
Celery Worker を起動する場合の設定方法:
./weblate/examples/celery start
テストの実行(詳細は Local testing を確認してください):
. scripts/test-database ./manage.py test
参考
Docker上でローカルに Weblate の実行¶
Docker と docker-compose をインストールしている場合は、以下を実行するだけで開発環境を起動できます。
./rundev.sh
開発用 Docker イメージを作成して起動します。Weblate は <http://127.0.0.1:8080/> で動作しており、admin
ユーザーとして admin
パスワードでサインインできます。新しいインストールは空なので、Adding translation projects and components に進んでください。
Dockerfile
と docker-compose.yml
は、dev-docker
ディレクトリにあります。
スクリプトは、複数のパラメータを受け取り、テストを実行するために test
パラメータを指定して実行し、次に test
パラメータを指定します。使用例:
./rundev.sh test --failfast weblate.trans
注釈
テストを実行する前に、Docker コンテナが稼働していることを確認してください。これは docker ps
コマンドを実行して確認できます。
ログの表示方法:
./rundev.sh logs
バックグラウンド コンテナの実行の停止方法:
./rundev.sh stop
引数を指定せずにスクリプトを実行すると、Docker コンテナが再作成されて再起動します。
注釈
これは本番環境には適していません。安全ではないが開発を楽にする複数のハックが含まれています。
PyCharm による Weblate のコーディング¶
PyCharm は Python の IDE として知られていますが、ここでは Weblate プロジェクトをセットアップするためのガイドラインを紹介します。
GitHub リポジトリをフォルダにクローンしたので、PyCharm から開くだけです。IDE を開いたあとの、最初に必要なインタプリターの指定方法:

PyCharm で virtualenv を作成するか、または既存の仮想環境の選択方法:

インタープリターを設定したあと、忘れてはいけないインストールが必要な依存関係: 依存関係は、コンソール(デフォルトでは、IDE のコンソールが virtualenv を直接使用する)からインストールします。また、依存関係が存在しない、という警告が表示されたときはインターフェースからインストールします。
2 番目のステップは、PyCharm 内でネイティブで Django を使用するための適切な情報の設定: アイデアは、IDE で単体テストをすぐに起動できるようにすることです。そのために必要な、Django プロジェクトのルート パスと、その設定へのパスの指定の設定方法:

「Djangoプロジェクトのルート」 はリポジトリのルートであり、weblate のサブ ディレクトリではないことに注意してください。設定については、リポジトリから weblate/settings_test.py
の使用もできますが、独自の設定を作成してそこで設定することもできます。
最後のステップは、サーバーを実行して、コードにブレークポイントを設定してデバッグを行います。そのための、新しい Django Server 設定の作成方法:


ヒント
Be careful with the property called No reload: It prevents the server from being reloaded live if you modify files. This allows the existing debugger breakpoints to persist, when they normally would be discarded upon reloading the server.
開発インスタンスの強化¶
import_demo
を使用してデモ翻訳を作成し、createadmin
を使用して管理者ユーザーを作成できます。
Weblate のソース コード¶
Weblateは GitHub 上で開発しています。コードをフォークしてプル リクエストを開くことができます。他の形式のパッチも歓迎します。
参考
Weblate の内部 を確認して、Weblate の内部をどうなっているか調べてください。
セキュリティ設計原則¶
Weblate のコードはすべて、 セキュリティ設計原則 を念頭に記述しなければなりません。
コーディング規約¶
コードは PEP-8 コーディング ガイドラインに従い、black コード整形ツールを使用して書式設定することが必要です。
コードの品質を検査するには flake 8 を使用します。推奨プラグインの一覧は .pre-commit-config.yaml
にあり、設定は:file:`setup.cfg`にあります。
これを実行する最も簡単な方法は、pre-commit インストールすることです。Webrate リポジトリには、コミットされたファイルが正常であることを確認するための設定が含まれています。インストール後(すでに requirements-lint.txt
に含まれています)、Weblate のチェックアウトで pre-commit install
を実行して有効にします。これにより、すべての変更が自動的に検査されます。
手動で検査を実行し、すべてのファイルの実行を検査する方法:
pre-commit run --all
Debugging Weblate¶
バグは、アプリケーションのクラッシュまたは不正行為として現れることがあります。このような問題に関する情報を収集し、課題解決ツール で報告してください。
デバッグモード¶
Turning on debug mode will make the exceptions show in the browser. This is useful to debug issues in the web interface, but not suitable for production environment as it has performance consequences and might leak private data.
参考
Weblate logs¶
Weblate can produce detailed logs of what is going in the background. In
the default configuration it uses syslog and that makes the log appear either in
/var/log/messages
or /var/log/syslog
(depending on your syslog
daemon configuration).
The Celery process (see Celery を使用するバックグラウンド タスク) usually produces own logs as well. The
example system-wide setups log to several files under /var/log/celery/
.
Docker containers log to their output (as usual in the Docker world), so
you can look at the logs using docker-compose logs
.
Not processing background tasks¶
Lot of things happen in background Celery workers. In case things like sending out e-mails or component removal does not work, there might be some issue with it.
その場合の確認事項:
Check Celery process is running, see Celery を使用するバックグラウンド タスク
Check Celery queue status either in 管理画面 or using
celery_queues
Look into Celery logs for errors (see Weblate logs)
Not receiving e-mails from Weblate¶
You can verify whether outgoing e-mail is working correctly by using the
sendtestemail
management command (see Invoking management commands
for instructions on how to invoke it in different environments) or using
管理画面 under the Tools tab.
These send e-mail directly, so this verifies that your SMTP configuration is correct (see メール送信の設定). Most of the e-mails from Weblate are however sent in the background and there might be some issues with Celery involved as well, please see Not processing background tasks for debugging that.
Analyzing application crashes¶
In case the application crashes, it is useful to collect as much info about the crash as possible. The easiest way to achieve this is by using third-party services which can collect such info automatically. You can find info on how to set this up in エラー レポートの収集.
Silent failures¶
Lots of tasks are offloaded to Celery for background processing. Failures are not shown in the user interface, but appear in the Celery logs. Configuring エラー レポートの収集 helps you to notice such failures easier.
Performance issues¶
In case Weblate performs badly in some situation, please collect the relevant logs showing the issue, and anything that might help figuring out where the code might be improved.
In case some requests take too long without any indication, you might want to install dogslow along with エラー レポートの収集 and get pinpointed and detailed tracebacks in the error collection tool.
Weblate の内部¶
注釈
この章では、Weblate 内部の基本的な概要を説明します。
Weblate はそのコード構造の大部分は Django をベースに作成しています。
ディレクトリ構造¶
Weblate メイン リポジトリのディレクトリ構造の概要:
docs
このドキュメントのソース コードは、Sphinx を使用して作成しています。
dev-docker
開発サーバーを実行する Docker コード。参照: Docker上でローカルに Weblate の実行。
weblate
`Django<https://www.djangoproject.com/>`_ アプリケーションとしての Weblate のソース コード。参照: Weblate の内部。
weblate/static
クライアント ファイル(CSS、Javascript および画像)。参照: Weblate フロントエンド。
モジュール¶
Weblate は、複数の Django アプリケーションで構成されています(複数のオプション。参照: Optional Weblate modules)。
accounts
ユーザー アカウント、プロファイル、および通知。
addons
Weblate の動作の詳細設定用のアドオン。参照: アドオン。
api
Django REST framework をベースにした API。
auth
認証とアクセス権。
billing
オプションの 請求 モジュール。
checks
翻訳文字列の 品質検査 モジュール。
fonts
フォント表示検査モジュール。
formats
translate-toolkit をベースにしたファイル形式抽象化レイヤー。
gitexport
オプションの Git exporter モジュール。
lang
言語と複数形のモデルを定義するモジュール。
legal
オプションの 法律上の告知事項 モジュール。
machinery
機械翻訳サービスの統合。
memory
標準搭載の翻訳メモリ。参照: 翻訳メモリ。
screenshots
スクリーンショット管理と OCR モジュール。
trans
翻訳を処理するメイン モジュール。
utils
複数のヘルパー ユーティリティ。
vcs
バージョン管理システムの抽象化。
wladmin
カスタマイズした Django の管理画面。
アドオンの開発¶
アドオン は、Weblate の現地語化ワークフローをカスタマイズする方法です。
-
class
weblate.addons.base.
BaseAddon
(storage=None)¶ -
classmethod
can_install
(component, user)¶ アドオンが指定したコンポーネントと互換性があるかどうかを確認します。
-
configure
(settings)¶ 設定を保存します。
-
daily
(component)¶ 毎日起動するフック。
-
classmethod
get_add_form
(user, component, **kwargs)¶ 新しいアドオンを追加するための設定フォームを返します。
-
get_settings_form
(user, **kwargs)¶ このアドオンの設定フォームを返します。
-
post_add
(translation)¶ 新しい翻訳が追加された後にフックが実行されます。
-
post_commit
(component)¶ 変更がリポジトリにコミットされた後にフックが起動します。
-
post_push
(component)¶ リポジトリが upstream にプッシュされた後にフックが起動します。
-
pre_commit
(translation, author)¶ 変更がリポジトリにコミットされる前にフックが起動します。
-
pre_push
(component)¶ リポジトリが upstream にプッシュされる前に起動するフック。
-
pre_update
(component)¶ リポジトリが upstream から更新される前に起動するフック。
-
save_state
()¶ アドオンの状態を保存します。
-
stay_on_create
= False¶ Weblate アドオンの基本クラス。
-
store_post_load
(translation, store)¶ ファイルが解析された後にフックを起動します。
It receives an instance of a file format class as a argument.
This is useful to modify file format class parameters, for example adjust how the file will be saved.
-
unit_pre_create
(unit)¶ 新しいユニットが作成される前にフックが起動します。
-
classmethod
アドオンの例:
#
# Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
from django.utils.translation import gettext_lazy as _
from weblate.addons.base import BaseAddon
from weblate.addons.events import EVENT_PRE_COMMIT
class ExampleAddon(BaseAddon):
# Filter for compatible components, every key is
# matched against property of component
compat = {"file_format": {"po", "po-mono"}}
# List of events addon should receive
events = (EVENT_PRE_COMMIT,)
# Addon unique identifier
name = "weblate.example.example"
# Verbose name shown in the user interface
verbose = _("Example addon")
# Detailed addon description
description = _("This addon does nothing it is just an example.")
# Callback to implement custom behavior
def pre_commit(self, translation, author):
return
Weblate フロントエンド¶
フロントエンドは、現在 Bootstrap、jQuery、およびサード パーティの数少ないライブラリを使用して構築されています。
対応ブラウザ¶
Weblate supports the latest, stable releases of all major browsers and platforms.
Alternative browsers which use the latest version of WebKit, Blink, or Gecko, whether directly or via the platform’s web view API, are not explicitly supported. However, Weblate should (in most cases) display and function correctly in these browsers as well.
Older browsers might work, but some features might be limited.
依存関係の管理¶
yarn パッケージ マネージャーは、サード パーティのライブラリを更新するために使用します。設定は scripts/yarn
にあり、これはライブラリを更新するラッパ スクリプト scripts/yarn-update
であり、ビルドして正しい場所 weblate/static/vendor
にコピーするためのものです。この場所には、すべてサードパーティーのフロントエンドのコードが配置されています。
Adding new third-party library typically consists of:
# Add a yarn package
yarn --cwd scripts/yarn add PACKAGE
# Edit the script to copy package to the static folder
edit scripts/yarn-update
# Run the update script
./scripts/yarn-update
# Add files to git
git add .
コーディング スタイル¶
Weblate は、JavaScript ファイルと CSS ファイルの両方のコード フォーマットに Prettier を使用しています。
また ESLint を使用して JavaScript コードを検査します。
現地語化¶
フロントエンドのコードでユーザーに表示するテキストが必要な場合は、現地語化が可能な文字列であることが必要です。ほとんどの場合、テキストを gettext
関数内でラップするだけだが、もっと複雑な機能も利用できる方法:
document.write(gettext('this is to be translated'));
var object_count = 1 // or 0, or 2, or 3, ...
s = ngettext('literal for the singular case',
'literal for the plural case', object_count);
fmts = ngettext('There is %s object. Remaining: %s',
'There are %s objects. Remaining: %s', 11);
s = interpolate(fmts, [11, 20]);
// s is 'There are 11 objects. Remaining: 20'
アイコン¶
Weblate では現在、マテリアル デザインのアイコンを使用しています。新しいシンボル アイコンをお探しの方は Material Design Icons もしくは Material Design Resources を確認してください。
また、ほとんどのアイコンが HTML に埋め込まれていて、パスをスタイルで設定できるため、SVG のサイズを小さくする :file:'scripts/optimize-svg' を用意しました。
Weblate の問題の報告¶
Weblate の 課題管理ツール は GitHub で管理しています。
Weblate の問題の報告や、改善の提案を歓迎します。問題の報告が快適にできるように様々なテンプレートを用意しています。
Weblate のセキュリティ上の問題を発見したときは、下記の セキュリティの問題 のセクションを確認してください。
If you are not sure about your bug report or feature request, you can try Weblate の議論.
セキュリティの問題¶
In order to give the community time to respond and upgrade, you are strongly urged to report all security issues privately. HackerOne is used to handle security issues, and can be reported directly at HackerOne. Once you submit it there, community has limited but enough time to solve the incident.
Alternatively, report to security@weblate.org, which ends up on HackerOne as well.
If you don't want to use HackerOne, for whatever reason, you can send the report by e-mail to michal@cihar.com. You can choose to encrypt it using this PGP key 3CB 1DF1 EF12 CF2A C0EE 5A32 9C27 B313 42B7 511D. You can also get the PGP key from Keybase.
注釈
Weblate depends on third-party components for many things. In case you find a vulnerability affecting one of those components in general, please report it directly to the respective project.
Some of these are:
Weblate testsuite and continuous integration¶
Testsuites exist for most of the current code, increase coverage by adding testcases for any new functionality, and verify that it works.
Continuous integration¶
Current test results can be found on GitHub Actions and coverage is reported on Codecov.
There are several jobs to verify different aspects:
Unit tests
Documentation build and external links
Migration testing from all supported releases
Code linting
Setup verification (ensures that generated dist files do not miss anything and can be tested)
The configuration for the CI is in .github/workflows
directory. It
heavily uses helper scripts stored in ci
directory. The scripts can be
also executed manually, but they require several environment variables, mostly
defining Django settings file to use and database connection. The example
definition of that is in scripts/test-database
:
# Simple way to configure test database from environment
# Database backend to use postgresql / mysql / mariadb
export CI_DATABASE=${1:-postgresql}
# Database server configuration
export CI_DB_USER=weblate
export CI_DB_PASSWORD=weblate
export CI_DB_HOST=127.0.0.1
# Django settings module to use
export DJANGO_SETTINGS_MODULE=weblate.settings_test
The simple execution can look like:
. scripts/test-database
./ci/run-migrate
./ci/run-test
./ci/run-docs
Local testing¶
To run a testsuite locally, use:
DJANGO_SETTINGS_MODULE=weblate.settings_test ./manage.py test
ヒント
You will need a database (PostgreSQL) server to be used for tests. By
default Django creates separate database to run tests with test_
prefix,
so in case your settings is configured to use weblate
, the tests will
use test_weblate
database. See Weblate のデータベース設定 for setup
instructions.
The weblate/settings_test.py
is used in CI environment as well (see
Continuous integration) and can be tuned using environment variables:
# Simple way to configure test database from environment
# Database backend to use postgresql / mysql / mariadb
export CI_DATABASE=${1:-postgresql}
# Database server configuration
export CI_DB_USER=weblate
export CI_DB_PASSWORD=weblate
export CI_DB_HOST=127.0.0.1
# Django settings module to use
export DJANGO_SETTINGS_MODULE=weblate.settings_test
Prior to running tests you should collect static files as some tests rely on them being present:
DJANGO_SETTINGS_MODULE=weblate.settings_test ./manage.py collectstatic
You can also specify individual tests to run:
DJANGO_SETTINGS_MODULE=weblate.settings_test ./manage.py test weblate.gitexport
ヒント
The tests can also be executed inside developer docker container, see Docker上でローカルに Weblate の実行.
参考
See Django におけるテスト for more info on running and writing tests for Django.
データ スキーマ¶
Weblate は JSON Schema to を使用して外部 JSON ファイルのレイアウトを定義します。
Weblate 翻訳メモリ概要¶
型 |
配列 |
||
項目 |
翻訳メモリの項目 |
||
型 |
オブジェクト |
||
プロパティ |
|||
|
文字列のカテゴリー |
||
1 = グローバル、2 = 共有、10000000 以上 = プロジェクト固有、20000000 以上 = ユーザ固有 |
|||
型 |
整数 |
||
例: |
1 |
||
最小 |
0 |
||
デフォルト |
1 |
||
|
文字列のオリジナル |
||
ファイル名またはコンポーネント名 |
|||
型 |
文字列 |
||
例: |
test.tmx |
||
プロジェクト/コンポーネント |
|||
デフォルト |
|||
|
原文 |
||
型 |
文字列 |
||
例: |
Hello |
||
minLength |
1 |
||
デフォルト |
|||
|
原文の言語 |
||
ISO 639-1 / ISO 639-2 / IETF BCP 47 |
|||
型 |
文字列 |
||
例: |
en |
||
パターン |
^[^ ]+$ |
||
デフォルト |
|||
|
翻訳対象の文字列 |
||
型 |
文字列 |
||
例: |
Ahoj |
||
minLength |
1 |
||
デフォルト |
|||
|
翻訳対象の言語 |
||
ISO 639-1 / ISO 639-2 / IETF BCP 47 |
|||
型 |
文字列 |
||
例: |
cs |
||
パターン |
^[^ ]+$ |
||
デフォルト |
|||
追加のプロパティ |
False |
||
定義 |
Weblate ユーザー データのエクスポート¶
型 |
オブジェクト |
|||
プロパティ |
||||
|
基本 |
|||
型 |
オブジェクト |
|||
プロパティ |
||||
|
Username |
|||
型 |
文字列 |
|||
例: |
管理者 |
|||
デフォルト |
||||
|
フル ネーム |
|||
型 |
文字列 |
|||
例: |
Weblate 管理者 |
|||
デフォルト |
||||
|
メールアドレス |
|||
型 |
文字列 |
|||
例: |
||||
デフォルト |
||||
|
登録日 |
|||
型 |
文字列 |
|||
例: |
2019-11-18T18:53:54.862Z |
|||
デフォルト |
||||
|
プロフィール |
|||
型 |
オブジェクト |
|||
プロパティ |
||||
|
言語 |
|||
型 |
文字列 |
|||
例: |
cs |
|||
パターン |
^.*$ |
|||
デフォルト |
||||
|
提案された文字列の数 |
|||
型 |
整数 |
|||
例: |
1 |
|||
デフォルト |
0 |
|||
|
翻訳済み文字列の数 |
|||
型 |
整数 |
|||
例: |
24 |
|||
デフォルト |
0 |
|||
|
アップロードされたスクリーンショットの数 |
|||
型 |
整数 |
|||
例: |
1 |
|||
デフォルト |
0 |
|||
|
完了した翻訳をダッシュボードで非表示にする |
|||
型 |
boolean |
|||
例: |
False |
|||
デフォルト |
True |
|||
|
Zen モードで参考言語を表示する |
|||
型 |
boolean |
|||
例: |
True |
|||
デフォルト |
True |
|||
|
参考言語の翻訳がある場合は原文を表示しない |
|||
型 |
boolean |
|||
例: |
False |
|||
デフォルト |
True |
|||
|
エディタ リンク |
|||
型 |
文字列 |
|||
例: |
||||
パターン |
^.*$ |
|||
デフォルト |
||||
|
翻訳エディタ モード |
|||
型 |
整数 |
|||
例: |
0 |
|||
デフォルト |
0 |
|||
|
Zen 編集モード |
|||
型 |
整数 |
|||
例: |
0 |
|||
デフォルト |
0 |
|||
|
特殊文字 |
|||
型 |
文字列 |
|||
例: |
||||
パターン |
^.*$ |
|||
デフォルト |
||||
|
デフォルトのダッシュボード画面 |
|||
型 |
整数 |
|||
例: |
1 |
|||
デフォルト |
0 |
|||
|
デフォルトのコンポーネント リスト |
|||
デフォルト |
null |
|||
どちらか |
型 |
null |
||
型 |
整数 |
|||
|
翻訳言語 |
|||
型 |
配列 |
|||
デフォルト |
||||
項目 |
言語コード |
|||
型 |
文字列 |
|||
例: |
cs |
|||
パターン |
^.*$ |
|||
デフォルト |
||||
|
参考言語 |
|||
型 |
配列 |
|||
デフォルト |
||||
項目 |
言語コード |
|||
型 |
文字列 |
|||
例: |
sk |
|||
パターン |
^.*$ |
|||
デフォルト |
||||
|
監視中のプロジェクト |
|||
型 |
配列 |
|||
デフォルト |
||||
項目 |
プロジェクトのスラッグ |
|||
型 |
文字列 |
|||
例: |
weblate |
|||
パターン |
^.*$ |
|||
デフォルト |
||||
|
監査ログ |
|||
型 |
配列 |
|||
デフォルト |
||||
項目 |
項目 |
|||
型 |
オブジェクト |
|||
プロパティ |
||||
|
IP アドレス |
|||
型 |
文字列 |
|||
例: |
127.0.0.1 |
|||
パターン |
^.*$ |
|||
デフォルト |
||||
|
ユーザー エージェント |
|||
型 |
文字列 |
|||
例: |
PC / Linux / Firefox 70.0 |
|||
パターン |
^.*$ |
|||
デフォルト |
||||
|
タイムスタンプ |
|||
型 |
文字列 |
|||
例: |
2019-11-18T18:58:30.845Z |
|||
パターン |
^.*$ |
|||
デフォルト |
||||
|
作業履歴 |
|||
型 |
文字列 |
|||
例: |
ログイン |
|||
パターン |
^.*$ |
|||
デフォルト |
||||
定義 |
Weblate のリリース¶
リリース スケジュール¶
Weblate は、2 か月のペースで(x.y)としてリリースします。通常はそのあと、バグを修正したリリースが何度が続き、リリースに含まれた問題を(x.y.z)で修正します。
メジャー バージョンの変更は、アップグレード プロセスがこのバージョンをスキップできないことを示しています(より高い x.y リリースにアップグレードする前に、常に x.0 にアップグレードすることが必要)。
リリース計画¶
次回のリリースの機能は、GitHub のマイルストーンを使用して収集しています。<https://github.com/WeblateOrg/weblate/milestones> からロードマップを見ることができます。
リリース プロセス¶
リリース前に必要な確認事項:
./scripts/list-translated-languages で新規に翻訳された言語の確認。
./scripts/prepare-release で最終バージョンの設定。
スクリーンショットが最新であるかの確認 make -C docs update-screenshots。
Merge any possibly pending translations wlc push; git remote update; git merge origin/weblate
リリースの実行:
リリースの作成 ./scripts/create-release --tag (必須条件は下記を参照)。
リリース後の手動による設定方法:
Docker イメージの更新。
GitHub のマイルストーンを閉じる。
Docker イメージをテストしたら、タグを追加してプッシュする。
Helm チャートを新バージョンに更新。
.github/workflows/migrations.yml
に新しいバージョンをインクルードして、移行テストでカバーする。Increase version in the website download links.
リポジトリのバージョンを ./scripts/set-version で上げる。
./scripts/create-release スクリプトを使用してタグを作成する為に必要な項目:
リリースの署名に使用する秘密鍵がある GnuPG
Weblate git リポジトリへの push 接続(タグを push)
hub ツールを設定し、Weblate リポジトリに接続してリリースの作成
Weblate ダウンロード サーバーへ SSH 接続(Web サイトのダウンロードは、そこにコピーされます)
セキュリティとプライバシー条項¶
ちなみに
Weblate では、セキュリティはユーザーのプライバシーを尊重する環境を維持します。
Weblate の開発は、`Linux Foundation の Core Infrastructure Initiative のベストプラクティス<https://bestpractices.coreinfrastructure.org/projects/552>`_ に従っています。
参考
Tracking dependencies for vulnerabilities¶
Security issues in our dependencies are monitored using Dependabot. This covers the Python and JavaScript libraries, and the latest stable release has its dependencies updated to avoid vulnerabilities.
ヒント
There might be vulnerabilities in third-party libraries which do not affect Weblate, so those are not addressed by releasing bugfix versions of Weblate.
Docker container security¶
The Docker containers are scanned using Anchore and Trivy.
This allows us to detect vulnerabilities early and release improvements quickly.
You can get the results of these scans at GitHub — they are stored as artifacts on our CI in the SARIF format (Static Analysis Results Interchange Format).
Weblate について¶
プロジェクトの目標¶
幅広い 対応するファイル形式 に対応し、バージョン管理の統合 と密接に結びついた Web ベースのサービスを連携した翻訳ツールです。
プロジェクト名¶
"Weblate" は、"web" と "translate" を組み合わせた単語です。
プロジェクトの Web サイト¶
ランディング ページは https://weblate.org 、クラウド ホスト サービスは https://hosted.weblate.org です。ドキュメントは https://docs.weblate.org にあります。
プロジェクトのロゴ¶
プロジェクトのロゴとその他のグラフィックは、<https://github.com/WeblateOrg/graphics/> のリポジトリから入手できます。
管理者¶
このプロジェクトは Michal Čihař <michal@cihar.com> によって管理されています。
開発者¶
Weblate は Michal Čihař <michal@cihar.com> が始めました。2012 年の開設以来、何千人もの人が貢献しています。
ライセンス¶
Copyright (C) 2012 - 2021 Michal Čihař <michal@cihar.com>
このプログラムはフリーソフトウェアです: あなたは、FreeSoftware Foundation によって発行された GNU General Public License のバージョン 3 または(ユーザーの選択により)それ以降のバージョンのいずれかの条件のもとで、プログラムの再配布または変更ができます。
このプログラムは有用であることを願って配布していますが、いかなる保証もありません。商品性や特定目的への適合性の暗黙の保証もありません。詳細は GNU General Public License を確認してください。
ユーザーは、このプログラムと共に、GNU General Public License のコピーを受け取っているはずです。そうでない場合は、<https://www.gnu.org/licenses/>を確認してください。
Weblate 4.6.2¶
Released on May 8th 2021.
Fixed crash after moving shared component between projects.
Fixed adding new strings to empty properties files.
Fixed copy icon alignment in RTL languages.
Extended string statistics on the Info tab.
Fixed handling of translation files ignored in Git.
Improved metrics performance.
Fixed possible bug in saving glossaries.
Fixed consistency check behavior on languages with different plural rules.
Weblate 4.6.1¶
Released on May 2nd 2021.
Remove obsolete spam protection code.
Improve source plural check accuracy.
Update list of user interface languages in Docker.
Improved error messages when creating pull requests.
Fixed creating pull requests on Pagure.
Fixed triggering automatically installed add-ons.
Fixed possible caching issues on upgrade.
Fixed adding new units to monolingual translations using upload.
Weblate 4.6¶
Released on April 19th 2021.
The auto_translate management command has now a parameter for specifying translation mode.
:ref:`txt`に対応しました。
すべてのオブジェクトの傾向と指標の追加。
参考言語からのテキストの直接コピーに対応。
Added date filtering when browsing changes.
Improved activity charts.
Sender for contact form e-mails can now be configured.
コンポーネント作成 API のパラメーターの検証の改善。
The rate limiting no longer applies to superusers.
自動翻訳の性能と信頼性の向上。
接続制限は、Docker コンテナーでのカスタマイズに対応。
API for creating components now automatically uses Weblate の内部 URL.
Simplified state indication while listing strings.
Password hashing now uses Argon2 by default.
Simplified progress bars indicating translation status.
Renamed 不足している言語を追加 to clarify the purpose.
Fixed saving string state to XLIFF.
Added language-wide search.
Initial support for Scaling horizontally the Docker deployment.
Weblate 4.5.3¶
Released on April 1st 2021.
メトリクス収集の修正。
文字列を追加する際にクラッシュするかもしれない可能性の修正。
検索クエリの例を改善しました。
Fixed possible loss of newly added strings on replace upload.
Weblate 4.5.2¶
Released on March 26th 2021.
自動翻訳のスケジュールを設定できます。
Lua 形式の検査の追加。
Ignore format strings in the 重複単語の連続 check.
Allow uploading screenshot from a translate page.
Added forced file synchronization to the repository maintenance.
コードが長い言語の自動提案を修正しました。
新しい文字列を追加するときのパフォーマンスの向上。
品質チェックで複数のバグ修正。
Several performance improvements.
Weblate の探索 との統合の追加。
編集不可の文字列の検査機能の修正。
Weblate 4.5.1¶
Released on March 5th 2021.
Fixed editing of glossary flags in some corner cases.
Extend metrics usage to improve performance of several pages.
TMX ファイルに正しい原文言語を保存する。
API を使用したモノリンガル PO のアップロード処理の改善。
Improved alerts behavior glossaries.
Markdown のリンク確認の改善。
パンくずの中に用語集と原文言語の表示。
巨大プロジェクトのページ分割されたコンポーネント リスト。
翻訳、コンポーネント、プロジェクトの削除のパフォーマンスの改善。
Improved bulk edit performance.
Fixed preserving "Needs editing" and "Approved" states for ODF files.
翻訳ファイルのダウンロードをカスタマイズするためのインタフェースの改善
Weblate 4.5¶
Released on February 19th 2021.
gettext PO で使用する
lua-format
への対応の追加。プロジェクト間でコンポーネンの共有に対応。
Fixed multiple unnamed variables check behavior with multiple format flags.
Dropped mailing list field on the project in favor of generic instructions for translators.
Added pseudolocale generation addon.
TermBase eXchange ファイルに対応。
フラグを使用して文字列の異なる表記を手動で設定する機能の追加。
一貫性の検査の性能向上。
長い文字列の翻訳メモリの性能の向上。
説明文での検索に対応。
Strings can now be added and removed in bilingual formats as well.
Amazon Translate 機械翻訳に対応している言語一覧の拡張。
Java プロパティの Java MessageFormat の自動検出を有効にする。
翻訳に新しい文字列を追加する新しいアップロード メソッドの追加。
翻訳の閲覧用の簡単な画面の追加。
Glossaries are now stored as regular components.
Dropped specific API for glossaries as component API is used now.
Added simplified interface to toggle some of the flags.
用語集に翻訳不可、または禁止する用語の機能の追加。
用語集に専門用語の定義に対応する機能の追加。
Moved text direction toggle to get more space for the visual keyboard.
ユーザーが貢献したプロジェクトを自動的に監視に追加するオプションの追加。
Added check whether translation matches the glossary.
説明文の色の変更に対応。
Weblate 4.4.1¶
Released on January 13th 2021.
複数形の変更を元に戻す。
Fixed displaying help for project settings.
ユーザーの管理の改善。
単一言語の PO ファイルでのコンテキスト処理の改善。
Fixed cleanup addon behavior with HTML, ODF, IDML and Windows RC formats.
CSV ファイルからの位置情報解析の修正。
Use content compression for file downloads.
Improved user experience on importing from ZIP file.
アップロードのファイル形式の検出の改善。
Avoid duplicate pull requests on Pagure.
ゴースト翻訳を表示するときのパフォーマンスの向上。
Reimplemented translation editor to use native browser textarea.
Fixed cleanup addon breaking adding new strings.
Added API for addons.
Weblate 4.4¶
Released on December 15th 2020.
コンポーネント作成時の検証の改善。
Weblate now requires Django 3.1.
管理画面で外観の変更の対応を追加。
Fixed read-only state handling in bulk edit.
CodeMirror の統合の改善。
翻訳ファイルから空白の文字列を削除するアドオンの追加。
コードミラー エディタを翻訳に使用するようにしました。
Syntax highlighting in translation editor for XML, HTML, Markdown and reStructuredText.
翻訳エディタで配置可能を強調表示。
Improved support for non-standard language codes.
あいまいな言語コードを使用する場合の警告の追加。
The user is now presented with a filtered list of languages when adding a new translation.
Extended search capabilities for changes in history.
Improved billing detail pages and libre hosting workflow.
翻訳統計 API の拡張。
翻訳中の [その他の翻訳] タブの改善。
Added tasks API.
ファイル アップロードの性能の向上。
Improved display of user defined special characters.
自動翻訳のパフォーマンス向上。
ユーザー インターフェイスの複数のマイナーな機能強化。
Improved naming of ZIP downloads.
監視していないプロジェクトの通知を取得するオプションの追加。
Weblate 4.3.2¶
Released on November 4th 2020.
Fixed crash on certain component filemasks.
連続重複語検査の精度向上。
Pagure のプル リクエストの対応の追加。
失敗した登録のエラー メッセージの改善。
開発者コメントを Markdown を使用してレンダリングする機能を元に戻す。
Simplified setup of Git repositories with different default branch than "master".
Newly created internal repositories now use main as the default branch.
reStructuredText を翻訳中の、未変更の翻訳の誤検知の減少。
Fixed CodeMirror display issues in some situations.
Renamed Template group to "Sources" to clarify its meaning.
Fixed GitLab pull requests on repositories with longer paths.
Weblate 4.3.1¶
Released on October 21st 2020.
自動翻訳の性能の改善。
認証したユーザーのセッションの有効期限の修正。
バージョン情報の非表示の対応の追加。
Improve hooks compatibility with Bitbucket Server.
翻訳メモリの更新の性能の向上。
Reduced memory usage.
対応表の性能の向上。
プロジェクトからユーザーを削除する前の確認を追加。
Weblate 4.3¶
Released on October 15th 2020.
Include user stats in the API.
Fixed component ordering on paginated pages.
用語集の原文の言語の設定。
Rewritten support for GitHub and GitLab pull requests.
提案を削除した後の統計カウントを修正しました。
公開ユーザー情報を拡張しました。
Fixed configuration of enforced checks.
Improve documentation about built-in backups.
原文の言語の属性を、プロジェクトからコンポーネントに移動。
Vue I18n 書式の検査の追加。
Generic placeholders check now supports regular expressions.
対応表の外観の改善。
機械翻訳を、新しく自動提案と命名。
Added support for interacting with multiple GitLab or GitHub instances.
Extended API to cover project updates, unit updates and removals and glossaries.
Unit API now properly handles plural strings.
Component creation can now handle ZIP file or document upload.
Consolidated API response status codes.
貢献者同意条項で markdown に対応。
原文の記録を改善した。
Improved JSON, YAML and CSV formats compatibility.
文字列の削除に対応。
Improved performance of file downloads.
Improved repository management view.
Automatically enable java-format for Android.
翻訳に合わせたスクリーンショットに対応。
Python 3.9 に対応。
Fixed translating HTML files under certain conditions.
Weblate 4.2.2¶
Released on September 2nd 2020.
JSON 形式の原文の一致を修正しました。
Fixed login redirect for some authentication configurations.
Fixed LDAP authentication with group sync.
自動翻訳の進行状況のレポートのクラッシュを修正しました。
Git コミットの簡略化の有効化の修正。
Fixed creating local VCS components using API.
Weblate 4.2.1¶
Released on August 21st 2020.
Android リソースの一部の言語で複数形を保存する問題の修正。
Fixed crash in the cleanup addon for some XLIFF files.
Allow setting up localization CDN in Docker image.
Weblate 4.2¶
Released on August 18th 2020.
Improved user pages and added listing of users.
Dropped support for migrating from 3.x releases, migrate through 4.1 or 4.0.
Added exports into several monolingual formats.
Improved activity charts.
Number of displayed nearby strings can be configured.
リポジトリエラーが発生するコンポーネントをロックするためのサポートを追加しました。
Simplified main navigation (replaced buttons with icons).
Improved language code handling in Google Translate integration.
The Git squash addon can generate
Co-authored-by:
trailers.Improved query search parser.
Improved user feedback from format strings checks.
Improved performance of bulk state changes.
Added compatibility redirects after project or component renaming.
Added notifications for strings approval, component locking and license change.
Added support for ModernMT.
Allow to avoid overwriting approved translations on file upload.
Dropped support for some compatibility URL redirects.
ECMAScript テンプレート リテラルの検査を追加しました。
コンポーネントを監視するオプションを追加しました。
Removed leading dot from JSON unit keys.
翻訳メモリ用の個別の Celery キューを削除しました。
すべてのコンポーネントを一度に言語を翻訳できるようにします。
Allow to configure
Content-Security-Policy
HTTP headers.Added support for aliasing languages at project level.
New addon to help with HTML or JavaScript localization, see JavaScript 現地語化 CDN.
The Weblate domain is now configured in the settings, see
SITE_DOMAIN
.コンポーネントおよびプロジェクトによる検索のサポートを追加。
Weblate 4.1.1¶
Released on June 19th 2020.
Fixed changing autofix or addons configuration in Docker.
Fixed possible crash in "About" page.
バイト コンパイル言語ファイルのインストールの改善。
Fixed adding words to glossary.
Fixed keyboard shortcuts for machinery.
Removed debugging output causing discarding log events in some setups.
Fixed lock indication on project listing.
Fixed listing GPG keys in some setups.
Added option for which DeepL API version to use.
Added support for acting as SAML Service Provider, see SAML 認証.
Weblate 4.1¶
Released on June 15th 2020.
Added support for creating new translations with included country code.
Added support for searching source strings with screenshot.
Extended info available in the stats insights.
Improved search editing on "Translate" pages.
Improve handling of concurrent repository updates.
プロジェクト作成フォームに原文の言語を含める。
Include changes count in credits.
Fixed UI language selection in some cases.
Allow to whitelist registration methods with registrations closed.
Improved lookup of related terms in glossary.
Improved translation memory matches.
Group same machinery results.
Add direct link to edit screenshot from translate page.
Improved removal confirmation dialog.
Include templates in ZIP download.
Add support for Markdown and notification configuration in announcements.
Extended details in check listings.
新しいファイル形式のサポートを追加した: Laravel PHP 文字列、HTML ファイル、OpenDocument Format、IDML Format、Windows RC files、INI translations、Inno Setup INI の翻訳、GWT プロパティ、go-i18n JSON files、ARB File。
Consistently use dismissed as state of dismissed checks.
Add support for configuring default addons to enable.
Fixed editor keyboard shortcut to dismiss checks.
Improved machine translation of strings with placeholders.
Show ghost translation for user languages to ease starting them.
Improved language code parsing.
Show translations in user language first in the list.
シェーピングをより一般的な名前のバリエーションに変更。
Reintroduced support for wiping translation memory.
Fixed option to ignore source checks.
Added support for configuring different branch for pushing changes.
API で、HTTP ヘッダーに接続制限状態の通知を可能にした。
Added support for Google Translate V3 API (Advanced).
Added ability to restrict access on component level.
Added support for whitespace and other special chars in translation flags, see フラグを使用した動作の設定.
有効にした場合は、常に表示したテキストを検査する。
API now supports filtering of changes.
Added support for sharing glossaries between projects.
Weblate 4.0.4¶
Released on May 7th 2020.
Fixed testsuite execution on some Python 3.8 environments.
Typo fixes in the documentation.
Fixed creating components using API in some cases.
Fixed JavaScript errors breaking mobile navigation.
Fixed crash on displaying some checks.
Fixed screenshots listing.
Fixed monthly digest notifications.
Fixed intermediate translation behavior with units non existing in translation.
Weblate 4.0.3¶
Released on May 2nd 2020.
Fixed possible crash in reports.
User mentions in comments are now case insensitive.
Fixed PostgreSQL migration for non superusers.
Fixed changing the repository URL while creating component.
Fixed crash when upstream repository is gone.
Weblate 4.0.2¶
Released on April 27th 2020.
Improved performance of translation stats.
Improved performance of changing labels.
Improved bulk edit performance.
Improved translation memory performance.
Fixed possible crash on component deletion.
Fixed displaying of translation changes in some corner cases.
Improved warning about too long celery queue.
Fixed possible false positives in the consistency check.
Fixed deadlock when changing linked component repository.
Included edit distance in changes listing and CSV and reports.
Avoid false positives of punctuation spacing check for Canadian French.
Fixed XLIFF export with placeholders.
Fixed false positive with zero width check.
Improved reporting of configuration errors.
Fixed bilingual source upload.
Automatically detect supported languages for DeepL machine translation.
Fixed progress bar display in some corner cases.
Fixed some checks triggering on non translated strings.
Weblate 4.0¶
Released on April 16th 2020.
Weblate now requires Python 3.6 or newer.
Added management overview of component alerts.
Added component alert for broken repository browser URLs.
Improved sign in and registration pages.
Project access control and workflow configuration integrated to project settings.
Added check and highlighter for i18next interpolation and nesting.
Added check and highlighter for percent placeholders.
検査で不合格となった提案を表示する。
Record source string changes in history.
Upgraded Microsoft Translator to version 3 API.
Reimplemented translation memory backend.
Added support for several
is:
lookups in 検索.Allow to make 未翻訳の翻訳文 avoid internal blacklist.
Improved comments extraction from monolingual po files.
Renamed whiteboard messages to announcements.
Fixed occasional problems with registration mails.
LINGUAS 更新アドオンを改良し、より多くの構文の異なる表記を処理できるようにした。
Fixed editing monolingual XLIFF source file.
Added support for exact matching in 検索.
スクリーンショット、ユーザー、グループ、コンポーネント リストのセット、および拡張した作成プロジェクトをカバーする拡張 API。
Add support for source upload on bilingual translations.
Added support for intermediate language from developers.
Added support for source strings review.
Extended download options for platform wide translation memory.
Weblate 3.x series¶
Weblate 3.11.3¶
Released on March 11th 2020.
Fixed searching for fields with certain priority.
Fixed predefined query for recently added strings.
Fixed searching returning duplicate matches.
Gmail に表示する通知の修正。
Fixed reverting changes from the history.
Added links to events in digest notifications.
Fixed email for account removal confirmation.
Added support for Slack authentication in Docker container.
Avoid sending notifications for not subscribed languages.
Include Celery queues in performance overview.
Fixed documentation links for addons.
未翻訳の翻訳検査の誤検知を減らしました。
Raised bleach dependency to address CVE-2020-6802.
Fixed listing project level changes in history.
Fixed stats invalidation in some corner cases.
Fixed searching for certain string states.
Improved format string checks behavior on missing percent.
Fixed authentication using some third party providers.
Weblate 3.11.2¶
Released on February 22nd 2020.
提案の表示の修正。
Fixed some strings wrongly reported as having no words.
Weblate 3.11.1¶
Released on February 20th 2020.
Documented Celery setup changes.
Improved filename validation on component creation.
Fixed minimal versions of some dependencies.
Fixed adding groups with certain Django versions.
Fixed manual pushing to upstream repository.
Improved glossary matching.
Weblate 3.11¶
Released on February 17th 2020.
Allow using VCS push URL during component creation via API.
表示する横幅の検査に、表示したイメージの表示に変更。
Fixed links in notifications e-mails.
Improved look of plaintext e-mails.
Display ignored checks and allow to make them active again.
Display nearby keys on monolingual translations.
文字列整形のグループ化のサポートを追加しました。
Recommend upgrade to new Weblate versions in the system checks.
Provide more detailed analysis for duplicate language alert.
Include more detailed license info on the project pages.
Automatically unshallow local copies if needed.
Fixed download of strings needing action.
New alert to warn about using the same filemask twice.
Improve XML placeables extraction.
The
SINGLE_PROJECT
can now enforce redirection to chosen project.Added option to resolve comments.
Added bulk editing of flags.
Added support for String labels.
Added bulk edit addon.
Added option for 検査の強制.
Increased default validity of confirmation links.
Improved Matomo integration.
Fixed 翻訳済み to correctly handle source string change.
Extended automatic updates configuration by
AUTO_UPDATE
.LINGUAS addons now do full sync of translations in Weblate.
Weblate 3.10.2¶
Released on January 18th 2020.
Add lock indication to projects.
Fixed CSS bug causing flickering in some web browsers.
英語以外の言語のシステムでの検索の修正。
Improved repository matching for GitHub and Bitbucket hooks.
Fixed data migration on some Python 2.7 installations.
Allow configuration of Git shallow cloning.
Improved background notification processing.
Fixed broken form submission when navigating back in web browser.
New addon to configure YAML formatting.
Fixed same plurals check to not fire on single plural form languages.
Fixed regex search on some fields.
Weblate 3.10.1¶
Released on January 9th 2020.
Extended API with translation creation.
Fixed several corner cases in data migrations.
Compatibility with Django 3.0.
データ クリーンアップの性能の向上。
Added support for customizable security.txt.
Improved breadcrumbs in changelog.
Improved translations listing on dashboard.
Improved HTTP responses for webhooks.
Added support for GitLab merge requests in Docker container.
Weblate 3.10¶
Released on December 20th 2019.
Improved application user interface.
Added doublespace check.
Fixed creating new languages.
Avoid sending auditlog notifications to deleted e-mails.
編集不可の文字列の機能追加。
Added support for Markdown in comments.
Allow placing translation instruction text in project info.
参考言語のコピーをクリップボードに追加する。
Improved support for Mercurial.
Improved Git repository fetching performance.
Add search lookup for age of string.
すべての翻訳の原文の言語を表示。
Show context for nearby strings.
Added support for notifications on repository operations.
Improved translation listings.
Extended search capabilities.
Added support for automatic translation strings marked for editing.
Avoid sending duplicate notifications for linked component alerts.
Improve default merge request message.
Better indicate string state in Zen mode.
Added support for more languages in Yandex Translate.
Improved look of notification e-mails.
Provide choice for translation license.
Weblate 3.9.1¶
Released on October 28th 2019.
Remove some unneeded files from backups.
Fixed potential crash in reports.
Fixed cross database migration failure.
Added support for force pushing Git repositories.
Reduced risk of registration token invalidation.
アカウントの試行接続制限の削除の修正。
Added search based on priority.
Fixed possible crash on adding strings to JSON file.
Safe HTML check and fixup now honor source string markup.
Avoid sending notifications to invited and deleted users.
Fix SSL connection to redis in Celery in Docker container.
Weblate 3.9¶
Released on October 15th 2019.
Include Weblate metadata in downloaded files.
Improved UI for failing checks.
Indicate missing strings in format checks.
Separate check for French punctuation spacing.
Add support for fixing some of quality checks errors.
Add separate permission to create new projects.
Extend stats for char counts.
Improve support for Java style language codes.
Added new generic check for placeholders.
Added support for WebExtension JSON placeholders.
Added support for flat XML format.
Extended API with project, component and translation removal and creation.
Added support for Gitea and Gitee webhooks.
Added new custom regex based check.
Allow to configure contributing to shared translation memory.
Added ZIP download for more translation files.
Make XLIFF standard compliant parsing of maxwidth and font.
Added new check and fixer for safe HTML markup for translating web applications.
Add component alert on unsupported configuration.
Added automatic translation addon to bootstrap translations.
Extend automatic translation to add suggestions.
Display addon parameters on overview.
Sentry is now supported through modern Sentry SDK instead of Raven.
Changed example settings to be better fit for production environment.
Added automated backups using BorgBackup.
Split cleanup addon for RESX to avoid unwanted file updates.
Added advanced search capabilities.
Allow users to download their own reports.
Added localization guide to help configuring components.
Added support for GitLab merge requests.
Improved display of repository status.
Perform automated translation in the background.
Weblate 3.8¶
Released on August 15th 2019.
Added support for simplified creating of similar components.
Added support for parsing translation flags from the XML based file formats.
Log exceptions into Celery log.
Improve performance of repository scoped addons.
Improved look of notification e-mails.
Fixed password reset behavior.
Improved performance on most of translation pages.
Fixed listing of languages not known to Weblate.
Add support for cloning addons to discovered components.
Add support for replacing file content with uploaded.
Add support for translating non VCS based content.
Added OpenGraph widget image to use on social networks.
Added support for animated screenshots.
Improved handling of monolingual XLIFF files.
Avoid sending multiple notifications for single event.
Add support for filtering changes.
Extended predefined periods for reporting.
Added webhook support for Azure Repos.
New opt-in notifications on pending suggestions or untranslated strings.
Add one click unsubscribe link to notification e-mails.
Fixed false positives with Has been translated check.
New management interface for admins.
String priority can now be specified using flags.
Added language management views.
Add checks for Qt library and Ruby format strings.
Added configuration to better fit single project installations.
Notify about new string on source string change on monolingual translations.
Added separate view for translation memory with search capability.
Weblate 3.7.1¶
Released on June 28th 2019.
Documentation updates.
Fixed some requirements constraints.
Updated language database.
Localization updates.
Various user interface tweaks.
Improved handling of unsupported but discovered translation files.
More verbosely report missing file format requirements.
Weblate 3.7¶
Released on June 21st 2019.
Added separate Celery queue for notifications.
Use consistent look with application for API browsing.
Include approved stats in the reports.
Report progress when updating translation component.
Allow to abort running background component update.
Extend template language for filename manipulations.
Use templates for editor link and repository browser URL.
Indicate max length and current characters count when editing translation.
未翻訳の翻訳検査での省略形の処理を改善しました。
Refreshed landing page for new contributors.
Add support for configuring msgmerge addon.
Delay opening SMTP connection when sending notifications.
Improved error logging.
Allow custom location in MO generating addon.
Added addons to cleanup old suggestions or comments.
Added option to enable horizontal mode in the Zen editor.
Improved import performance with many linked components.
Fixed examples installation in some cases.
変更時の警告表示の改善。
Added new horizontal stats widget.
Improved format strings check on plurals.
Added font management tool.
新しく、表示した文字サイズの検査実施。
Added support for subtitle formats.
Include overall completion stats for languages.
Added reporting at project and global scope.
Improved user interface when showing translation status.
New Weblate logo and color scheme.
New look of bitmap badges.
Weblate 3.6.1¶
Released on April 26th 2019.
Improved handling of monolingual XLIFF files.
Fixed digest notifications in some corner cases.
Fixed addon script error alert.
Fixed generating MO file for monolingual PO files.
Fixed display of uninstalled checks.
Indicate administered projects on project listing.
Allow update to recover from missing VCS repository.
Weblate 3.6¶
Released on April 20th 2019.
Add support for downloading user data.
Addons are now automatically triggered upon installation.
Improved instructions for resolving merge conflicts.
Cleanup addon is now compatible with app store metadata translations.
Configurable language code syntax when adding new translations.
Warn about using Python 2 with planned termination of support in April 2020.
Extract special characters from the source string for visual keyboard.
Extended contributor stats to reflect both source and target counts.
Admins and consistency addons can now add translations even if disabled for users.
Fixed description of toggle disabling
Language-Team
header manipulation.Notify users mentioned in comments.
Removed file format autodetection from component setup.
Fixed generating MO file for monolingual PO files.
Added digest notifications.
Added support for muting component notifications.
Added notifications for new alerts, whiteboard messages or components.
Notifications for administered projects can now be configured.
Improved handling of three letter language codes.
Weblate 3.5.1¶
Released on March 10th 2019.
Fixed Celery systemd unit example.
Fixed notifications from HTTP repositories with login.
Fixed race condition in editing source string for monolingual translations.
Include output of failed addon execution in the logs.
Improved validation of choices for adding new language.
Allow to edit file format in component settings.
Update installation instructions to prefer Python 3.
Performance and consistency improvements for loading translations.
Microsoft Terminology service を Zeep の現行リリースとの互換性に対応。
Localization updates.
Weblate 3.5¶
Released on March 3rd 2019.
Improved performance of built-in translation memory.
Added interface to manage global translation memory.
Improved alerting on bad component state.
Added user interface to manage whiteboard messages.
Addon commit message now can be configured.
Reduce number of commits when updating upstream repository.
Fixed possible metadata loss when moving component between projects.
Improved navigation in the Zen mode.
Added several new quality checks (Markdown related and URL).
Added support for app store metadata files.
Added support for toggling GitHub or Gerrit integration.
Kashida 文字の検査の追加。
Added option to squash commits based on authors.
Improved support for XLSX file format.
Compatibility with Tesseract 4.0.
Billing addon now removes projects for unpaid billings after 45 days.
Weblate 3.4¶
Released on January 22nd 2019.
Added support for XLIFF placeholders.
Celery can now utilize multiple task queues.
Added support for renaming and moving projects and components.
Include characters counts in reports.
Added guided adding of translation components with automatic detection of translation files.
Customizable merge commit messages for Git.
Added visual indication of component alerts in navigation.
Improved performance of loading translation files.
New addon to squash commits prior to push.
Improved displaying of translation changes.
Changed default merge style to rebase and made that configurable.
Better handle private use subtags in language code.
Improved performance of fulltext index updates.
Extended file upload API to support more parameters.
Weblate 3.3¶
Released on November 30th 2018.
Added support for component and project removal.
Improved performance for some monolingual translations.
Added translation component alerts to highlight problems with a translation.
Expose XLIFF string resname as context when available.
Added support for XLIFF states.
Added check for non writable files in DATA_DIR.
Improved CSV export for changes.
Weblate 3.2.2¶
Released on October 20th 2018.
Remove no longer needed Babel dependency.
Updated language definitions.
Improve documentation for addons, LDAP and Celery.
Fixed enabling new dos-eol and auto-java-messageformat flags.
Fixed running setup.py test from PyPI package.
Improved plurals handling.
Fixed translation upload API failure in some corner cases.
Fixed updating Git configuration in case it was changed manually.
Weblate 3.2.1¶
Released on October 10th 2018.
Document dependency on backports.csv on Python 2.7.
Fix running tests under root.
Improved error handling in gitexport module.
Fixed progress reporting for newly added languages.
Correctly report Celery worker errors to Sentry.
Fixed creating new translations with Qt Linguist.
Fixed occasional fulltext index update failures.
Improved validation when creating new components.
Added support for cleanup of old suggestions.
Weblate 3.2¶
Released on October 6th 2018.
Add install_addon management command for automated addon installation.
詳細な接続制限の許可。
Added support for export and import of Excel files.
Improve component cleanup in case of multiple component discovery addons.
Microsoft Terminology の機械翻訳バックエンドの書き直し。
Weblate now uses Celery to offload some processing.
Improved search capabilities and added regular expression search.
Added support for Youdao Zhiyun API machine translation.
Added support for Baidu API machine translation.
Integrated maintenance and cleanup tasks using Celery.
Improved performance of loading translations by almost 25%.
Removed support for merging headers on upload.
Removed support for custom commit messages.
Configurable editing mode (zen/full).
Added support for error reporting to Sentry.
Added support for automated daily update of repositories.
Added support for creating projects and components by users.
標準搭載の翻訳メモリの、翻訳の自動保存に対応。
Users and projects can import their existing translation memories.
Better management of related strings for screenshots.
Added support for checking Java MessageFormat.
See 3.2 milestone on GitHub for detailed list of addressed issues.
Weblate 3.1¶
Released on July 27th 2018.
Upgrades from older version than 3.0.1 are not supported.
Allow to override default commit messages from settings.
Improve webhooks compatibility with self hosted environments.
Added support for Amazon Translate.
Compatibility with Django 2.1.
Django system checks are now used to diagnose problems with installation.
Removed support for soon shutdown libravatar service.
未翻訳の翻訳を、編集が必要なものとしてマークするための新しいアドオン。
Add support for jumping to specific location while translating.
Downloaded translations can now be customized.
Improved calculation of string similarity in translation memory matches.
Added support by signing Git commits by GnuPG.
Weblate 3.0.1¶
Released on June 10th 2018.
Fixed possible migration issue from 2.20.
Localization updates.
Removed obsolete hook examples.
Improved caching documentation.
Fixed displaying of admin documentation.
Improved handling of long language names.
Weblate 3.0¶
Released on June 1st 2018.
Rewritten access control.
Several code cleanups that lead to moved and renamed modules.
New addon for automatic component discovery.
The import_project management command has now slightly different parameters.
Added basic support for Windows RC files.
New addon to store contributor names in PO file headers.
The per component hook scripts are removed, use addons instead.
Add support for collecting contributor agreements.
Access control changes are now tracked in history.
New addon to ensure all components in a project have same translations.
Support for more variables in commit message templates.
Add support for providing additional textual context.
Weblate 2.x series¶
Weblate 2.20¶
Released on April 4th 2018.
Improved speed of cloning subversion repositories.
Changed repository locking to use third party library.
Added support for downloading only strings needing action.
Added support for searching in several languages at once.
New addon to configure gettext output wrapping.
New addon to configure JSON formatting.
Added support for authentication in API using RFC 6750 compatible Bearer authentication.
Added support for automatic translation using machine translation services.
Added support for HTML markup in whiteboard messages.
Added support for mass changing state of strings.
Translate-toolkit at least 2.3.0 is now required, older versions are no longer supported.
翻訳メモリの標準搭載。
ダッシュボードおよびコンポーネント リストのセットの概要ページにコンポーネント リストの概要を追加した。
Added support for DeepL machine translation service.
Machine translation results are now cached inside Weblate.
コミットされた変更の並び替えのサポートを追加しました。
Weblate 2.19.1¶
Released on February 20th 2018.
Fixed migration issue on upgrade from 2.18.
Improved file upload API validation.
Weblate 2.19¶
Released on February 15th 2018.
Fixed imports across some file formats.
Display human friendly browser information in audit log.
Added TMX exporter for files.
Various performance improvements for loading translation files.
Added option to disable access management in Weblate in favor of Django one.
Improved glossary lookup speed for large strings.
Compatibility with django_auth_ldap 1.3.0.
Configuration errors are now stored and reported persistently.
Honor ignore flags in whitespace autofixer.
Improved compatibility with some Subversion setups.
標準搭載の機械翻訳サービスの改善。
Added support for SAP Translation Hub service.
Microsoft Terminology service に対応した機能の追加。
Removed support for advertisement in notification e-mails.
Improved translation progress reporting at language level.
Improved support for different plural formulas.
Added support for Subversion repositories not using stdlayout.
Added addons to customize translation workflows.
Weblate 2.18¶
Released on December 15th 2017.
Extended contributor stats.
Improved configuration of special characters virtual keyboard.
Added support for DTD file format.
Changed keyboard shortcuts to less likely collide with browser/system ones.
Improved support for approved flag in XLIFF files.
Added support for not wrapping long strings in gettext PO files.
Added button to copy permalink for current translation.
Dropped support for Django 1.10 and added support for Django 2.0.
Removed locking of translations while translating.
Added support for adding new strings to monolingual translations.
Added support for translation workflows with dedicated reviewers.
Weblate 2.17.1¶
Released on October 13th 2017.
Fixed running testsuite in some specific situations.
言語の更新。
Weblate 2.17¶
Released on October 13th 2017.
Weblate by default does shallow Git clones now.
Improved performance when updating large translation files.
Added support for blocking certain e-mails from registration.
Users can now delete their own comments.
Added preview step to search and replace feature.
Client side persistence of settings in search and upload forms.
Extended search capabilities.
More fine grained per project ACL configuration.
Default value of BASE_DIR has been changed.
Added two step account removal to prevent accidental removal.
Project access control settings is now editable.
Added optional spam protection for suggestions using Akismet.
Weblate 2.16¶
Released on August 11th 2017.
Various performance improvements.
Added support for nested JSON format.
Added support for WebExtension JSON format.
Fixed git exporter authentication.
Improved CSV import in certain situations.
Improved look of Other translations widget.
The max-length checks is now enforcing length of text in form.
Make the commit_pending age configurable per component.
Various user interface cleanups.
Fixed component/project/site wide search for translations.
Weblate 2.15¶
Released on June 30th 2017.
Show more related translations in other translations.
Add option to see translations of current string to other languages.
Use 4 plural forms for Lithuanian by default.
Fixed upload for monolingual files of different format.
Improved error messages on failed authentication.
Keep page state when removing word from glossary.
参考言語の翻訳を編集するための直接リンクの追加。
Added Perl format quality check.
Added support for rejecting reused passwords.
Extended toolbar for editing RTL languages.
Weblate 2.14.1¶
Released on May 24th 2017.
Fixed possible error when paginating search results.
Fixed migrations from older versions in some corner cases.
Fixed possible CSRF on project watch and unwatch.
The password reset no longer authenticates user.
Fixed possible CAPTCHA bypass on forgotten password.
Weblate 2.14¶
Released on May 17th 2017.
Add glossary entries using AJAX.
The logout now uses POST to avoid CSRF.
The API key token reset now uses POST to avoid CSRF.
Weblate sets Content-Security-Policy by default.
The local editor URL is validated to avoid self-XSS.
The password is now validated against common flaws by default.
Notify users about important activity with their account such as password change.
The CSV exports now escape potential formulas.
Various minor improvements in security.
認証の試行は現在接続制限中です。
Suggestion content is stored in the history.
Store important account activity in audit log.
Ask for password confirmation when removing account or adding new associations.
Show time when suggestion has been made.
There is new quality check for trailing semicolon.
Ensure that search links can be shared.
Included source string information and screenshots in the API.
Allow to overwrite translations through API upload.
Weblate 2.13.1¶
Released on Apr 12th 2017.
Fixed listing of managed projects in profile.
Fixed migration issue where some permissions were missing.
Fixed listing of current file format in translation download.
Return HTTP 404 when trying to access project where user lacks privileges.
Weblate 2.13¶
Released on Apr 12th 2017.
Fixed quality checks on translation templates.
Added quality check to trigger on losing translation.
Add option to view pending suggestions from user.
コンポーネント リストのセットを自動的に構築するオプションを追加した。
Default dashboard for unauthenticated users can be configured.
Add option to browse 25 random strings for review.
History now indicates string change.
Better error reporting when adding new translation.
Added per language search within project.
Group ACLs can now be limited to certain permissions.
The per project ALCs are now implemented using Group ACL.
Added more fine grained privileges control.
Various minor UI improvements.
Weblate 2.12¶
Released on Mar 3rd 2017.
Improved admin interface for groups.
Added support for Yandex Translate API.
Improved speed of site wide search.
Added project and component wide search.
Added project and component wide search and replace.
不整合な翻訳の表示の改善。
Added support for opening source files in local editor.
Added support for configuring visual keyboard with special characters.
Improved screenshot management with OCR support for matching source strings.
Default commit message now includes translation information and URL.
Added support for Joomla translation format.
Improved reliability of import across file formats.
Weblate 2.11¶
Released on Jan 31st 2017.
Include language detailed information on language page.
Mercurial backend improvements.
Added option to specify translation component priority.
More consistent usage of Group ACL even with less used permissions.
Added WL_BRANCH variable to hook scripts.
Improved developer documentation.
Better compatibility with various Git versions in Git exporter addon.
Included per project and component stats.
Added language code mapping for better support of Microsoft Translate API.
Moved fulltext cleanup to background job to make translation removal faster.
Fixed displaying of plural source for languages with single plural form.
Improved error handling in import_project.
Various performance improvements.
Weblate 2.10.1¶
Released on Jan 20th 2017.
Do not leak account existence on password reset form (CVE-2017-5537).
Weblate 2.10¶
Released on Dec 15th 2016.
Added quality check to check whether plurals are translated differently.
Fixed GitHub hooks for repositories with authentication.
Added optional Git exporter module.
Support for Microsoft Cognitive Services Translator API.
Simplified project and component user interface.
Added automatic fix to remove control characters.
Added per language overview to project.
Added support for CSV export.
Added CSV download for stats.
Added matrix view for quick overview of all translations.
Added basic API for changes and strings.
Added support for Apertium APy server for machine translations.
Weblate 2.9¶
Released on Nov 4th 2016.
Extended parameters for createadmin management command.
Extended import_json to be able to handle with existing components.
Added support for YAML files.
Project owners can now configure translation component and project details.
Use "Watched" instead of "Subscribed" projects.
Projects can be watched directly from project page.
Added multi language status widget.
原文を表示しない場合は、参考言語を強調表示する。
Record suggestion deletion in history.
Improved UX of languages selection in profile.
Fixed showing whiteboard messages for component.
保存後も環境設定タブを選択したままにする。
Show source string comment more prominently.
Automatically install Gettext PO merge driver for Git repositories.
Added search and replace feature.
Added support for uploading visual context (screenshots) for translations.
Weblate 2.8¶
Released on Aug 31st 2016.
Documentation improvements.
Translations.
Updated bundled javascript libraries.
Added list_translators management command.
Django 1.8 is no longer supported.
Fixed compatibility with Django 1.10.
Added Subversion support.
Separated XML validity check from XML mismatched tags.
Fixed API to honor HIDE_REPO_CREDENTIALS settings.
Show source change in Zen mode.
Alt+PageUp/PageDown/Home/End now works in Zen mode as well.
Add tooltip showing exact time of changes.
Add option to select filters and search from translation page.
Added UI for translation removal.
Improved behavior when inserting placeables.
Fixed auto locking issues in Zen mode.
Weblate 2.7¶
Released on Jul 10th 2016.
Removed Google web translate machine translation.
Improved commit message when adding translation.
Fixed Google Translate API for Hebrew language.
Compatibility with Mercurial 3.8.
Added import_json management command.
Correct ordering of listed translations.
Show full suggestion text, not only a diff.
Extend API (detailed repository status, statistics, …).
Testsuite no longer requires network access to test repositories.
Weblate 2.6¶
Released on Apr 28th 2016.
Fixed validation of components with language filter.
Improved support for XLIFF files.
Fixed machine translation for non English sources.
Added REST API.
Django 1.10 compatibility.
Added categories to whiteboard messages.
Weblate 2.5¶
Released on Mar 10th 2016.
Fixed automatic translation for project owners.
Improved performance of commit and push operations.
New management command to add suggestions from command line.
Added support for merging comments on file upload.
Added support for some GNU extensions to C printf format.
Documentation improvements.
Added support for generating translator credits.
Added support for generating contributor stats.
Site wide search can search only in one language.
Improve quality checks for Armenian.
Support for starting translation components without existing translations.
Support for adding new translations in Qt TS.
Improved support for translating PHP files.
Performance improvements for quality checks.
サイト全体で検査で不合格となったものの検索を修正。
原文の言語を指定するオプションの追加。
Improved support for XLIFF files.
Extended list of options for import_project.
Improved targeting for whiteboard messages.
Support for automatic translation across projects.
Optimized fulltext search index.
Added management command for auto translation.
Added placeables highlighting.
Added keyboard shortcuts for placeables, checks and machine translations.
Improved translation locking.
Added quality check for AngularJS interpolation.
Added extensive group based ACLs.
編集が必要な文字列に関する用語の明確化(以前は "fuzzy”)。
作業が必要な文字列と、未翻訳の文字列の用語の明確化。
Support for Python 3.
Dropped support for Django 1.7.
Dropped dependency on msginit for creating new gettext PO files.
Added configurable dashboard views.
Improved notifications on parse errors.
Added option to import components with duplicate name to import_project.
Improved support for translating PHP files.
Added XLIFF export for dictionary.
Added XLIFF and gettext PO export for all translations.
Documentation improvements.
Added support for configurable automatic group assignments.
Improved adding of new translations.
Weblate 2.4¶
Released on Sep 20th 2015.
Improved support for PHP files.
Ability to add ACL to anonymous user.
Improved configurability of import_project command.
Added CSV dump of history.
Avoid copy/paste errors with whitespace characters.
Added support for Bitbucket webhooks.
Tighter control on fuzzy strings on translation upload.
Several URLs have changed, you might have to update your bookmarks.
Hook scripts are executed with VCS root as current directory.
Hook scripts are executed with environment variables describing current component.
Add management command to optimize fulltext index.
Added support for error reporting to Rollbar.
Projects now can have multiple owners.
Project owners can manage themselves.
Added support for
javascript-format
used in gettext PO.Support for adding new translations in XLIFF.
Improved file format autodetection.
Extended keyboard shortcuts.
Improved dictionary matching for several languages.
Improved layout of most of pages.
Support for adding words to dictionary while translating.
Added support for filtering languages to be managed by Weblate.
Added support for translating and importing CSV files.
Rewritten handling of static files.
Direct login/registration links to third-party service if that's the only one.
Commit pending changes on account removal.
Add management command to change site name.
Add option to configure default committer.
Add hook after adding new translation.
Add option to specify multiple files to add to commit.
Weblate 2.3¶
Released on May 22nd 2015.
Dropped support for Django 1.6 and South migrations.
Support for adding new translations when using Java Property files.
Allow to accept suggestion without editing.
Improved support for Google OAuth 2.0.
Added support for Microsoft .resx files.
Tuned default robots.txt to disallow big crawling of translations.
Simplified workflow for accepting suggestions.
Added project owners who always receive important notifications.
Allow to disable editing of monolingual template.
More detailed repository status view.
Direct link for editing template when changing translation.
Allow to add more permissions to project owners.
Zen モードで参考言語の表示。
参考言語での原文の言語の非表示に対応。
Weblate 2.2¶
Released on Feb 19th 2015.
Performance improvements.
Fulltext search on location and comments fields.
New SVG/javascript based activity charts.
Support for Django 1.8.
Support for deleting comments.
Added own SVG badge.
Added support for Google Analytics.
Improved handling of translation filenames.
Added support for monolingual JSON translations.
Record component locking in a history.
Support for editing source (template) language for monolingual translations.
Added basic support for Gerrit.
Weblate 2.1¶
Released on Dec 5th 2014.
Added support for Mercurial repositories.
Replaced Glyphicon font by Awesome.
Added icons for social authentication services.
Better consistency of button colors and icons.
Documentation improvements.
Various bugfixes.
Automatic hiding of columns in translation listing for small screens.
Changed configuration of filesystem paths.
Improved SSH keys handling and storage.
Improved repository locking.
Customizable quality checks per source string.
Allow to hide completed translations from dashboard.
Weblate 2.0¶
Released on Nov 6th 2014.
New responsive UI using Bootstrap.
Rewritten VCS backend.
Documentation improvements.
Added whiteboard for site wide messages.
Configurable strings priority.
Added support for JSON file format.
Fixed generating mo files in certain cases.
Added support for GitLab notifications.
Added support for disabling translation suggestions.
Django 1.7 support.
ACL projects now have user management.
Extended search possibilities.
Give more hints to translators about plurals.
Fixed Git repository locking.
Compatibility with older Git versions.
Improved ACL support.
Added buttons for per language quotes and other special characters.
Support for exporting stats as JSONP.
Weblate 1.x series¶
Weblate 1.9¶
Released on May 6th 2014.
Django 1.6 compatibility.
No longer maintained compatibility with Django 1.4.
Management commands for locking/unlocking translations.
Improved support for Qt TS files.
Users can now delete their account.
Avatars can be disabled.
Merged first and last name attributes.
Avatars are now fetched and cached server side.
Added support for shields.io badge.
Weblate 1.8¶
Released on November 7th 2013.
Please check manual for upgrade instructions.
Nicer listing of project summary.
Better visible options for sharing.
More control over anonymous users privileges.
Supports login using third party services, check manual for more details.
Users can login by e-mail instead of username.
Documentation improvements.
Improved source strings review.
Searching across all strings.
Better tracking of source strings.
Captcha protection for registration.
Weblate 1.7¶
Released on October 7th 2013.
Please check manual for upgrade instructions.
Support for checking Python brace format string.
Per component customization of quality checks.
Detailed per translation stats.
Changed way of linking suggestions, checks and comments to strings.
Users can now add text to commit message.
Support for subscribing on new language requests.
Support for adding new translations.
ウィジェットとチャートは Pango + Cairo の代わりに Pillow を使って描画するように変更。
Add status badge widget.
無効なテキストの方向チェックの削除。
Changes in dictionary are now logged in history.
Performance improvements for translating view.
Weblate 1.6¶
Released on July 25th 2013.
Nicer error handling on registration.
Browsing of changes.
Fixed sorting of machine translation suggestions.
Improved support for MyMemory machine translation.
Added support for Amagama machine translation.
Various optimizations on frequently used pages.
Highlights searched phrase in search results.
Support for automatic fixups while saving the message.
Tracking of translation history and option to revert it.
Added support for Google Translate API.
Added support for managing SSH host keys.
Various form validation improvements.
Various quality checks improvements.
Performance improvements for import.
Added support for voting on suggestions.
Cleanup of admin interface.
Weblate 1.5¶
Released on April 16th 2013.
Please check manual for upgrade instructions.
Added public user pages.
Better naming of plural forms.
Added support for TBX export of glossary.
Added support for Bitbucket notifications.
Activity charts are now available for each translation, language or user.
Extended options of import_project admin command.
Compatible with Django 1.5.
Avatars are now shown using libravatar.
Added possibility to pretty print JSON export.
Various performance improvements.
Indicate failing checks or fuzzy strings in progress bars for projects or languages as well.
Added support for custom pre-commit hooks and committing additional files.
Rewritten search for better performance and user experience.
New interface for machine translations.
Added support for monolingual po files.
Extend amount of cached metadata to improve speed of various searches.
Now shows word counts as well.
Weblate 1.4¶
Released on January 23rd 2013.
Fixed deleting of checks/comments on string deletion.
Added option to disable automatic propagation of translations.
Added option to subscribe for merge failures.
Correctly import on projects which needs custom ttkit loader.
Added sitemaps to allow easier access by crawlers.
Provide direct links to string in notification e-mails or feeds.
Various improvements to admin interface.
Provide hints for production setup in admin interface.
Added per language widgets and engage page.
Improved translation locking handling.
ウィジェットのコード スニペットに、より多くの種類を表示。
Indicate failing checks or fuzzy strings in progress bars.
More options for formatting commit message.
Fixed error handling with machine translation services.
Improved automatic translation locking behaviour.
Support for showing changes from previous source string.
Added support for substring search.
Various quality checks improvements.
Support for per project ACL.
Basic code coverage by unit tests.
Weblate 1.3¶
Released on November 16th 2012.
Compatibility with PostgreSQL database backend.
Removes languages removed in upstream git repository.
Improved quality checks processing.
Added new checks (BB code, XML markup and newlines).
Support for optional rebasing instead of merge.
Possibility to relocate Weblate (for example to run it under /weblate path).
Support for manually choosing file type in case autodetection fails.
Better support for Android resources.
Support for generating SSH key from web interface.
More visible data exports.
New buttons to enter some special characters.
Support for exporting dictionary.
Support for locking down whole Weblate installation.
Checks for source strings and support for source strings review.
Support for user comments for both translations and source strings.
Better changes log tracking.
Changes can now be monitored using RSS.
Improved support for RTL languages.
Weblate 1.2¶
Released on August 14th 2012.
Weblate now uses South for database migration, please check upgrade instructions if you are upgrading.
Fixed minor issues with linked git repos.
New introduction page for engaging people with translating using Weblate.
Added widgets which can be used for promoting translation projects.
Added option to reset repository to origin (for privileged users).
Project or component can now be locked for translations.
Possibility to disable some translations.
Configurable options for adding new translations.
Configuration of git commits per project.
Simple antispam protection.
Better layout of main page.
Support for automatically pushing changes on every commit.
Support for e-mail notifications of translators.
使用している言語のみを環境設定に一覧表示します。
Improved handling of not known languages when importing project.
Support for locking translation by translator.
Optionally maintain
Language-Team
header in po file.Include some statistics in about page.
Supports (and requires) django-registration 0.8.
不合格項目の文字列の数をキャッシュする。
Checking of requirements during setup.
Documentation improvements.
Weblate 1.1¶
Released on July 4th 2012.
Improved several translations.
Better validation while creating component.
Added support for shared git repositories across components.
Do not necessary commit on every attempt to pull remote repo.
Added support for offloading indexing.
Weblate 1.0¶
Released on May 10th 2012.
Improved validation while adding/saving component.
Experimental support for Android component files (needs patched ttkit).
Updates from hooks are run in background.
Improved installation instructions.
Improved navigation in dictionary.
Weblate 0.x series¶
Weblate 0.9¶
Released on April 18th 2012.
Fixed import of unknown languages.
Improved listing of nearby messages.
Improved several checks.
Documentation updates.
Added definition for several more languages.
Various code cleanups.
Documentation improvements.
Changed file layout.
Update helper scripts to Django 1.4.
Improved navigation while translating.
Better handling of po file renames.
Better validation while creating component.
Integrated full setup into syncdb.
Added list of recent changes to all translation pages.
Check for not translated strings ignores format string only messages.
Weblate 0.8¶
Released on April 3rd 2012.
Replaced own full text search with Whoosh.
Various fixes and improvements to checks.
New command updatechecks.
Lot of translation updates.
Added dictionary for storing most frequently used terms.
Added /admin/report/ for overview of repositories status.
Machine translation services no longer block page loading.
Management interface now contains also useful actions to update data.
Records log of changes made by users.
Ability to postpone commit to Git to generate less commits from single user.
Possibility to browse failing checks.
Automatic translation using already translated strings.
New about page showing used versions.
Django 1.4 compatibility.
Ability to push changes to remote repo from web interface.
Added review of translations done by others.
Weblate 0.7¶
Released on February 16th 2012.
Direct support for GitHub notifications.
Added support for cleaning up orphaned checks and translations.
Displays nearby strings while translating.
Displays similar strings while translating.
Improved searching for string.
Weblate 0.6¶
Released on February 14th 2012.
Added various checks for translated messages.
Tunable access control.
Improved handling of translations with new lines.
Added client side sorting of tables.
Please check upgrading instructions in case you are upgrading.
Weblate 0.5¶
Released on February 12th 2012.
- Support for machine translation using following online services:
Apertium
Microsoft Translator
MyMemory
Several new translations.
Improved merging of upstream changes.
Better handle concurrent git pull and translation.
Propagating works for fuzzy changes as well.
Propagating works also for file upload.
Fixed file downloads while using FastCGI (and possibly others).
Weblate 0.4¶
Released on February 8th 2012.
Added usage guide to documentation.
Fixed API hooks not to require CSRF protection.
Weblate 0.3¶
Released on February 8th 2012.
Better display of source for plural translations.
New documentation in Sphinx format.
翻訳中に参考言語の表示。
Improved error page to give list of existing projects.
New per language stats.
Weblate 0.2¶
Released on February 7th 2012.
Improved validation of several forms.
Warn users on profile upgrade.
Remember URL for login.
Naming of text areas while entering plural forms.
Automatic expanding of translation area.
ソーシャル認証¶
Welcome to Python Social Auth’s documentation! のおかげで、GitLab、Ubuntu、Fedora など、多くのサードパーティサービスを使用した認証に対応しています。
一般的な設定方法については、Django Framework のドキュメントを確認してください。
注釈
デフォルトでは、Weblate はサードパーティの認証サービスを使用して、検証済みのメールアドレスを運用します。使用するサービスの中に、認証サービスに対応していないものについては、FORCE_EMAIL_VALIDATION を設定して、Weblate 側でメールアドレスの検証を強制してください。設定例:
参考
Pipeline
それぞれのバックエンドを有効にするのは非常に簡単です。
AUTHENTICATION_BACKENDS
の設定にエントリを追加し、場合によっては特定の認証方式に必要な秘密鍵を追加するだけです。バックエンドの中には、デフォルトではユーザーのメールアドレスを公開しないものがあり、リクエストで指定することが必要なことに注意してください。そうしなければ、Weblate は適切にユーザーの貢献を署名できません。参考
Python Social Auth backend
OpenID 認証¶
OpenID ベースのサービスでは、通常は認証を有効にするだけで使用できます。次のセクションは、OpenSUSE、Fedora、および Ubuntu で OpenID 認証を有効にする方法:
参考
OpenID
GitHub 認証¶
GitHub 上で OAuth アプリケーションの登録が必要です。Weblate にすべての秘密鍵を設定する方法:
GitHub のコールバック URL を
https://example.com/accounts/complete/github/
に設定することが必要です。注釈
認証中に Weblate 提供のコールバック URL には、設定したドメインが含まれています。URL の不一致でエラーが発生した場合の修正は、正確なサイトのドメイン設定 を確認してください。
参考
GitHub
Bitbucket 認証¶
アプリケーションを Bitbucket に登録することが必要です。Weblate にすべての秘密鍵を設定する方法:
注釈
認証中に Weblate 提供のコールバック URL には、設定したドメインが含まれています。URL の不一致でエラーが発生した場合の修正は、正確なサイトのドメイン設定 を確認してください。
参考
Bitbucket
Google OAuth 2¶
Google OAuth 2 を使用するには、<https://console.developers.google.com/> にアプリケーションを登録して、Google+API を有効にすることが必要です。
リダイレクト先の URL は、
https://WEBLATE SERVER/accounts/complete/google-oauth2/
注釈
認証中に Weblate 提供のコールバック URL には、設定したドメインが含まれています。URL の不一致でエラーが発生した場合の修正は、正確なサイトのドメイン設定 を確認してください。
参考
Google
Facebook OAuth 2¶
一般的な OAuth 2 サービスと同じように、Facebook にアプリケーションを登録することが必要です。そのあとに必要な、Webrate の設定方法:
リダイレクト先の URL は、
https://WEBLATE SERVER/accounts/complete/facebook/
注釈
認証中に Weblate 提供のコールバック URL には、設定したドメインが含まれています。URL の不一致でエラーが発生した場合の修正は、正確なサイトのドメイン設定 を確認してください。
参考
Facebook
GitLab OAuth 2¶
GitLab OAuth 2 を使用するには、<https://gitlab.com/profile/applications> にアプリケーションを登録することが必要です。
リダイレクト先の URL は
https://WEBLATE SERVER/accounts/complete/gitlab/
であり、スコープが read_user に設定されているかどうかを確認してください。注釈
認証中に Weblate 提供のコールバック URL には、設定したドメインが含まれています。URL の不一致でエラーが発生した場合の修正は、正確なサイトのドメイン設定 を確認してください。
参考
GitLab
Microsoft Azure Active Directory¶
Weblate は、認証に共通または特定のテナントを使用する設定にできます。
リダイレクト先の URL は、共通では
https://WEBLATE SERVER/accounts/complete/azuread-oauth2/
、テナント固有の認証ではhttps://WEBLATE SERVER/accounts/complete/azuread-tenant-oauth2/
です。注釈
認証中に Weblate 提供のコールバック URL には、設定したドメインが含まれています。URL の不一致でエラーが発生した場合の修正は、正確なサイトのドメイン設定 を確認してください。
参考
Microsoft Azure Active Directory
Slack¶
Slack OAuth 2 を使用するには、<https://api.slack.com/apps> にアプリケーションを登録することが必要です。
リダイレクト先の URL は、
https://WEBLATE SERVER/accounts/complete/slack/
注釈
認証中に Weblate 提供のコールバック URL には、設定したドメインが含まれています。URL の不一致でエラーが発生した場合の修正は、正確なサイトのドメイン設定 を確認してください。
参考
Slack
パスワード認証の無効化¶
メールとパスワード認証は、
AUTHENTICATION_BACKENDS
からsocial_core.backends.email.EmailAuth
を削除すると無効にできます。weblate.accounts.auth.WeblateUserBackend
の設定は維持してください。Weblate のコア機能に必要です。ちなみに
管理画面から手動で作成したユーザーは、まだパスワード認証をすることができます。
/admin/
で入力するだけです。openSUSE Open ID プロバイダのみを使用して認証する設定例: