Add translation support

Setting up translation support as specified here:

http://docs.openstack.org/infra/manual/creators.html#enabling-translation-infrastructure

Change-Id: I8eba01c24d4503f41ede4005c044144a9930e1cf
Closes-Bug: #1611479
This commit is contained in:
Travis Tripp 2016-08-09 12:30:32 -06:00
parent 68b9558e0a
commit dfc0410adc
4 changed files with 21 additions and 18 deletions

6
babel-django.cfg Normal file
View File

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

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

View File

@ -1,2 +0,0 @@
[python: **.py]

View File

@ -16,8 +16,7 @@ classifier =
Programming Language :: Python :: 2.7
[files]
packages =
searchlight_ui
packages = searchlight_ui
[build_sphinx]
source-dir = doc/source
@ -26,17 +25,3 @@ all_files = 1
[upload_sphinx]
upload-dir = doc/build/html
[compile_catalog]
directory = searchlight_ui/locale
domain = searchlight-ui
[update_catalog]
domain = searchlight-ui
output_dir = searchlight_ui/locale
input_file = searchlight_ui/locale/searchlight-ui.pot
[extract_messages]
keywords = _ gettext ngettext l_ lazy_gettext
mapping_file = babel.cfg
output_file = searchlight_ui/locale/searchlight-ui.pot