diff --git a/MANIFEST.in b/MANIFEST.in index 3af1445f..0d1fc6cf 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,5 @@ include AUTHORS +include babel.cfg include LICENSE include README.rst include ChangeLog @@ -6,3 +7,4 @@ include tox.ini include .testr.conf recursive-include doc * recursive-include tools * +recursive-include python-heatclient *.po *.pot diff --git a/babel.cfg b/babel.cfg new file mode 100644 index 00000000..efceab81 --- /dev/null +++ b/babel.cfg @@ -0,0 +1 @@ +[python: **.py] diff --git a/python-heatclient/locale/python-heatclient.pot b/python-heatclient/locale/python-heatclient.pot new file mode 100644 index 00000000..e69de29b diff --git a/requirements.txt b/requirements.txt index 60936c73..6ecf12b3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,10 +2,12 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. +Babel>=1.3 pbr>=0.6,!=0.7,<1.0 argparse iso8601>=0.1.9 PrettyTable>=0.7,<0.8 +oslo.i18n>=1.0.0 # Apache-2.0 oslo.serialization>=1.0.0 # Apache-2.0 oslo.utils>=1.0.0 # Apache-2.0 python-keystoneclient>=0.11.1 diff --git a/setup.cfg b/setup.cfg index cae92c45..3b001fea 100644 --- a/setup.cfg +++ b/setup.cfg @@ -41,3 +41,17 @@ upload-dir = doc/build/html [wheel] 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 diff --git a/tox.ini b/tox.ini index 202ff458..c0999ceb 100644 --- a/tox.ini +++ b/tox.ini @@ -12,7 +12,11 @@ deps = -r{toxinidir}/requirements.txt commands = python setup.py testr --slowest --testr-args='{posargs}' [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] commands = {posargs} @@ -31,3 +35,6 @@ downloadcache = ~/cache/pip show-source = True exclude=.venv,.git,.tox,dist,*openstack/common*,*lib/python*,*egg,build max-complexity=20 + +[hacking] +import_exceptions = heatclient.openstack.common._i18n \ No newline at end of file