dolibarr/dev/translation/txpull.sh

69 lines
1.9 KiB
Bash
Raw Normal View History

2020-06-06 15:35:50 +02:00
#!/bin/bash
2013-05-27 10:32:47 +02:00
#------------------------------------------------------
# Script to pull language files to Transifex
#
# Laurent Destailleur - eldy@users.sourceforge.net
#------------------------------------------------------
2013-08-03 16:24:52 +02:00
# Usage: txpull.sh (all|xx_XX) [-r dolibarr.file] [-f]
2013-05-27 10:32:47 +02:00
#------------------------------------------------------
# shellcheck disable=2006,2044,2086,2164,2268
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
2013-08-03 16:24:52 +02:00
echo "This pull remote transifex files to local dir."
2013-09-03 00:06:42 +02:00
echo "Note: If you pull a language file (not source), file will be skipped if local file is newer."
2013-08-03 16:24:52 +02:00
echo " Using -f will overwrite local file (does not work with 'all')."
2020-01-12 22:00:23 +01:00
echo " Using -s will force fetching of source file (avoid it, use en_US as language instead)."
2020-01-12 21:28:09 +01:00
echo " Using en_US as language parameter will update source language from transifex (en_US is excluded from 'all')."
2020-01-12 21:27:43 +01:00
echo "Usage: ./dev/translation/txpull.sh (all|en_US|xx_XX) [-r dolibarr.file] [-f] [-s]"
2014-05-18 12:06:09 +02:00
exit
fi
if [ ! -d ".tx" ]
then
echo "Script must be ran from root directory of project with command ./dev/translation/txpull.sh"
2013-05-27 10:32:47 +02:00
exit
fi
if [ "x$1" = "xall" ]
then
2017-02-21 10:26:11 +01:00
if [ "x$2" = "x" ]
then
echo "tx pull -a"
tx pull -a
echo "Remove some language directories (not enough translated) like ach, br_FR, en, frp, fy_NL, ..."
rm -fr htdocs/langs/ach
rm -fr htdocs/langs/br_FR
rm -fr htdocs/langs/en
rm -fr htdocs/langs/frp
rm -fr htdocs/langs/fy_NL
2017-02-21 10:26:11 +01:00
else
for dir in `find htdocs/langs/* -type d`
do
fic=`basename $dir`
if [ $fic != "en_US" ]
then
echo "tx pull -l $fic $2 $3"
tx pull -l $fic $2 $3
2017-02-21 10:26:11 +01:00
fi
done
fi
2015-03-14 02:37:18 +01:00
cd -
2013-05-27 10:32:47 +02:00
else
2015-03-14 02:37:18 +01:00
echo "tx pull -l $1 $2 $3 $4 $5"
tx pull -l $1 $2 $3 $4 $5
2013-05-27 10:32:47 +02:00
fi
echo Think to launch also:
2016-10-11 10:24:02 +02:00
echo "> dev/tools/fixaltlanguages.sh fix all"
2023-08-13 19:09:07 +02:00
#echo "For v11: Replace also regex \(.*(sponge|cornas|eratosthene|cyan).*\) with '' on *.lang files"
2020-01-27 16:07:53 +01:00