From 2533a8dd390681fd9e22b2ca9b03a6760743e3d2 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Mon, 25 Jan 2016 20:40:40 +0100 Subject: [PATCH] Translation setup Setup translation for this repo as django project following the common setup as documented in http://specs.openstack.org/openstack-infra/infra-specs/specs/translation_setup.html This adds the django babel files and removes the default one which will not work with django. Fixed package name, all python files are in ironic_ui, so package name needs to be ironic_ui, not ironic-ui. Change-Id: I8482a1896f16b4ed19a1117c7afc583bba5e13fb --- babel-django.cfg | 5 +++++ babel-djangojs.cfg | 14 ++++++++++++++ babel.cfg | 2 -- setup.cfg | 16 +--------------- 4 files changed, 20 insertions(+), 17 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..ab7d37bf --- /dev/null +++ b/babel-django.cfg @@ -0,0 +1,5 @@ +[extractors] +django = django_babel.extract:extract_django + +[python: ironic_ui/**.py] +[django: ironic_ui/**/templates/**.html] diff --git a/babel-djangojs.cfg b/babel-djangojs.cfg new file mode 100644 index 00000000..8234f0f8 --- /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: ironic_ui/**.js] + +# We need to look into all static folders for HTML files. +# The **/static ensures that we also search within +# /openstack_dashboard/dashboards/XYZ/static which will ensure +# that plugins are also translated. +[angular: ironic_ui/**/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 d17fcbe9..beb4457e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,7 +21,7 @@ classifier = [files] packages = - ironic-ui + ironic_ui [build_sphinx] source-dir = doc/source @@ -30,17 +30,3 @@ all_files = 1 [upload_sphinx] upload-dir = doc/build/html - -[compile_catalog] -directory = ironic-ui/locale -domain = ironic-ui - -[update_catalog] -domain = ironic-ui -output_dir = ironic-ui/locale -input_file = ironic-ui/locale/ironic-ui.pot - -[extract_messages] -keywords = _ gettext ngettext l_ lazy_gettext -mapping_file = babel.cfg -output_file = ironic-ui/locale/ironic-ui.pot