2014-04-22 15:16:18 -07:00
|
|
|
#!/bin/bash -xe
|
|
|
|
|
|
|
|
# Copyright 2013 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 pull the translations from Transifex,
|
|
|
|
# and push to Gerrit.
|
|
|
|
|
|
|
|
PROJECT=$1
|
|
|
|
|
2014-05-24 20:23:05 +02:00
|
|
|
source /usr/local/jenkins/slave_scripts/common_translation_update.sh
|
2014-04-22 15:16:18 -07:00
|
|
|
|
2014-06-01 09:18:53 +02:00
|
|
|
init_manuals "$PROJECT"
|
|
|
|
|
2014-05-24 20:23:05 +02:00
|
|
|
setup_git
|
2014-07-10 16:52:45 +00:00
|
|
|
setup_review
|
2014-05-24 20:23:05 +02:00
|
|
|
setup_translation
|
2014-04-22 15:16:18 -07:00
|
|
|
|
2014-07-08 08:45:02 +02:00
|
|
|
setup_manuals "$PROJECT"
|
2014-04-22 15:16:18 -07:00
|
|
|
|
2014-10-15 10:43:10 +02:00
|
|
|
# Download new files.
|
|
|
|
# Also downloads updates for existing files that are
|
|
|
|
# translated to a certain amount as configured in setup_manuals.
|
|
|
|
# The function setup_manuals will setup most files --minimum-perc=75
|
|
|
|
# for most files.
|
2014-07-08 08:45:02 +02:00
|
|
|
tx pull -a -f
|
2014-04-22 15:16:18 -07:00
|
|
|
|
2014-10-15 10:43:10 +02:00
|
|
|
# Pull upstream translations of all downloaded files but do not
|
|
|
|
# download new files.
|
|
|
|
# Use lower percentage here to update the existing files.
|
|
|
|
tx pull -f --minimum-perc=50
|
|
|
|
|
2014-06-01 09:18:53 +02:00
|
|
|
# Add imported upstream translations to git
|
2014-09-29 13:28:19 -07:00
|
|
|
for FILE in ${DocFolder}/*; do
|
2014-04-22 15:16:18 -07:00
|
|
|
DOCNAME=${FILE#${DocFolder}/}
|
2014-09-29 13:28:19 -07:00
|
|
|
if [ -d ${DocFolder}/${DOCNAME}/locale ] ; then
|
2014-04-22 15:16:18 -07:00
|
|
|
git add ${DocFolder}/${DOCNAME}/locale/*
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2014-05-28 12:33:01 +02:00
|
|
|
filter_commits
|
2014-04-22 15:16:18 -07:00
|
|
|
|
2014-05-24 20:23:05 +02:00
|
|
|
send_patch
|