Merge "Fix django_openstack_auth translation setup"

This commit is contained in:
Jenkins 2014-07-11 19:52:10 +00:00 committed by Gerrit Code Review
commit 8d3e6c8f45
9 changed files with 150 additions and 36 deletions

View File

@ -691,7 +691,6 @@
- python-jobs
- openstack-publish-jobs
- pypi-jobs
- translation-jobs
- project:

View File

@ -29,6 +29,37 @@
node: 'proposal'
- job:
name: 'django_openstack_auth-upstream-translation-update'
builders:
- revoke-sudo
- gerrit-git-prep
- shell: |
#!/bin/bash -xe
/usr/local/jenkins/slave_scripts/upstream_translation_django_openstack_auth.sh
publishers:
- console-log
node: 'proposal'
- job:
name: 'django_openstack_auth-propose-translation-update'
builders:
- revoke-sudo
- branch-git-prep:
branch: master
- shell: |
#!/bin/bash -xe
/usr/local/jenkins/slave_scripts/propose_translation_update_django_openstack_auth.sh
publishers:
- console-log
node: 'proposal'
- job:
name: 'horizon-upstream-translation-update'

View File

@ -250,3 +250,32 @@ function extract_messages_log ()
--output-file ${project}/locale/${project}-log-${level}.pot
done
}
# Setup project django_openstack_auth for transifex
function setup_django_openstack_auth ()
{
tx set --auto-local -r horizon.djangopo \
"openstack_auth/locale/<lang>/LC_MESSAGES/django.po" \
--source-lang en \
--source-file openstack_auth/locale/openstack_auth.pot -t PO \
--execute
}
# Filter out files that we do not want to commit
function filter_commits ()
{
# Don't send files where the only things which have changed are
# the creation date, the version number, the revision date,
# comment lines, or diff file information.
for f in `git diff --cached --name-only`
do
changed=$(git diff --cached "$f" \
| egrep -v "(POT-Creation-Date|Project-Id-Version|PO-Revision-Date)" \
| egrep -c "^([-+][^-+#])")
if [ $changed -eq 0 ]
then
git reset -q "$f"
git checkout -- "$f"
fi
done
}

View File

@ -59,16 +59,6 @@ done
# Add all changed files to git
git add $PROJECT/locale/*
# Don't send files where the only things which have changed are the
# creation date, the version number, the revision date, or comment
# lines.
for f in `git diff --cached --name-only`
do
if [ `git diff --cached $f |egrep -v "(POT-Creation-Date|Project-Id-Version|PO-Revision-Date|^\+{3}|^\-{3}|^[-+]#)" | egrep -c "^[\-\+]"` -eq 0 ]
then
git reset -q $f
git checkout -- $f
fi
done
filter_commits
send_patch

View File

@ -0,0 +1,45 @@
#!/bin/bash -xe
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
ORG=openstack
PROJECT=django_openstack_auth
COMMIT_MSG="Imported Translations from Transifex"
source /usr/local/jenkins/slave_scripts/common_translation_update.sh
setup_git
setup_review "$ORG" "$PROJECT"
setup_django_openstack_auth
# Pull upstream translations of files that are at least 75 %
# translated
tx pull -a -f --minimum-perc=75
# Update the .pot file
python setup.py extract_messages
PO_FILES=`find openstack_auth/locale -name '*.po'`
if [ -n "$PO_FILES" ]
then
# Use updated .pot file to update translations
python setup.py update_catalog --no-fuzzy-matching --ignore-obsolete=true
fi
# Add all changed files to git
git add openstack_auth/locale/*
filter_commits
send_patch

View File

@ -34,16 +34,6 @@ tx pull -a -f --minimum-perc=75
# Add all changed files to git
git add horizon/locale/* openstack_dashboard/locale/*
# Don't send files where the only things which have changed are the
# creation date, the version number, the revision date, or comment
# lines.
for f in `git diff --cached --name-only`
do
if [ `git diff --cached $f |egrep -v "(POT-Creation-Date|Project-Id-Version|PO-Revision-Date|^\+{3}|^\-{3}|^[-+]#)" | egrep -c "^[\-\+]"` -eq 0 ]
then
git reset -q $f
git checkout -- $f
fi
done
filter_commits
send_patch

View File

@ -43,16 +43,6 @@ do
fi
done
# Don't send files where the only things which have changed are the
# creation date, the version number, the revision date, or comment
# lines.
for f in `git diff --cached --name-only`
do
if [ `git diff --cached $f |egrep -v "(POT-Creation-Date|Project-Id-Version|PO-Revision-Date|^\+{3}|^\-{3}|^[-+]#)" | egrep -c "^[\-\+]"` -eq 0 ]
then
git reset -q $f
git checkout -- $f
fi
done
filter_commits
send_patch

View File

@ -0,0 +1,41 @@
#!/bin/bash -xe
# Copyright 2014 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# The script is to push the updated English po to Transifex.
if [ ! `echo $ZUUL_REFNAME | grep master` ]
then
exit 0
fi
source /usr/local/jenkins/slave_scripts/common_translation_update.sh
setup_git
setup_translation
setup_django_openstack_auth
# Update the .pot file
python setup.py extract_messages
# Add all changed files to git
git add openstack_auth/locale/*
if [ ! `git diff-index --quiet HEAD --` ]
then
# Push .pot changes to transifex
tx --debug --traceback push -s
fi

View File

@ -1651,8 +1651,7 @@ projects:
- name: check-requirements
- name: integrated-gate
- name: stable-compat-jobs
post:
- django_openstack_auth-upstream-translation-update
- name: translation-jobs
pre-release:
- django_openstack_auth-tarball
release: