2016-12-13 13:44:10 +01:00
|
|
|
#!/bin/bash
|
2015-10-15 16:55:39 +02:00
|
|
|
# Run this script if you want to find and update all strings in the code.
|
2014-10-06 20:01:08 +02:00
|
|
|
# lupdate doesn't work with recursive *.pro file and without direct pointing to correct *.pro file just update exists strings in code.
|
2015-10-15 16:55:39 +02:00
|
|
|
# Please, run this script from folder <root_folder>/scripts.
|
|
|
|
|
2016-12-13 13:44:10 +01:00
|
|
|
start=$(date +%s)
|
|
|
|
|
2016-03-09 09:10:13 +01:00
|
|
|
# Download all translations from transifex.com.
|
2016-12-13 13:44:10 +01:00
|
|
|
cd ../share/translations
|
|
|
|
RESOURCES=`find . -regextype sed -regex ".*/measurements_p[0-9]\{1,2\}\.ts"`
|
|
|
|
cd ../../scripts
|
|
|
|
|
2017-05-19 11:08:13 +02:00
|
|
|
# Empty means unstable branch
|
|
|
|
MEASUREMENTS_BRANCH='' # For example _05x
|
|
|
|
VALENTINA_BRANCH='' # for example 05x
|
|
|
|
|
2016-12-13 13:44:10 +01:00
|
|
|
NUMBER=( $RESOURCES )
|
|
|
|
NUMBER=${#NUMBER[@]}
|
|
|
|
|
2019-10-17 13:38:33 +02:00
|
|
|
# Certant languages like he_IL and zh_CN are not supported by math parser
|
2016-12-13 13:44:10 +01:00
|
|
|
for ((i=0;i<NUMBER;i++)); do
|
2023-08-21 15:30:03 +02:00
|
|
|
tx pull -r valentina-project.measurements_p${i}${MEASUREMENTS_BRANCH}ts --mode=default -f --skip -l "uk,de_DE,cs,he_IL,fr_FR,it_IT,nl,id,es,fi,en_US,en_CA,en_IN,ro_RO,zh_CN,pt_BR,el_GR,pl_PL" &
|
|
|
|
sleep 2
|
2016-12-13 13:44:10 +01:00
|
|
|
done
|
|
|
|
|
2023-08-21 15:30:03 +02:00
|
|
|
tx pull -r valentina-project.valentina_${VALENTINA_BRANCH}ts --mode=default -f --skip &
|
|
|
|
sleep 2
|
|
|
|
tx pull -r valentina-project.measurements_p998${MEASUREMENTS_BRANCH}ts --mode=default -f --skip -l "uk,de_DE,cs,he_IL,fr_FR,it_IT,nl,id,es,fi,en_US,en_CA,en_IN,ro_RO,zh_CN,pt_BR,el_GR,pl_PL" &
|
2016-12-13 13:44:10 +01:00
|
|
|
|
|
|
|
wait
|
2015-10-15 16:55:39 +02:00
|
|
|
|
|
|
|
# Update local strings
|
2015-08-02 19:39:29 +02:00
|
|
|
lupdate -recursive ../share/translations/translations.pro
|
|
|
|
lupdate -recursive ../share/translations/measurements.pro
|
2015-10-19 22:15:50 +02:00
|
|
|
#clean stale QM files
|
2015-10-18 13:04:37 +02:00
|
|
|
rm -f -v ../share/translations/*.qm
|
2015-10-19 22:15:50 +02:00
|
|
|
# force to run qmake
|
2016-08-10 14:34:07 +02:00
|
|
|
MAKEFILES=`find ../../ -name Makefile`
|
|
|
|
|
|
|
|
for var in $MAKEFILES
|
|
|
|
do
|
|
|
|
rm -f -v $var
|
|
|
|
done
|
2015-11-15 20:28:41 +01:00
|
|
|
|
2016-12-13 13:44:10 +01:00
|
|
|
end=$(date +%s)
|
2021-03-30 19:43:19 +02:00
|
|
|
runtime=$(python -c "print('Time passed %u:%02u seconds' % ((${end} - ${start})/60, (${end} - ${start})%60))")
|
2016-12-13 13:44:10 +01:00
|
|
|
echo $runtime
|
2016-08-10 14:34:07 +02:00
|
|
|
echo For updating files run: build all.
|
|
|
|
|