From 12018a6749e9c67ff7056c5275b26119fe59ca51 Mon Sep 17 00:00:00 2001 From: Sergey Gotliv Date: Wed, 11 May 2016 13:36:42 +0300 Subject: [PATCH] Enable translation for manila-ui This patch follows instructions described here [1] to setup translations for manila-ui. [1] http://docs.openstack.org/infra/manual/creators.html#django-projects Change-Id: Iafcb4e86e86a6d10b56cad79ead543366ea8129e --- babel-django.cfg | 6 ++++++ babel-djangojs.cfg | 14 ++++++++++++++ setup.cfg | 14 -------------- 3 files changed, 20 insertions(+), 14 deletions(-) create mode 100644 babel-django.cfg create mode 100644 babel-djangojs.cfg diff --git a/babel-django.cfg b/babel-django.cfg new file mode 100644 index 00000000..862e0107 --- /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] \ No newline at end of file diff --git a/babel-djangojs.cfg b/babel-djangojs.cfg new file mode 100644 index 00000000..814c0e35 --- /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] \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 2f83873d..885c0406 100644 --- a/setup.cfg +++ b/setup.cfg @@ -29,17 +29,3 @@ all_files = 1 [upload_sphinx] upload-dir = doc/build/html - -[compile_catalog] -directory = manila_ui/locale -domain = manila-ui - -[update_catalog] -domain = manila-ui -output_dir = manila_ui/locale -input_file = manila_ui/locale/manila-ui.pot - -[extract_messages] -keywords = _ gettext ngettext l_ lazy_gettext -mapping_file = babel.cfg -output_file = manila_ui/locale/manila-ui.pot