]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Use babel to generate translation file
authorHe Jie Xu <xuhj@linux.vnet.ibm.com>
Wed, 23 Jan 2013 16:07:18 +0000 (00:07 +0800)
committerHe Jie Xu <xuhj@linux.vnet.ibm.com>
Wed, 23 Jan 2013 16:20:32 +0000 (00:20 +0800)
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
MANIFEST.in
babel.cfg [new file with mode: 0644]
quantum/locale/quantum.pot [new file with mode: 0644]
setup.cfg
tools/test-requires

index 049ad99b12a7ce050efb7e38e012ab1c5e5b6679..e8c4c0c0ec780c759892c371a73a5b8f217315d2 100644 (file)
@@ -15,3 +15,4 @@ run_tests.log
 setuptools*.egg/
 .tox/
 .venv/
+*.mo
index d9cbbdaaafac9acc8b0ebce8709bd07a47fffe4d..4c1862f3b28ba8ca36110ea703a5d38af09fa877 100644 (file)
@@ -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 (file)
index 0000000..15cd6cb
--- /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 (file)
index 0000000..e69de29
index 28bb40fcccffdbf658b51bc37f43b20632345c54..565cba388c896d82ae85d342405b82511379a4e3 100644 (file)
--- 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
+
index 88e2046573a2a4afb4cbf384377ff1bebaa6c6b8..4cef1be281df4c9079f17b9fd2ce062ee3c97679 100644 (file)
@@ -1,3 +1,4 @@
+Babel>=0.9.6
 cliff
 coverage
 distribute>=0.6.24