From efb334fced5e4ece5a3e5e5a5b2e1a0328c5b604 Mon Sep 17 00:00:00 2001 From: shu-mutou Date: Fri, 20 May 2016 18:35:07 +0900 Subject: [PATCH] Fix translation setup We do not store pot files anymore in git. Fix run_tests.sh that expects that these are in git. To restore normal content, just remove the generated files. Also, fix babel configurations. Change-Id: I23680de0cf88d0a2fd957888bb2edae296dcf33d --- babel-django.cfg | 4 ++-- babel-djangojs.cfg | 4 ++-- run_tests.sh | 8 +++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/babel-django.cfg b/babel-django.cfg index 4697f2a..ad09d34 100644 --- a/babel-django.cfg +++ b/babel-django.cfg @@ -1,5 +1,5 @@ [extractors] django = django_babel.extract:extract_django -[python: zaqar_ui/**.py] -[django: zaqar_ui/**/templates/**.html] +[python: **.py] +[django: templates/**.html] diff --git a/babel-djangojs.cfg b/babel-djangojs.cfg index 40f859b..a8273b6 100644 --- a/babel-djangojs.cfg +++ b/babel-djangojs.cfg @@ -5,10 +5,10 @@ # details on how this works. angular = horizon.utils.babel_extract_angular:extract_angular -[javascript: zaqar_ui/**.js] +[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: zaqar_ui/**/static/**.html] +[angular: **/static/**.html] diff --git a/run_tests.sh b/run_tests.sh index 1342187..8960c2d 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -415,12 +415,13 @@ function babel_extract { KEYWORDS+=" -k ugettext_noop -k ugettext_lazy -k ungettext_lazy:1,2" KEYWORDS+=" -k npgettext:1c,2,3 -k pgettext_lazy:1c,2 -k npgettext_lazy:1c,2,3" - ${command_wrapper} pybabel extract -F babel-${DOMAIN}.cfg -o zaqar_ui/locale/${DOMAIN}.pot $KEYWORDS . + mkdir -p locale + ${command_wrapper} pybabel extract -F ../babel-${DOMAIN}.cfg -o locale/${DOMAIN}.pot $KEYWORDS . } function run_makemessages { - echo -n "zaqar ui: " + cd zaqar_ui babel_extract django ZAQAR_PY_RESULT=$? @@ -428,8 +429,9 @@ function run_makemessages { babel_extract djangojs ZAQAR_JS_RESULT=$? + cd ../ if [ $check_only -eq 1 ]; then - git checkout -- zaqar_ui/locale/django*.pot + rm -f zaqar_ui/locale/django*.pot fi exit $(($ZAQAR_PY_RESULT || $ZAQAR_JS_RESULT))