2020-06-06 15:35:50 +02:00
|
|
|
#!/bin/bash
|
2013-05-27 10:32:47 +02:00
|
|
|
#------------------------------------------------------
|
|
|
|
|
# Script to push language files to Transifex
|
|
|
|
|
#
|
2015-07-03 13:48:54 +02:00
|
|
|
# Laurent Destailleur (eldy) - eldy@users.sourceforge.net
|
2013-05-27 10:32:47 +02:00
|
|
|
#------------------------------------------------------
|
2015-07-03 13:48:54 +02:00
|
|
|
# Usage: txpush.sh (source|xx_XX) [-r dolibarr.file] [-f]
|
2013-05-27 10:32:47 +02:00
|
|
|
#------------------------------------------------------
|
|
|
|
|
|
2015-12-18 18:25:09 +01:00
|
|
|
export project='dolibarr'
|
|
|
|
|
|
2019-12-05 18:30:26 +01:00
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
|
|
|
|
cd $DIR/../..
|
|
|
|
|
|
2013-05-27 10:32:47 +02:00
|
|
|
# Syntax
|
|
|
|
|
if [ "x$1" = "x" ]
|
|
|
|
|
then
|
2015-12-18 18:25:09 +01:00
|
|
|
echo "This push local files to transifex for project $project."
|
2013-08-03 16:24:52 +02:00
|
|
|
echo "Note: If you push a language file (not source), file will be skipped if transifex file is newer."
|
2013-07-31 14:11:58 +02:00
|
|
|
echo " Using -f will overwrite translation but not memory."
|
2018-06-06 11:20:35 +02:00
|
|
|
echo "Usage: ./dev/translation/txpush.sh (source|xx_XX|all) [-r $project.file] [-f] [--no-interactive]"
|
2013-05-27 10:32:47 +02:00
|
|
|
exit
|
|
|
|
|
fi
|
|
|
|
|
|
2014-05-18 12:06:09 +02:00
|
|
|
if [ ! -d ".tx" ]
|
|
|
|
|
then
|
|
|
|
|
echo "Script must be ran from root directory of project with command ./dev/translation/txpush.sh"
|
|
|
|
|
exit
|
|
|
|
|
fi
|
2013-05-27 10:32:47 +02:00
|
|
|
|
2013-07-02 00:21:03 +02:00
|
|
|
if [ "x$1" = "xsource" ]
|
|
|
|
|
then
|
|
|
|
|
echo "tx push -s $2 $3"
|
|
|
|
|
tx push -s $2 $3
|
2013-05-27 10:32:47 +02:00
|
|
|
else
|
2015-12-18 18:25:09 +01:00
|
|
|
if [ "x$1" = "xall" ]
|
|
|
|
|
then
|
|
|
|
|
for dir in `find htdocs/langs/* -type d`
|
|
|
|
|
do
|
|
|
|
|
shortdir=`basename $dir`
|
|
|
|
|
file=$3
|
|
|
|
|
echo $file
|
|
|
|
|
export basefile=`basename $file | sed -s s/\.lang//g`
|
|
|
|
|
echo "tx push --skip -t -l $shortdir $2 $3 $4"
|
|
|
|
|
tx push --skip -t -l $shortdir $2 $3 $4
|
|
|
|
|
done
|
|
|
|
|
else
|
|
|
|
|
for file in `find htdocs/langs/$1/*.lang -type f`
|
|
|
|
|
do
|
|
|
|
|
echo $file
|
|
|
|
|
export basefile=`basename $file | sed -s s/\.lang//g`
|
|
|
|
|
echo "tx push --skip -r $project.$basefile -t -l $1 $2 $3 $4"
|
|
|
|
|
tx push --skip -r $project.$basefile -t -l $1 $2 $3 $4
|
|
|
|
|
done
|
|
|
|
|
fi
|
2013-05-27 10:32:47 +02:00
|
|
|
fi
|