[ English | Indonesia | 中文 (简体, 中国) | English (United Kingdom) | 한국어 (대한민국) | Deutsch | русский | 日本語 ]

翻訳の豆知識

このページでは、翻訳に関する豆知識をまとめています。

何か豆知識があれば、是非追加してください。

ストリングはソースコードのどこで使われているの?

It is important to understand how an original string is used in the source code with contextual knowledge for better quality of translations. Unfortunately Zanata translation interface does not show where a target string is used in a source code correspondingly.

You can find the location in a source code by checking the POT file.

POT ファイルは http://tarballs.openstack.org/translation-source/<Zanata-project-name>/<Zanata-project-version>/<path>/<resource>.pot にあります。

  • <Zanata-project-name> : Zanata のプロジェクト名

  • <Zanata-project-version> : Zanata のプロジェクトバージョン (masterstable-mitaka などど)

  • <path> : ドキュメントのパス (nova/locale, openstack_dashboard/locale, releasenotes/source/locale など)

  • <resource> : Zanata でのドキュメント名

一番簡単な方法は、 http://tarballs.openstack.org/translation-source を開いて <Zanata-project-name>, <Zanata-version> のように順に対応するリンクを辿る方法でしょう。

POT ファイルを見つけたら、そのファイルを開いて、探したい文字列を検索します。以下のようなエントリーが見つかることでしょう。

#: trove_dashboard/content/database_backups/views.py:100
#, python-format
msgid "Unable to retrieve details for parent backup: %s"
msgstr ""

Once you find location(s) of a string you would like to check, you can check more detail context where the string is used by looking at the code in the git repository. Zanata project and git repository are one-to-one relationship. If Zanata project name is <Zanata-project-name>, the corresponding git repository location is https://opendev.org/openstack/<Zanata-project-name>/. For example, if you are translating horizon, the git repository is found at https://opendev.org/openstack/horizon/.

注釈

POT ファイルは現在は git リポジトリーには格納されていません。この変更は Newton 開発サイクル [1] の最初に行われました。

ストリングは Dashboard UI のどこで使われているの?

ダッシュボード関連のプロジェクトの翻訳を行っている場合、「このストリングはダッシュボードのどこで使われているのか?」を知りたい場合があるでしょう。

ストリングが使用されている場所をソースコードの場所から推測できます (ソースコードの場所の探し方については上のエントリーを見てください)。

dashboards/admin/aggregates/views.py:104

この場合は、左側のメニューの「管理」グループの「アグリゲート」メニューで使われています。 Horizon のコードでは、2 階層目が「プロジェクト」や「管理」といったダッシュボードのグループに対応しており、3 階層目が「アグリゲート」 (今回の例) 、「インスタンス」、「ネットワーク」などのパネルに対応しています。

dashboards/project/loadbalancers/workflows.py:44

ファイル名が workflows.pyforms.py の場合、作成や編集のフォームで使われています。

dashboards/project/containers/templates/containers/_update.html:21

テンプレートは静的な HTML ファイルの雛形です。この例の場合、このストリングはおそらく「コンテナー」メニューの「更新」フォームで使われていることでしょう。