Setup for translations

Add babel*.cfg files for translation.

This follows the setup for django projects for translation, for details
see
http://specs.openstack.org/openstack-infra/infra-specs/specs/translation_setup.html

babel related entries in setup.cfg does not work for multiple
POT/PO files, so we can remove them.

Change-Id: I1fac32fc76c1469e88417ca0d26bdd199995a402
This commit is contained in:
Andreas Jaeger 2015-12-22 08:58:04 +01:00 committed by Akihiro Motoki
parent f94afa4653
commit e97d0d1b2f
3 changed files with 19 additions and 14 deletions

5
babel-django.cfg Normal file
View File

@ -0,0 +1,5 @@
[extractors]
django = django_babel.extract:extract_django
[python: **.py]
[django: **/templates/**.html]

14
babel-djangojs.cfg Normal file
View File

@ -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
# /openstack_dashboard/dashboards/XYZ/static which will ensure
# that plugins are also translated.
[angular: **/static/**.html]

View File

@ -30,17 +30,3 @@ all_files = 1
[upload_sphinx]
upload-dir = doc/build/html
[compile_catalog]
directory = trove_dashboard/locale
domain = trove-dashboard
[update_catalog]
domain = trove-dashboard
output_dir = trove_dashboard/locale
input_file = trove_dashboard/locale/trove_dashboard.pot
[extract_messages]
keywords = _ gettext ngettext l_ lazy_gettext
mapping_file = babel.cfg
output_file = trove_dashboard/locale/trove_dashboard.pot