Commit e8dde163 authored by Xavier Perseguers's avatar Xavier Perseguers
Browse files

[TASK] Synchronize with production

Change-Id: Ib081d24cece23001a5381de8fff609ceae23a314
Reviewed-on: https://review.typo3.org/29964
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
parent b6b0c8c4
#!/bin/bash
set -e
BASE_DIR=/var/www/vhosts/pootle.typo3.org/pootle/po
EXPORT_DIR=/var/www/vhosts/pootle.typo3.org/l10n_ter
STATE_DIR=/var/www/vhosts/pootle.typo3.org/home/scripts/.build-language-pack-state
POOTLE_CONFIG=/var/www/vhosts/pootle.typo3.org/pootle/localsettings.py
# -- no need to modify anything below
FORCE_EXTENSION=$1
EXT_PREFIX=TYPO3.TYPO3
EXTENSIONS=$(ls $BASE_DIR | grep $EXT_PREFIX | cut -b13-)
DATABASE_NAME=$(grep ^DATABASE_NAME $POOTLE_CONFIG | sed -r "s/.* = '([^']+)'.*/\1/")
DATABASE_USER=$(grep ^DATABASE_USER $POOTLE_CONFIG | sed -r "s/.* = '([^']+)'.*/\1/")
DATABASE_PASSWORD=$(grep ^DATABASE_PASSWORD $POOTLE_CONFIG | sed -r "s/.* = '([^']+)'.*/\1/")
DATABASE_HOST=$(grep ^DATABASE_HOST $POOTLE_CONFIG | sed -r "s/.* = '([^']+)'.*/\1/")
if [ ! -z "$FORCE_EXTENSION" ]; then
EXTENSIONS=$FORCE_EXTENSION
fi
. /var/www/vhosts/pootle.typo3.org/home/scripts/etc/pootle.conf
. /var/www/vhosts/pootle.typo3.org/home/scripts/etc/functions
_BUILD_PROJECT=$1
function build_language_pack() {
local _LANGUAGE_PROJECT_LANG=$1
if [ "$_LANGUAGE_PROJECT_LANG" = "" ]; then
echo
msg "You must provide a valid language"
echo
exit 1
fi
log_notice "Start building Language pack for extension \"$_PROJECT_NAME\" in language \"${_LANGUAGE_PROJECT_LANG}\""
# Get Language pack configuration
_LANGUAGE_PACK_NAME=${_PROJECT_NAME}-l10n-${_LANGUAGE_PROJECT_LANG}
_LANGUAGE_PACK_ARCHIVE=${_LANGUAGE_PACK_NAME}.zip
if [ "$_LANGUAGE_PROJECT_LANG" != "gl" ]; then
_STANDARD_LANGUAGE_KEY=$(cat $CONF_LANG_COMPAT | grep :${_LANGUAGE_PROJECT_LANG}$ | cut -d: -f1)
fi
if [ "$_STANDARD_LANGUAGE_KEY" = "" ]; then
_REAL_LANGUAGE_KEY=${_LANGUAGE_PROJECT_LANG}
else
_REAL_LANGUAGE_KEY=${_STANDARD_LANGUAGE_KEY}
fi
_LANGUAGE_PACK_PO=${POOTLE_PO}${_PROJECT_NAME}/${_REAL_LANGUAGE_KEY}
_LANGUAGE_PACK_TEMP=/tmp/l10n_ter/${_LANGUAGE_PACK_NAME}
echo
echo -e "\tUpdate $_LANGUAGE_PROJECT_PATH ($_LANGUAGE_PROJECT_LANG) ..."
# Prepare Language Pack
if [ "$_LANGUAGE_PACK_PO" = "" ] || [ ! -d "$_LANGUAGE_PACK_PO" ]; then
echo
msg "Unable to build language pack for a non existing project, XLIFF directory is missing"
msg "Missing directory: $_LANGUAGE_PACK_PO"
echo
exit 1
fi
# Usage: mysqlpipe "sql-query"
function mysqlpipe() {
echo $@ | mysql -u $DATABASE_USER -p"$DATABASE_PASSWORD" -h $DATABASE_HOST $DATABASE_NAME | sed '1d'
}
# Remove old temp directory
if [ "$_LANGUAGE_PACK_TEMP" != "" ] && [ -d $_LANGUAGE_PACK_TEMP ]; then
rm -Rf $_LANGUAGE_PACK_TEMP
# Usage: lastedit "project" "language"
function lastedit() {
local PROJECT="$1"
local LANGUAGE="$2"
# XP/19.06.2013: Using filesystem instead of database
#timestamp=$(mysqlpipe "SELECT p.id, p.code, l.code AS lang, u.mtime, UNIX_TIMESTAMP(u.mtime) AS tstamp
# FROM pootle_app_project AS p
# LEFT JOIN pootle_app_translationproject as tp ON p.id = tp.project_id
# LEFT JOIN pootle_store_store AS s ON tp.id = s.translation_project_id
# LEFT JOIN pootle_store_unit AS u ON s.id = u.store_id
# INNER JOIN pootle_app_language l ON l.id = tp.language_id
# WHERE ( u.state = 50 OR u.state = 200 )
# AND p.code = '$PROJECT'
# AND l.code = '$LANGUAGE'
# GROUP BY p.id, l.code;" \
#| awk '{ print $6 }')
LANGUAGE_DIR=$BASE_DIR/$PROJECT/$LANGUAGE
if [ -d $LANGUAGE_DIR ]; then
timestamp=$(find $LANGUAGE_DIR -type f -printf '%T@ %p\n' \
| grep -v "./.translation_index" \
| sort -n \
| tail -n 1 \
| cut -f1 -d.
)
fi
# Create new temp directory
mkdir -p $_LANGUAGE_PACK_TEMP
# Process XLIFF file
echo
echo -e "\t\tMove XLIFF file to the temporary language pack ..."
for _LANGUAGE_PACK_XLIFF in $(find $_LANGUAGE_PACK_PO -name \*.xlf); do
_LANGUAGE_PACK_XLIFF_TEMP=$(echo $_LANGUAGE_PACK_XLIFF | sed -e "s#${POOTLE_PO}##;s#${_PROJECT_NAME}/${_REAL_LANGUAGE_KEY}#${_PROJECT_NAME}#;s#/locallang#/${_LANGUAGE_PROJECT_LANG}.locallang#")
_XLIFF_FILE_SOURCE=$(echo $_LANGUAGE_PACK_XLIFF | sed -e "s#${POOTLE_PO}##")
_LANGUAGE_PACK_XLIFF_TEMP_DIRECTORY=${_LANGUAGE_PACK_TEMP}/$(echo $_LANGUAGE_PACK_XLIFF_TEMP | sed -e "s#$(basename $_LANGUAGE_PACK_XLIFF_TEMP)##")
mkdir -p $_LANGUAGE_PACK_XLIFF_TEMP_DIRECTORY
echo -e "\t\t$_XLIFF_FILE_SOURCE -> $_LANGUAGE_PACK_XLIFF_TEMP ($_LANGUAGE_PACK_XLIFF_TEMP_DIRECTORY)"
cp -f $_LANGUAGE_PACK_XLIFF ${_LANGUAGE_PACK_TEMP}/$_LANGUAGE_PACK_XLIFF_TEMP
# Convert XLIFF to LLXML
_SOURCE_XLIFF_FILE=$(echo $_LANGUAGE_PACK_XLIFF | sed -e "s#/${_REAL_LANGUAGE_KEY}/#/en/#")
_LLXML_FILE=${_LANGUAGE_PACK_TEMP}/$(echo $_LANGUAGE_PACK_XLIFF_TEMP | sed s/\.xlf$/\.xml/)
if [ -f $_SOURCE_XLIFF_FILE ]; then
rm -f $_LLXML_FILE
llxml2xliff $_PROJECT_NAME \
${_LANGUAGE_PROJECT_LANG} \
$_SOURCE_XLIFF_FILE \
$_LANGUAGE_PACK_XLIFF > $_LLXML_FILE
else
# Can't found XLIFF source file
exit 21
fi
done
# ZIP Language Pack
_CURRENT_DIRECTORY=$(pwd)
cd $_LANGUAGE_PACK_TEMP
if [ "$_LANGUAGE_PACK_ARCHIVE" != "" ] && [ -d $_PROJECT_NAME ]; then
zip -9 -r $_LANGUAGE_PACK_ARCHIVE $_PROJECT_NAME >/dev/null || exit 1
# Store the language pack in the TER directory
rm -f ${_LANGUAGE_PACK_PATH}/${_LANGUAGE_PACK_ARCHIVE}
mv $_LANGUAGE_PACK_ARCHIVE $_LANGUAGE_PACK_PATH || exit 1
# Removing temp language pack directory
# rm -Rf $_PROJECT_NAME
if [ -z "$timestamp" ]; then
echo 0
else
echo
msg "Empty variable, unable to create language pack archive"
echo "_LANGUAGE_PACK_ARCHIVE: $_LANGUAGE_PACK_ARCHIVE"
echo "_PROJECT_NAME: $_PROJECT_NAME"
echo
exit 1
echo $timestamp
fi
# Log
log_notice "Language pack for extension \"$_PROJECT_NAME\" in language \"${_LANGUAGE_PROJECT_LANG}\" build with success"
cd $_CURRENT_DIRECTORY
}
# Store start time
_LAST_BUILD_DATE=$(cat $_LAST_BUILD_FILE)
if [ "$_BUILD_PROJECT" != "" ]; then
_LAST_BUILD_DATE="1970-01-01"
fi
if [ "$_LAST_BUILD_DATE" = "" ]; then
echo
msg "No last build date, something wrong"
echo
exit 1
cd $(dirname $0)
if [ -z "$FORCE_EXTENSION" ]; then
# Sync whole stores, --project seems not totally reliable
echo "Synchronizing all stores ... "
./pootle-manage sync_stores 2>&1
fi
if [ "$_BUILD_PROJECT" = "" ]; then
rm -f $_LAST_BUILD_FILE
date +%Y-%m-%d > $_LAST_BUILD_FILE
fi
echo
echo "Build language pack for project updated since $_LAST_BUILD_DATE"
# Get updated project
_OLD_IFS=$IFS
IFS=$'\n'
for _PROJECT_ROW in $(getProjectUpdatedSince $_LAST_BUILD_DATE $_BUILD_PROJECT); do
_PROJECT_ID=$(echo $_PROJECT_ROW | cut -f1)
_PROJECT_NAME=$(echo $_PROJECT_ROW | cut -f2)
echo
echo "Building Language Pack \"${_PROJECT_NAME}\" (${_PROJECT_ID})"
# Sync filesystem
pootle-manage sync_stores --project=$_PROJECT_NAME >/dev/null 2>/dev/null || \
exit 1
# Create language pack directory
_LANGUAGE_PACK_PATH=${TER_L10N_PATH}${_PROJECT_NAME:0:1}/${_PROJECT_NAME:1:1}/${_PROJECT_NAME}-l10n
mkdir -p $_LANGUAGE_PACK_PATH
# Get updated language project
for _LANGUAGE_PROJECT_ROW in $(getLanguageProjectUpdatedSince $_PROJECT_ID $_LAST_BUILD_DATE); do
# Get Language project configuration
_LANGUAGE_PROJECT_PATH=$(echo $_LANGUAGE_PROJECT_ROW | cut -f1)
_LANGUAGE_PROJECT_LANG=$(echo $_LANGUAGE_PROJECT_ROW | cut -f6)
# Build main language pack
build_language_pack $_LANGUAGE_PROJECT_LANG
for EXT in $EXTENSIONS; do
EXTNAME=$(echo $EXT | sed -r 's/^[^.]+\.//')
echo "Packaging $EXTNAME"
if [ ! -z "$FORCE_EXTENSION" ]; then
echo -n " synchronizing store ... "
./pootle-manage sync_stores --project=$EXT_PREFIX.$EXT >/dev/null 2>&1
echo "done."
fi
echo -n " updating statistics ... "
./pootle-manage refresh_stats --project="$EXT_PREFIX.$EXT" >/dev/null 2>&1
echo "done."
pushd $BASE_DIR/$EXT_PREFIX.$EXT >/dev/null
rm -rf $EXPORT_DIR/_$EXTNAME
# Check if we have change the language key for the current language
_OLD_LANGUAGE_KEY=$(cat $CONF_LANG_COMPAT | grep ^${_LANGUAGE_PROJECT_LANG}: | cut -d: -f2)
if [ "$_OLD_LANGUAGE_KEY" != "" ] && [ "$_OLD_LANGUAGE_KEY" != "_LANGUAGE_PROJECT_LANG" ]; then
build_language_pack $_OLD_LANGUAGE_KEY
_LANGUAGE_PACK_PATH=${EXPORT_DIR}/${EXTNAME:0:1}/${EXTNAME:1:1}/${EXTNAME}-l10n
mkdir -p $_LANGUAGE_PACK_PATH
mkdir -p $STATE_DIR/$EXT_PREFIX.$EXT
LANGUAGES="$(ls | grep -v templates) ba br ch cz dk si se gr hk kr ua jp qc vn ge ga"
for LANG in $LANGUAGES; do
ORIG_LANG=$LANG
case "$LANG" in
'ba')
ORIG_LANG=bs ;;
'br')
ORIG_LANG=pt_BR ;;
'ch')
ORIG_LANG=zh_CN ;;
'cz')
ORIG_LANG=cs ;;
'dk')
ORIG_LANG=da ;;
'si')
ORIG_LANG=sl ;;
'se')
ORIG_LANG=sv ;;
'gr')
ORIG_LANG=el ;;
'hk')
ORIG_LANG=zh_HK ;;
'kr')
ORIG_LANG=ko ;;
'ua')
ORIG_LANG=uk ;;
'jp')
ORIG_LANG=ja ;;
'qc')
ORIG_LANG=fr_CA ;;
'vn')
ORIG_LANG=vi ;;
'ge')
ORIG_LANG=ka ;;
'ga')
ORIG_LANG=gl ;;
esac
echo -n " processing $LANG ... "
#/home/pootle/scripts/pootle-manage sync_stores --project="$EXT_PREFIX.$EXT" --language=$ORIG_LANG >/dev/null 2>&1
# Compute current state
STATUS_FILE=$STATE_DIR/$EXT_PREFIX.$EXT/$LANG.time
if [[ -f $STATUS_FILE && -z "$FORCE_EXTENSION" ]]; then
LAST_GENERATION=$(cat $STATE_DIR/$EXT_PREFIX.$EXT/$LANG.time)
else
LAST_GENERATION=0
fi
LAST_EDIT=$(lastedit "$EXT_PREFIX.$EXT" $ORIG_LANG)
if [[ $LAST_EDIT -gt 0 && $LAST_EDIT -ne $LAST_GENERATION ]]; then
mkdir -p $EXPORT_DIR/_$EXTNAME/$LANG/$EXTNAME
cp -r $ORIG_LANG/* $EXPORT_DIR/_$EXTNAME/$LANG/$EXTNAME
pushd $EXPORT_DIR/_$EXTNAME/$LANG/$EXTNAME >/dev/null
for XLF in $(find . -type f); do
DIR=$(dirname $XLF)
FILE=$(basename $XLF)
mv $XLF $DIR/$LANG.$FILE
# Convert XLIFF to LLXML
_SOURCE_XLIFF_FILE=$BASE_DIR/$EXT_PREFIX.$EXT/templates/$DIR/$FILE
LLXML=$DIR/$LANG.$(echo $FILE | sed s/\.xlf$/\.xml/)
llxml2xliff $EXTNAME \
$LANG \
$_SOURCE_XLIFF_FILE \
$DIR/$LANG.$FILE > $LLXML
done
find . -name \*.xlf -exec chmod 644 {} \;
find . -name \*.xml -exec chmod 644 {} \;
rm -f $_LANGUAGE_PACK_PATH/$EXTNAME-l10n-$LANG.zip
# ../ to include $EXTNAME directory
cd ../
zip -9 $_LANGUAGE_PACK_PATH/$EXTNAME-l10n-$LANG.zip -r . >/dev/null
popd >/dev/null
# Save current state
echo $LAST_EDIT > $STATUS_FILE
echo "done."
else
echo "skipped."
fi
done
# Write XML resume file (used by TER to know the updated language pack)
# Create language pack index
pushd $_LANGUAGE_PACK_PATH >/dev/null
_LANGUAGE_PACK_NAME=${EXTNAME}-l10n
_LANGUAGE_INDEX_FILE=${_LANGUAGE_PACK_NAME}.xml
rm -f $_LANGUAGE_INDEX_FILE
touch $_LANGUAGE_INDEX_FILE
echo -e "<?xml version=\"1.0\" standalone=\"yes\" ?>" >> $_LANGUAGE_INDEX_FILE
echo -e "<TERlanguagePackIndex>" >> $_LANGUAGE_INDEX_FILE
echo -e "\t<meta>" >> $_LANGUAGE_INDEX_FILE
echo -e "\t\t<timestamp>$(date +"%s")</timestamp>" >> $_LANGUAGE_INDEX_FILE
echo -e "\t\t<date>$(date +"%F %T")</date>" >> $_LANGUAGE_INDEX_FILE
echo -e "\t</meta>" >> $_LANGUAGE_INDEX_FILE
echo -e "\t<languagePackIndex>" >> $_LANGUAGE_INDEX_FILE
for p in $(find . -name \*.zip | sort);
do
_LANGUAGE_KEY=$(echo $p | sed -r "s/.*${_LANGUAGE_PACK_NAME}-(.*)\.zip\$/\1/")
echo -e "\t\t<languagepack language=\"$_LANGUAGE_KEY\">" >> $_LANGUAGE_INDEX_FILE
echo -e "\t\t\t<md5>$(md5sum $p | cut -d" " -f1)</md5>" >> $_LANGUAGE_INDEX_FILE
echo -e "\t\t</languagepack>" >> $_LANGUAGE_INDEX_FILE
done
done
echo -e "\t</languagePackIndex>" >> $_LANGUAGE_INDEX_FILE
echo -e "</TERlanguagePackIndex>" >> $_LANGUAGE_INDEX_FILE
# Restore IFS
IFS=$OLD_IFS
popd >/dev/null
exit 0
rm -rf $EXPORT_DIR/_$EXTNAME
popd >/dev/null
done
......@@ -5,9 +5,6 @@ set -e
. /var/www/vhosts/pootle.typo3.org/home/scripts/etc/pootle.conf
. /var/www/vhosts/pootle.typo3.org/home/scripts/etc/functions
pootle-stop > /dev/null && msg "stop done ..." || exit 1
sleep 2
pootle-start > /dev/null && msg "start done ..." || exit 1
exit 0
for PROJECT in $(list_all_typo3_project); do
pootle-check-project $PROJECT
done
File mode changed from 100644 to 100755
#!/bin/bash
set -e
. /var/www/vhosts/pootle.typo3.org/home/scripts/etc/pootle.conf
. /var/www/vhosts/pootle.typo3.org/home/scripts/etc/functions
PROJECT=$1
UPDATE_PROJECT=0
if [ "$PROJECT" == "" ]; then
echo "Missing project name"
exit 1
fi
echo
echo "Check project $PROJECT ..."
PROJECT_DIRECTORY="/var/www/vhosts/pootle.typo3.org/pootle/po/$PROJECT/"
if [ ! -d $PROJECT_DIRECTORY ]; then
echo "Project not found"
exit 1
fi
#
# Check missing template project
if [ ! -d $PROJECT_DIRECTORY/templates ]; then
echo "[WARNING] Missing templates ..."
# TODO Generate template based on english
else
echo "[INFO] Templates exist"
# TODO Check if new file exist in english or deleted file in english
fi
#
# Create missing language
check_available_languages $PROJECT
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
#!/bin/bash
POOTLE_CONFIG=/var/www/vhosts/pootle.typo3.org/pootle/localsettings.py
# -- no need to modify anything below
set -o errtrace
set -o nounset
# Trap non-normal exit signals: 1/HUP, 2/INT, 3/QUIT, 15/TERM, ERR
trap onexit 1 2 3 15
#--- onexit() -----------------------------------------------------
# @param $1 integer (optional) Exit status. If not set, use `$?'
function onexit() {
local exit_status=${1:-$?}
if [ $exit_status -gt 0 ]; then
echo Exiting $0 with $exit_status
fi
exit $exit_status
}
DATABASE_NAME=$(grep ^DATABASE_NAME $POOTLE_CONFIG | sed -r "s/.* = '([^']+)'.*/\1/")
DATABASE_USER=$(grep ^DATABASE_USER $POOTLE_CONFIG | sed -r "s/.* = '([^']+)'.*/\1/")
DATABASE_PASSWORD=$(grep ^DATABASE_PASSWORD $POOTLE_CONFIG | sed -r "s/.* = '([^']+)'.*/\1/")
DATABASE_HOST=$(grep ^DATABASE_HOST $POOTLE_CONFIG | sed -r "s/.* = '([^']+)'.*/\1/")
. /var/www/vhosts/pootle.typo3.org/home/scripts/etc/functions
# Usage: mysqlpipe "sql-query"
function mysqlpipe() {
echo $@ | mysql -u $DATABASE_USER -p"$DATABASE_PASSWORD" -h $DATABASE_HOST $DATABASE_NAME | sed '1d'
}
SAVEIFS=$IFS
ROWS=$(mysqlpipe "
SELECT l.fullname AS language, l.code AS language_code, l.directory_id AS language_directory_id,
p.fullname AS project, p.code AS project_code, p.directory_id AS project_directory_id,
COUNT(*) AS suggestions
FROM pootle_app_suggestion s
INNER JOIN pootle_app_translationproject tp ON tp.id=s.translation_project_id
INNER JOIN pootle_app_language l ON l.id=tp.language_id
INNER JOIN pootle_app_project p ON p.id=tp.project_id
INNER JOIN pootle_store_unit su ON su.id=s.unit
WHERE s.state='pending' AND p.id>2
GROUP BY s.translation_project_id
ORDER BY project, language
")
IFS=$(echo -en "\n\b")
for ROW in $ROWS;
do
LANGUAGE=$(echo $ROW | awk -F "\t" '{ print $1 }')
LANGUAGE_CODE=$(echo $ROW | awk -F "\t" '{ print $2 }')
LANGUAGE_DIR_ID=$(echo $ROW | awk -F "\t" '{ print $3 }')
PROJECT=$(echo $ROW | awk -F "\t" '{ print $4 }')
PROJECT_CODE=$(echo $ROW | awk -F "\t" '{ print $5 }')
PROJECT_DIR_ID=$(echo $ROW | awk -F "\t" '{ print $6 }')
SUGGESTIONS=$(echo $ROW | awk -F "\t" '{print $7 }')
echo "[INFO] Found suggestions for project $PROJECT ($PROJECT_CODE) in $LANGUAGE"
# Look for translators for current project (either project itself or corresponding language)
TRANSLATORS=$(mysqlpipe "
SELECT DISTINCT u.username, u.first_name, u.last_name, u.email
FROM pootle_app_permissionset_positive_permissions pspp
INNER JOIN pootle_app_permissionset ps ON ps.id=pspp.permissionset_id
INNER JOIN pootle_app_pootleprofile pp ON pp.id=ps.profile_id
INNER JOIN auth_user u ON u.id=pp.user_id
INNER JOIN pootle_app_directory d ON d.id=ps.directory_id
INNER JOIN auth_permission p ON p.id=pspp.permission_id
WHERE p.codename IN ('administrate', 'translate', 'review') AND u.is_active=1 AND u.email<>''
AND d.id IN ($PROJECT_DIR_ID, $LANGUAGE_DIR_ID)
ORDER BY last_name
")
#if [ -z "$TRANSLATORS" ]; then
# echo "[WARNING] No translators found, falling back to superusers"
# TRANSLATORS=$(mysqlpipe "
# SELECT username, first_name, last_name, email
# FROM auth_user
# WHERE is_active=1 AND is_superuser=1
# ")
#fi
for TRANSLATOR in $TRANSLATORS;
do
USERNAME=$(echo $TRANSLATOR | awk -F "\t" '{ print $1 }')
FIRST_NAME=$(echo $TRANSLATOR | awk -F "\t" '{ print $2 }')
LAST_NAME=$(echo $TRANSLATOR | awk -F "\t" '{ print $3 }')
EMAIL=$(echo $TRANSLATOR | awk -F "\t" '{ print $4 }')
echo "[INFO] - Notifying $USERNAME"
mail -a"From: TYPO3 Translation Server <no-reply@typo3.org>" \
-s "TYPO3 Pootle: $PROJECT ($LANGUAGE)" \
"$EMAIL" <<EOM
Dear $FIRST_NAME $LAST_NAME ($USERNAME),
There are currently $SUGGESTIONS suggestions pending for approval for project $PROJECT ($LANGUAGE),
please review them on:
http://translation.typo3.org/${LANGUAGE_CODE}/${PROJECT_CODE}/translate.html?matchnames=hassuggestion
Thanks for contributing to open-source software,
Pootle
PS: This is a weekly automated message that you received since you are registered as a
translator either for project "$PROJECT" or language "$LANGUAGE".
--
TYPO3 translation server (Pootle)
http://translation.typo3.org/
EOM
done
# wait a bit before handling next project/language pair
sleep 10
done
IFS=$SAVEIFS
onexit
File mode changed from 100644 to 100755
#!/bin/bash
SNAPSHOT_DIRECTORY="/var/www/vhosts/pootle.typo3.org/home/archives/snapshot"
DESTIONATION_DIRECTORY="$SNAPSHOT_DIRECTORY/$(date +%Y%m%d)"
mkdir -p $DESTIONATION_DIRECTORY
mysqldump -ac pootle | gzip > $DESTIONATION_DIRECTORY/pootle.sql.gz
tar cfpz $DESTIONATION_DIRECTORY/po.tar.gz /var/www/vhosts/pootle.typo3.org/pootle/po
#!/bin/bash
set -e
. /var/www/vhosts/pootle.typo3.org/home/scripts/etc/pootle.conf
. /var/www/vhosts/pootle.typo3.org/home/scripts/etc/functions
pootle-manage runfcgi \
socket=$POOTLE_FCGI_SOCK \
pidfile=$POOTLE_PID \
method=threaded \
minspare=2 \
maxspare=12 \
umask=007 \
outlog=$POOTLE_LOG \
errlog=$POOTLE_ERR && \
msg "service started with success" || \
msg "unable to start service"
#!/bin/bash
set -e
. /var/www/vhosts/pootle.typo3.org/home/scripts/etc/pootle.conf
. /var/www/vhosts/pootle.typo3.org/home/scripts/etc/functions
if [ -f $POOTLE_PID ]; then
kill $(cat $POOTLE_PID)
rm $POOTLE_PID
sleep 2
echo
msg "service stopped"
echo
exit 0
else
echo
msg "FCGI daemon is not running ..."
echo
exit 1
fi
#!/bin/bash
set -o errtrace
set -o nounset
# Trap non-normal exit signals: 1/HUP, 2/INT, 3/QUIT, 15/TERM, ERR
trap onexit 1 2 3 15
#--- onexit() -----------------------------------------------------
# @param $1 integer (optional) Exit status. If not set, use `$?'
function onexit() {
local exit_status=${1:-$?}
if [ $exit_status -gt 0 ]; then
echo Exiting $0 with $exit_status
fi
exit $exit_status
}
BASE_DIRECTORY="/var/www/vhosts/pootle.typo3.org/pootle/po"