翻訳プロジェクト

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:

../_images/user-billing.png

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:

../_images/user-add-project.png

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

../_images/user-add-project-done.png

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:

../_images/user-add-component-init.png

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

../_images/user-add-component-discovery.png

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

../_images/user-add-component.png

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).

共有翻訳メモリを使用する

Whether to use shared translation memory, see 共有翻訳メモリ for more details.

デフォルト値は DEFAULT_SHARED_TM により決定します。

共有翻訳メモリに貢献する

Whether to contribute to shared translation memory, see 共有翻訳メモリ for more details.

デフォルト値は DEFAULT_SHARED_TM により決定します。

アクセス制御

Configure per project access control, see プロジェクトのアクセス制御 for more details.

Default value can be changed by DEFAULT_ACCESS_CONTROL.

査読の有効化

Enable review workflow for translations, see 専任の査読者.

原文の査読の有効化

Enable review workflow for source strings, see 原文の査読.

フックの有効化

Whether unauthenticated 通知フック are to be used for this repository.

言語の別名

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 to use, see バージョン管理の統合 for details.

ソースコードのリポジトリ

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.

提案への投票

Turns on vote casting for suggestions, see 提案への投票.

提案の自動採用

Automatically accept voted suggestions, see 提案への投票.

翻訳フラグ

品質検査やその他の 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.

言語コード スタイル

Weblate が自動生成する翻訳のファイル名の言語コードをカスタマイズします。

マージ スタイル

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_MESSAGEDEFAULT_ADDON_MESSAGEDEFAULT_COMMIT_MESSAGEDEFAULT_DELETE_MESSAGEDEFAULT_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

^(cs|de|es)$

Exclude languages

^(?!(it|fr)$).+$

Filter two letter codes only

^..$

Exclude non language files

^(?!(blank)$).+$

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 に基づいているので、非常に強力です。

現在使用している場所:

コンポーネントのテンプレートで使用できる変数:

{{ 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 を確認してください。特に確認が必要なもの:

リソース制限の確認

大量の翻訳やリポジトリをインポートする場合は、サーバーのリソース制限の影響を受けます。

  • メモリの空き容量を確認します。オペレーティング システムに翻訳ファイルをキャッシュさせると、パフォーマンスが大幅に向上します。

  • 処理する文字列が多数ある場合、ディスク操作がボトルネックになることがあります—ディスクは Weblate とデータベースの両方から書き込まれます。

  • CPU コアを追加すると、バックグラウンド タスクのパフォーマンスが向上することがあります(参照: Celery を使用するバックグラウンド タスク )。

不要な検査の無効

一部の品質検査は非常にコストがかかる場合があり、不要な場合は省略するとインポート中の時間を短縮できます。 設定の詳細については CHECK_LIST を確認してください。

コンポーネントの自動生成

プロジェクトに多くの翻訳ファイル(例: 異なる gettext ドメインまたは Android アプリの一部)がある場合は、それらを自動的に読み込みたくなります。これは、コマンド行から import_project または import_json を使用するか、コンポーネントの検出 アドオンをインストールすることで実行できます。

アドオンを使用するには、まず 1 つの翻訳ファイル(将来的に名前変更または削除する可能性が最も低いものを選択)用のコンポーネントを作成し、このコンポーネントにアドオンをインストールすることが必要です。

管理コマンドの場合は、すべてのコンポーネントを含むプロジェクトを作成してから、import_project または import_json の実行が必要です。