diff --git a/babel-django.cfg b/babel-django.cfg new file mode 100644 index 0000000..e78d6c0 --- /dev/null +++ b/babel-django.cfg @@ -0,0 +1,5 @@ +[extractors] +django = django_babel.extract:extract_django + +[python: **.py] +[django: **/templates/**.html] diff --git a/babel-djangojs.cfg b/babel-djangojs.cfg new file mode 100644 index 0000000..a8273b6 --- /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 +# /openstack_dashboard/dashboards/XYZ/static which will ensure +# that plugins are also translated. +[angular: **/static/**.html] diff --git a/requirements.txt b/requirements.txt index ba701ae..f2f94d4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,3 +14,7 @@ python-solumclient>=1.2.7 # Apache-2.0 pytz>=2013.6 # MIT oslo.utils>=3.16.0 # Apache-2.0 + +# message extraction +Babel>=2.3.4 # BSD +django-babel>=0.5.1 # BSD diff --git a/solumdashboard/locale/django.pot b/solumdashboard/locale/django.pot new file mode 100644 index 0000000..8c0732f --- /dev/null +++ b/solumdashboard/locale/django.pot @@ -0,0 +1,219 @@ +# Translations template for PROJECT. +# Copyright (C) 2016 ORGANIZATION +# This file is distributed under the same license as the PROJECT project. +# FIRST AUTHOR , 2016. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PROJECT VERSION\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2016-07-30 07:13+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.3.4\n" + +#: solumdashboard/dashboard.py:22 +#: solumdashboard/templates/applications/index.html:3 +#: solumdashboard/templates/assemblies/index.html:3 +msgid "Solum" +msgstr "" + +#: solumdashboard/applications/panel.py:24 +#: solumdashboard/applications/tables.py:52 +#: solumdashboard/applications/tables.py:81 +msgid "Applications" +msgstr "" + +#: solumdashboard/applications/tables.py:26 +msgid "New Application" +msgstr "" + +#: solumdashboard/applications/tables.py:33 +msgid "Build and Deploy Application" +msgstr "" + +#: solumdashboard/applications/tables.py:46 +msgid "Delete Application" +msgstr "" + +#: solumdashboard/applications/tables.py:49 +#: solumdashboard/assemblies/tables.py:35 +msgid "Delete" +msgstr "" + +#: solumdashboard/applications/tables.py:50 +#: solumdashboard/assemblies/tables.py:36 +msgid "Deleted" +msgstr "" + +#: solumdashboard/applications/tables.py:51 +#: solumdashboard/assemblies/tables.py:59 +#: solumdashboard/templates/applications/_detail.html:2 +#: solumdashboard/templates/assemblies/_detail.html:2 +msgid "Application" +msgstr "" + +#: solumdashboard/applications/tables.py:64 +#: solumdashboard/assemblies/tables.py:50 +msgid "View" +msgstr "" + +#: solumdashboard/applications/tables.py:70 +#: solumdashboard/assemblies/tables.py:56 +msgid "UUID" +msgstr "" + +#: solumdashboard/applications/tables.py:72 +#: solumdashboard/assemblies/tables.py:58 +#: solumdashboard/templates/applications/_detail.html:5 +#: solumdashboard/templates/assemblies/_detail.html:5 +msgid "Name" +msgstr "" + +#: solumdashboard/applications/tables.py:74 +#: solumdashboard/applications/workflows/create.py:34 +#: solumdashboard/applications/workflows/launch.py:26 +#: solumdashboard/assemblies/tables.py:61 +#: solumdashboard/templates/applications/_detail.html:9 +#: solumdashboard/templates/assemblies/_detail.html:9 +msgid "Description" +msgstr "" + +#: solumdashboard/applications/tabs.py:23 solumdashboard/assemblies/tabs.py:23 +msgid "General Info" +msgstr "" + +#: solumdashboard/applications/workflows/create.py:30 +#: solumdashboard/templates/applications/_detail.html:20 +msgid "Git URL" +msgstr "" + +#: solumdashboard/applications/workflows/create.py:32 +msgid "App Name" +msgstr "" + +#: solumdashboard/applications/workflows/create.py:40 +msgid "Select git url for the application" +msgstr "" + +#: solumdashboard/applications/workflows/create.py:51 +msgid "Create Application" +msgstr "" + +#: solumdashboard/applications/workflows/create.py:52 +msgid "Create" +msgstr "" + +#: solumdashboard/applications/workflows/create.py:53 +msgid "Created" +msgstr "" + +#: solumdashboard/applications/workflows/create.py:54 +msgid "Could not create" +msgstr "" + +#: solumdashboard/applications/workflows/launch.py:24 +msgid "Assembly Name" +msgstr "" + +#: solumdashboard/applications/workflows/launch.py:44 +msgid "Configure name and description" +msgstr "" + +#: solumdashboard/applications/workflows/launch.py:55 +msgid "Launch App" +msgstr "" + +#: solumdashboard/applications/workflows/launch.py:56 +msgid "Launch" +msgstr "" + +#: solumdashboard/applications/workflows/launch.py:57 +msgid "App launched" +msgstr "" + +#: solumdashboard/applications/workflows/launch.py:58 +msgid "Could not launch app" +msgstr "" + +#: solumdashboard/assemblies/panel.py:24 solumdashboard/assemblies/tables.py:38 +#: solumdashboard/assemblies/tables.py:68 +msgid "Assemblies" +msgstr "" + +#: solumdashboard/assemblies/tables.py:25 +msgid "New Assembly" +msgstr "" + +#: solumdashboard/assemblies/tables.py:32 +msgid "Delete Assembly" +msgstr "" + +#: solumdashboard/assemblies/tables.py:37 +msgid "Assembly" +msgstr "" + +#: solumdashboard/templates/applications/_detail.html:7 +#: solumdashboard/templates/assemblies/_detail.html:7 +msgid "ID" +msgstr "" + +#: solumdashboard/templates/applications/_detail.html:15 +msgid "Artifact" +msgstr "" + +#: solumdashboard/templates/applications/_detail.html:17 +msgid "Type" +msgstr "" + +#: solumdashboard/templates/applications/_detail.html:23 +msgid "Language Pack" +msgstr "" + +#: solumdashboard/templates/applications/detail.html:3 +#: solumdashboard/templates/applications/detail.html:6 +msgid "Application Details" +msgstr "" + +#: solumdashboard/templates/applications/index.html:6 +msgid "Solum - Applications" +msgstr "" + +#: solumdashboard/templates/applications/launch.html:3 +msgid "Launch Application" +msgstr "" + +#: solumdashboard/templates/applications/launch.html:6 +msgid "Solum - Launch Application" +msgstr "" + +#: solumdashboard/templates/assemblies/_detail.html:11 +msgid "Status" +msgstr "" + +#: solumdashboard/templates/assemblies/_detail.html:13 +msgid "URI" +msgstr "" + +#: solumdashboard/templates/assemblies/_detail.html:15 +msgid "Trigger URI" +msgstr "" + +#: solumdashboard/templates/assemblies/detail.html:3 +#: solumdashboard/templates/assemblies/detail.html:6 +msgid "Assembly Details" +msgstr "" + +#: solumdashboard/templates/assemblies/index.html:6 +msgid "Solum - Assemblies" +msgstr "" + +#: solumdashboard/tests/settings.py:67 +msgid "Password must be between 8 and 18 characters." +msgstr "" + diff --git a/solumdashboard/locale/djangojs.pot b/solumdashboard/locale/djangojs.pot new file mode 100644 index 0000000..fbbbd64 --- /dev/null +++ b/solumdashboard/locale/djangojs.pot @@ -0,0 +1,19 @@ +# Translations template for PROJECT. +# Copyright (C) 2016 ORGANIZATION +# This file is distributed under the same license as the PROJECT project. +# FIRST AUTHOR , 2016. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PROJECT VERSION\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2016-07-30 07:13+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.3.4\n" + diff --git a/tox.ini b/tox.ini index fbd89ff..8b7e3b4 100644 --- a/tox.ini +++ b/tox.ini @@ -18,6 +18,11 @@ commands = python setup.py testr --slowest --testr-args="--concurrency 1 {posarg [testenv:cover] commands = python setup.py testr --coverage --testr-args='--concurrency 1 {posargs}' +[testenv:makemessages] +commands = + pybabel extract -F babel-django.cfg -o solumdashboard/locale/django.pot -k gettext_noop -k gettext_lazy -k ngettext_lazy:1,2 -k ugettext_noop -k ugettext_lazy -k ungettext_lazy:1,2 -k npgettext:1c,2,3 -k pgettext_lazy:1c,2 -k npgettext_lazy:1c,2,3 solumdashboard + pybabel extract -F babel-djangojs.cfg -o solumdashboard/locale/djangojs.pot -k gettext_noop -k gettext_lazy -k ngettext_lazy:1,2 -k ugettext_noop -k ugettext_lazy -k ungettext_lazy:1,2 -k npgettext:1c,2,3 -k pgettext_lazy:1c,2 -k npgettext_lazy:1c,2,3 solumdashboard + [testenv:pep8] commands = flake8