From: He Jie Xu Date: Wed, 23 Jan 2013 16:07:18 +0000 (+0800) Subject: Use babel to generate translation file X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=c740986599c0185067697656d9aedcd73c496e81;p=openstack-build%2Fneutron-build.git Use babel to generate translation file Fixes bug 1103519 Following http://wiki.openstack.org/Translations to integrate transifex translation into quantum We added the empty file quantum/locale/quantum.pot to avoid the failure of the Jenkin's translation-jobs because git doesn't allow empty directory to be added into the repository. After this patch accepted, we need to do as below: 1. Make the transifex quantum project (https://www.transifex.com/projects/p/quantum/) as part of the openstack transifex project hub and give access to the transifex openstack Jenkins account. 2. Add the translation-jobs into openstack/openstack-ci-puppet for ceilometer. Change-Id: I329a8bdc51ed8a0e75399c592d3991b1ec06a855 --- diff --git a/.gitignore b/.gitignore index 049ad99b1..e8c4c0c0e 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ run_tests.log setuptools*.egg/ .tox/ .venv/ +*.mo diff --git a/MANIFEST.in b/MANIFEST.in index d9cbbdaaa..4c1862f3b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -5,6 +5,7 @@ include quantum/db/migration/README include quantum/db/migration/alembic.ini include quantum/db/migration/alembic/script.py.mako include quantum/db/migration/alembic/versions/README +recursive-include quantum/locale * exclude .gitignore exclude .gitreview diff --git a/babel.cfg b/babel.cfg new file mode 100644 index 000000000..15cd6cb76 --- /dev/null +++ b/babel.cfg @@ -0,0 +1,2 @@ +[python: **.py] + diff --git a/quantum/locale/quantum.pot b/quantum/locale/quantum.pot new file mode 100644 index 000000000..e69de29bb diff --git a/setup.cfg b/setup.cfg index 28bb40fcc..565cba388 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,3 +14,18 @@ cover-package = quantum cover-html = true cover-erase = true where=quantum/tests/unit + +[extract_messages] +keywords = _ gettext ngettext l_ lazy_gettext +mapping_file = babel.cfg +output_file = quantum/locale/quantum.pot + +[compile_catalog] +directory = quantum/locale +domain = quantum + +[update_catalog] +domain = quantum +output_dir = quantum/locale +input_file = quantum/locale/quantum.pot + diff --git a/tools/test-requires b/tools/test-requires index 88e204657..4cef1be28 100644 --- a/tools/test-requires +++ b/tools/test-requires @@ -1,3 +1,4 @@ +Babel>=0.9.6 cliff coverage distribute>=0.6.24