From db00502c880bfc182ce23d04f046ab74257d8d62 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Thu, 21 Jan 2016 13:00:17 +0900 Subject: [PATCH] magnum-ui use generic django translation processing New generic django translation functions can be used with magnum-ui. magnum-ui specific functions are no longer required. Also add a note on django_openstack_auth. Change-Id: I71a1bc78612adefa5f81b89d9fe7e0a1517e08d5 --- jenkins/scripts/common_translation_update.sh | 11 -------- jenkins/scripts/propose_translation_update.sh | 28 +++++-------------- .../scripts/upstream_translation_update.sh | 12 ++++---- 3 files changed, 14 insertions(+), 37 deletions(-) diff --git a/jenkins/scripts/common_translation_update.sh b/jenkins/scripts/common_translation_update.sh index c0c873caa1..fe3001c56e 100644 --- a/jenkins/scripts/common_translation_update.sh +++ b/jenkins/scripts/common_translation_update.sh @@ -339,17 +339,6 @@ function setup_django_openstack_auth { '{locale_with_underscore}/LC_MESSAGES/django.po' -f zanata.xml } -# Setup project magnum-ui for Zanata -function setup_magnum_ui { - local project=magnum-ui - local version=${1:-master} - - /usr/local/jenkins/slave_scripts/create-zanata-xml.py \ - -p $project -v $version --srcdir magnum_ui/locale \ - --txdir magnum_ui/locale -r '**/*.pot' \ - '{locale_with_underscore}/LC_MESSAGES/{filename}.po' -f zanata.xml -} - # Filter out files that we do not want to commit function filter_commits { # Don't add new empty files. diff --git a/jenkins/scripts/propose_translation_update.sh b/jenkins/scripts/propose_translation_update.sh index 1ade1276d7..5a5cb94388 100755 --- a/jenkins/scripts/propose_translation_update.sh +++ b/jenkins/scripts/propose_translation_update.sh @@ -132,22 +132,6 @@ function propose_django_openstack_auth { git add openstack_auth/locale/* } -function propose_magnum_ui { - - # Pull updated translations from Zanata. - pull_from_zanata "$PROJECT" - - # Invoke run_tests.sh to update the po files - # Or else, "../manage.py makemessages" can be used. - ./run_tests.sh --makemessages -V - - # Compress downloaded po files - compress_po_files "magnum_ui" - - # Add all changed files to git - git add magnum_ui/locale/* -} - # This function can be used for all django projects function propose_django { local project=$1 @@ -182,19 +166,21 @@ case "$PROJECT" in propose_training_guides ;; django_openstack_auth) + # NOTE: Once POT file and Zanata resource name are renamed + # from openstack_auth(.pot) to django(.pot), the below can be used. + # setup_django django_openstack_auth openstack_auth "$ZANATA_VERSION" setup_django_openstack_auth "$ZANATA_VERSION" + # NOTE: Once django_openstack_auth repo has babel-django.cfg, + # the below can be used. + # propose_django django_openstack_auth openstack_auth propose_django_openstack_auth ;; horizon) setup_horizon "$ZANATA_VERSION" propose_horizon ;; - magnum-ui) - setup_magnum_ui "$ZANATA_VERSION" - propose_magnum_ui - ;; # Test of translation setup improvement - murano-dashboard) + murano-dashboard|magnum-ui) # TODO(amotoki): Honor module name in propose_* # MODULENAME=$(get_modulename $PROJECT python) # if [ -n "$MODULENAME" ]; then diff --git a/jenkins/scripts/upstream_translation_update.sh b/jenkins/scripts/upstream_translation_update.sh index dbe2c0b9a4..ab3abbb422 100755 --- a/jenkins/scripts/upstream_translation_update.sh +++ b/jenkins/scripts/upstream_translation_update.sh @@ -41,19 +41,21 @@ case "$PROJECT" in setup_training_guides "$ZANATA_VERSION" ;; django_openstack_auth) + # NOTE: Once POT file and Zanata resource name are renamed + # from openstack_auth(.pot) to django(.pot), the below can be used. + # setup_django django_openstack_auth openstack_auth "$ZANATA_VERSION" setup_django_openstack_auth "$ZANATA_VERSION" + # NOTE: Once django_openstack_auth repo has babel-django.cfg, + # the below can be used. + # extract_messages_django openstack_auth extract_messages openstack_auth ;; horizon) setup_horizon "$ZANATA_VERSION" ./run_tests.sh --makemessages -V ;; - magnum-ui) - setup_magnum_ui "$ZANATA_VERSION" - ./run_tests.sh --makemessages -V - ;; # Test of translation setup improvement - murano-dashboard) + murano-dashboard|magnum-ui) # TODO(amotoki): Honor module name in extract_* # MODULENAME=$(get_modulename $PROJECT python) # if [ -n "$MODULENAME" ]; then