From c740986599c0185067697656d9aedcd73c496e81 Mon Sep 17 00:00:00 2001 From: He Jie Xu Date: Thu, 24 Jan 2013 00:07:18 +0800 Subject: [PATCH] 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 --- .gitignore | 1 + MANIFEST.in | 1 + babel.cfg | 2 ++ quantum/locale/quantum.pot | 0 setup.cfg | 15 +++++++++++++++ tools/test-requires | 1 + 6 files changed, 20 insertions(+) create mode 100644 babel.cfg create mode 100644 quantum/locale/quantum.pot diff --git a/.gitignore b/.gitignore index 049ad99b12a..e8c4c0c0ec7 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 d9cbbdaaafa..4c1862f3b28 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 00000000000..15cd6cb76b9 --- /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 00000000000..e69de29bb2d diff --git a/setup.cfg b/setup.cfg index 28bb40fcccf..565cba388c8 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 88e2046573a..4cef1be281d 100644 --- a/tools/test-requires +++ b/tools/test-requires @@ -1,3 +1,4 @@ +Babel>=0.9.6 cliff coverage distribute>=0.6.24