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

翻訳の確認方法

It is important to validate your translations by applying them in a real situation where they are rendered and visualized. This page describes how to check your translations.

注釈

translation check refers to build OpenStack artifacts with translated strings and check how the translated strings are shown on an actual screen as part of the translation process.

ドキュメント

Translated documents are available at the OpenStack Documentation site. It is updated daily. Most contents are linked from:

The documents are maintained in the doc directory using reStructuredText and built by Sphinx. Translated strings are stored as Gettext PO file format in locale/<lang>/LC_MESSAGES directory.

Documents on openstack-manuals

For OpenStack documentation, openstack-manuals git repository hosts essential OpenStack documents such as Installation Guide, and Virtual Machine Image Guide.

To build a translated document on this repository, you need to update the file doc-tools-check-languages.conf in each repository, and add an entry to BOOKS like ["ja"]="install-guide".

stable ブランチのドキュメントの場合 (例えば Liberty 版のインストールガイドなど)、対応する stable ブランチの doc-tools-check-languages.conf ファイルを直接更新する必要があります。

You can check a generated document for a specified branch on https://docs.openstack.org/<branch>/<language>/<document>. For example, the link of Japanese Ubuntu Installation Guide for Liberty is https://docs.openstack.org/liberty/ja/install-guide-ubuntu/.

生成されたドキュメントへのリンクを一覧に追加するには、 openstack-manuals レポジトリーの master ブランチの www/<lang>/index.html ファイルを更新します。ウェブページは master ブランチから生成されており、 master ブランチで Liberty なども含めた全リリースのページが管理されています。したがって、 stable ブランチの www/<lang>/index.html ファイルを更新する必要はありません。

You can also check:

OpenStack project documentation

Currently, we support translations for small set of OpenStack project documentations like Horizon, OpenStack-Ansible, and OpenStack-Helm upon requests and available bandwidth. Top-level directory structure on doc/source/ follows with Documentation Contributor Guide - Project guide setup and the corresponding generated documents for master branch are available at https://docs.openstack.org/<project>/latest/<language>/<document> URL. For project team documents in stable branch, you can check the documents with https://docs.openstack.org/<project>/<branch>/<language>/<document> URL.

Here are sample document links as examples:

OpenStack Dashboard

OpenStack-Ansible を実行する方法

OpenStack-Ansible (OSA) は、 OpenStack 環境のデプロイや設定を行う Ansible プレイブックやロールを提供しています。このプロジェクトの中で「翻訳確認サイト」という機能が開発されました。 OSA インスタンスは、 translation platform から翻訳ストリングを取得し、コンパイルを行ってから、 Horizon で参照できるようにします。 OSA を実行するには、 2 個か 4 個の CPU コア、少なくとも 8GB のメモリーと 70 GB のディスクを持ったマシンが必要です。

$ BRANCH=master
$ git clone -b ${BRANCH} https://github.com/openstack/openstack-ansible /opt/openstack-ansible
$ cd /opt/openstack-ansible
$ ./scripts/gate-check-commit.sh translations

tests/vars/bootstrap-aio-vars.yml で AIO でインストールするコンポーネントを設定できます。自身の環境に依存しますが、インストールには 1〜2 時間かかります。 AIO の設定の詳しい情報については OSA AIO ドキュメント を参照してください。

定期的に翻訳されたファイルを取得するには、以下のコマンドを手動か cron で実行します。

$ cd /opt/openstack-ansible/playbooks; \
  openstack-ansible os-horizon-install.yml \
  -e horizon_translations_update=True \
  -e horizon_translations_project_version=master \
  --tags "horizon-config"

DevStack を実行する方法

別のお手軽な方法は、自分の手元の環境で DevStack を実行して翻訳を確認する方法です。 DevStack を実行するには、 local.conf を準備する必要がありますが、心配しないでください。 local.conf ファイルの例がいくつもインターネット上で共有されていますし、最も簡単な例は以下にあります。これまでの経験上、 DevStack を快適に実行するのに必要なマシンスペックは、 CPU コアが 2 か 4、メモリーが 8GB、 ディスクが 20 GB です。 OpenStack の主要プロジェクトだけを動かしたい場合は、マシンに必要なメモリーは 2〜4 GB ともっと少なくなります。

$ BRANCH=master
$ git clone https://opendev.org/openstack/devstack.git
$ cd devstack
$ git checkout $BRANCH
<prepare local.conf>
$ ./stack.sh
<wait and wait... it takes 20 or 30 minutes>

$BRANCH は適切なブランチに置き換えてください。 master, stable/newton, stable/mitaka など。

以下の例は、 Newton リリースで、コアコンポーネント (keystone, nova, glance, neutron, cinder) と horizon, swift, heat を動かすための local.conf です。 horizon のコードが対応しているコンポーネントが選択されています。

[[local|localrc]]
BRANCH=stable/newton
# NOTE: We need to specify a branch explicitly until DevStack stable branch
# is prepared. At now, swift has no stable/newton branch.
CINDER_BRANCH=$BRANCH
GLANCE_BRANCH=$BRANCH
HEAT_BRANCH=$BRANCH
HORIZON_BRANCH=$BRANCH
KEYSTONE_BRANCH=$BRANCH
NEUTRON_BRANCH=$BRANCH
NOVA_BRANCH=$BRANCH
SWIFT_BRANCH=master

# When OS_CLOUD envvar is set, DevStack will be confused.
unset OS_CLOUD

# Ensure to fetch the latest repository when rerunning DevStack
RECLONE=True

# Translation check site usually does not use tempest.
disable_service tempest

enable_service heat h-api h-api-cfn h-api-cw h-eng
enable_service s-proxy s-object s-container s-account

enable_plugin neutron https://git.openstack.org/openstack/neutron $BRANCH
enable_service q-qos

enable_plugin neutron-vpnaas https://git.openstack.org/openstack/neutron-vpnaas $BRANCH

LOGFILE=$DEST/logs/devstack.log
SCREEN_HARDSTATUS="%{= rw} %H %{= wk} %L=%-w%{= bw}%30L> %n%f %t*%{= wk}%+Lw%-17< %-=%{= gk} %y/%m    /%d %c"
LOGDAYS=2
IDENTITY_API_VERSION=3

ADMIN_PASSWORD=change_me
MYSQL_PASSWORD=change_me
RABBIT_PASSWORD=change_me
SERVICE_PASSWORD=change_me

最新の翻訳の入手方法

翻訳はそれぞれのプロジェクトのリポジトリーに毎日取り込まれます。したがって、ほとんどの場合、自分で Zanata から翻訳を取得する必要はありません。必要なことは、最新の Horizon コードを取得することだけです。

DevStack を実行している場合、以下の 2 つの方法があります。

1 つ目の方法は horizon ノードのみを更新する方法です。以下のシェルスクリプトは、最新の horizon のコードを取得し、翻訳メッセージカタログをコンパイルし、 apache httpd サーバーをリロードします。 $BRANCH は適切なブランチ (master, stable/newton, stable/mitaka など) に置き換えてください。

#!/bin/bash

# Target branch: master, stable/pike, ...
BRANCH=stable/pike

cd /opt/stack/horizon

# Remove stale compiled python files
find horizon -name '*.pyc' | xargs rm
find openstack_dashboard -name '*.pyc' | xargs rm

# Fetch the latest code from git
git checkout $BRANCH
git remote update origin
git merge origin/$BRANCH

python manage.py compilemessages
python manage.py collectstatic --noinput
python manage.py compress --force
sudo service apache2 reload

もう 1 つの方法は、 DevStack の再実行です。 stack.sh を実行する前に local.confRECLONE=True を追加してください。こうすることで、 DevStack は horizon や他のプロジェクトの最新のコードを取得するようになります。

$ cd devstack
$ ./unstack.sh
<Ensure RECLONE=True in your local.conf>
$ ./stack.sh
<It takes 10 or 15 minutes>

CLI (コマンドラインインターフェース)

TBD

サーバープロジェクト

TBD