diff --git a/jenkins/scripts/common_translation_update.sh b/jenkins/scripts/common_translation_update.sh index 9138a26bfb..c6ac2f724f 100644 --- a/jenkins/scripts/common_translation_update.sh +++ b/jenkins/scripts/common_translation_update.sh @@ -61,21 +61,28 @@ function setup_horizon { tx set --auto-local -r ${project}.${project}-js-translations \ "${project}/locale//LC_MESSAGES/djangojs.po" \ --source-lang en \ - --source-file ${project}/locale/en/LC_MESSAGES/djangojs.po \ + --source-file ${project}/locale/djangojs.pot \ -t PO --execute # Horizon Translations tx set --auto-local -r ${project}.${project}-translations \ "${project}/locale//LC_MESSAGES/django.po" \ --source-lang en \ - --source-file ${project}/locale/en/LC_MESSAGES/django.po \ + --source-file ${project}/locale/django.pot \ -t PO --execute # OpenStack Dashboard Translations tx set --auto-local -r ${project}.openstack-dashboard-translations \ "openstack_dashboard/locale//LC_MESSAGES/django.po" \ --source-lang en \ - --source-file openstack_dashboard/locale/en/LC_MESSAGES/django.po \ + --source-file openstack_dashboard/locale/django.pot \ + -t PO --execute + + # OpenStack Dashboard JavaScript Translations + tx set --auto-local -r ${project}.openstack-dashboard-js-translations \ + "openstack_dashboard/locale//LC_MESSAGES/djangojs.po" \ + --source-lang en \ + --source-file openstack_dashboard/locale/djangojs.pot \ -t PO --execute } @@ -430,22 +437,3 @@ function compress_manual_po_files { mv "${i}.tmp" "$i" done } - -# Reduce size of po files. This reduces the amount of content imported -# and makes for fewer imports. -# Some projects have no pot files (see function compress_po_files) but -# use the English po file as source. For these projects we should not -# touch the English po file. This way we can reconstruct the po files -# using "msgmerge EnglishPOTFILE POFILE -o COMPLETEPOFILE". -function compress_non_en_po_files { - local directory=$1 - - for i in $(find $directory -name *.po); do - if [[ $i =~ "/locale/en/LC_MESSAGES/" ]] ; then - continue - fi - msgattrib --translated --no-location --sort-output "$i" \ - --output="${i}.tmp" - mv "${i}.tmp" "$i" - done -} diff --git a/jenkins/scripts/propose_translation_update_horizon.sh b/jenkins/scripts/propose_translation_update_horizon.sh index 0384bd16cc..4bac98784b 100755 --- a/jenkins/scripts/propose_translation_update_horizon.sh +++ b/jenkins/scripts/propose_translation_update_horizon.sh @@ -34,8 +34,8 @@ tx pull -f ./run_tests.sh --makemessages -V # Compress downloaded po files -compress_non_en_po_files "horizon" -compress_non_en_po_files "openstack_dashboard" +compress_po_files "horizon" +compress_po_files "openstack_dashboard" # Add all changed files to git git add horizon/locale/* openstack_dashboard/locale/* diff --git a/jenkins/scripts/upstream_translation_horizon.sh b/jenkins/scripts/upstream_translation_horizon.sh index 2aae3949de..66a119682a 100755 --- a/jenkins/scripts/upstream_translation_horizon.sh +++ b/jenkins/scripts/upstream_translation_horizon.sh @@ -34,8 +34,8 @@ setup_horizon ./run_tests.sh --makemessages -V # Add all changed files to git -git add ${PROJECT}/locale/en/LC_MESSAGES/* -git add openstack_dashboard/locale/en/LC_MESSAGES/* +git add ${PROJECT}/locale/*pot +git add openstack_dashboard/locale/*pot if [ $(git diff --cached | egrep -v "(POT-Creation-Date|^[\+\-]#|^\+{3}|^\-{3})" | egrep -c "^[\-\+]") -gt 0 ]; then # Push source file changes to transifex