From b88e1508feeef9207e49393e3e45194605a5e9a1 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Tue, 20 Sep 2016 03:18:28 +0900 Subject: [PATCH] Translation preparation for neutron-lbaas-dashboard LBaaS v2 is now the only LBaaS implementation. It is time to allow translator to translate LBaaS v2 dashboard. This commit sets up related files according to the infra guide [1]. Also removes Babel related entries in setup.cfg. They are not sufficient as Django requires two PO files (django and djangojs). After this change is merged, I will propose the infra change. This change can be part of newton release. If it is part of Newton release of neutron-lbaas-dashboard, translators can translate it even after the initial Newton release and we can import them in the stable update release. [1] http://docs.openstack.org/infra/manual/creators.html#enabling-translation-infrastructure Change-Id: If3cf48dfe9c61499b2a4221dea956aa0bccf5f85 --- babel-django.cfg | 6 ++++++ babel-djangojs.cfg | 14 ++++++++++++++ babel.cfg | 2 -- setup.cfg | 14 -------------- 4 files changed, 20 insertions(+), 16 deletions(-) create mode 100644 babel-django.cfg create mode 100644 babel-djangojs.cfg delete mode 100644 babel.cfg diff --git a/babel-django.cfg b/babel-django.cfg new file mode 100644 index 00000000..e7ee76ae --- /dev/null +++ b/babel-django.cfg @@ -0,0 +1,6 @@ +[extractors] +django = django_babel.extract:extract_django + +[python: **.py] +[django: templates/**.html] +[django: **/templates/**.csv] diff --git a/babel-djangojs.cfg b/babel-djangojs.cfg new file mode 100644 index 00000000..050d1756 --- /dev/null +++ b/babel-djangojs.cfg @@ -0,0 +1,14 @@ +[extractors] +# We use a custom extractor to find translatable strings in AngularJS +# templates. The extractor is included in horizon.utils for now. +# See http://babel.pocoo.org/docs/messages/#referencing-extraction-methods for +# details on how this works. +angular = horizon.utils.babel_extract_angular:extract_angular + +[javascript: **.js] + +# We need to look into all static folders for HTML files. +# The **/static ensures that we also search within +# .../dashboards/XYZ/static which will ensure +# that plugins are also translated. +[angular: **/static/**.html] diff --git a/babel.cfg b/babel.cfg deleted file mode 100644 index 15cd6cb7..00000000 --- a/babel.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[python: **.py] - diff --git a/setup.cfg b/setup.cfg index 53aae848..3adcc848 100644 --- a/setup.cfg +++ b/setup.cfg @@ -27,17 +27,3 @@ all_files = 1 [upload_sphinx] upload-dir = doc/build/html - -[compile_catalog] -directory = neutron_lbaas_dashboard/locale -domain = neutron-lbaas-dashboard - -[update_catalog] -domain = neutron-lbaas-dashboard -output_dir = neutron_lbaas_dashboard/locale -input_file = neutron_lbaas_dashboard/locale/neutron-lbaas-dashboard.pot - -[extract_messages] -keywords = _ gettext ngettext l_ lazy_gettext -mapping_file = babel.cfg -output_file = neutron_lbaas_dashboard/locale/neutron-lbaas-dashboard.pot