Initial setup for i18n support

Change-Id: Ifc912b31fe2f71d5267827321b8de0420ad62903
Partial-Bug: #1269930
This commit is contained in:
Tetiana Lashchova 2014-11-28 19:05:53 +02:00
parent 38e5fed6e7
commit 802ed10fde
6 changed files with 27 additions and 1 deletions

View File

@ -1,4 +1,5 @@
include AUTHORS include AUTHORS
include babel.cfg
include LICENSE include LICENSE
include README.rst include README.rst
include ChangeLog include ChangeLog
@ -6,3 +7,4 @@ include tox.ini
include .testr.conf include .testr.conf
recursive-include doc * recursive-include doc *
recursive-include tools * recursive-include tools *
recursive-include python-heatclient *.po *.pot

1
babel.cfg Normal file
View File

@ -0,0 +1 @@
[python: **.py]

View File

@ -2,10 +2,12 @@
# of appearance. Changing the order has an impact on the overall integration # of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
Babel>=1.3
pbr>=0.6,!=0.7,<1.0 pbr>=0.6,!=0.7,<1.0
argparse argparse
iso8601>=0.1.9 iso8601>=0.1.9
PrettyTable>=0.7,<0.8 PrettyTable>=0.7,<0.8
oslo.i18n>=1.0.0 # Apache-2.0
oslo.serialization>=1.0.0 # Apache-2.0 oslo.serialization>=1.0.0 # Apache-2.0
oslo.utils>=1.0.0 # Apache-2.0 oslo.utils>=1.0.0 # Apache-2.0
python-keystoneclient>=0.11.1 python-keystoneclient>=0.11.1

View File

@ -41,3 +41,17 @@ upload-dir = doc/build/html
[wheel] [wheel]
universal = 1 universal = 1
[extract_messages]
keywords = _ gettext ngettext l_ lazy_gettext
mapping_file = babel.cfg
output_file = python-heatclient/locale/python-heatclient.pot
[compile_catalog]
directory = python-heatclient/locale
domain = python-heatclient
[update_catalog]
domain = python-heatclient
output_dir = python-heatclient/locale
input_file = python-heatclient/locale/python-heatclient.pot

View File

@ -12,7 +12,11 @@ deps = -r{toxinidir}/requirements.txt
commands = python setup.py testr --slowest --testr-args='{posargs}' commands = python setup.py testr --slowest --testr-args='{posargs}'
[testenv:pep8] [testenv:pep8]
commands = flake8 commands =
flake8
# Check that .po and .pot files are valid:
bash -c "find python-heatclient -type f -regex '.*\.pot?' -print0|xargs -0 -n 1 msgfmt --check-format -o /dev/null"
whitelist_externals = bash
[testenv:venv] [testenv:venv]
commands = {posargs} commands = {posargs}
@ -31,3 +35,6 @@ downloadcache = ~/cache/pip
show-source = True show-source = True
exclude=.venv,.git,.tox,dist,*openstack/common*,*lib/python*,*egg,build exclude=.venv,.git,.tox,dist,*openstack/common*,*lib/python*,*egg,build
max-complexity=20 max-complexity=20
[hacking]
import_exceptions = heatclient.openstack.common._i18n