2023-01-12 17:33:39 +01:00
|
|
|
#!/bin/bash
|
|
|
|
# Run this script if you want to find and update all strings in the code.
|
|
|
|
# Please, run this script from folder <root_folder>/scripts.
|
|
|
|
|
|
|
|
start=$(date +%s)
|
|
|
|
|
|
|
|
# Download all translations from transifex.com.
|
|
|
|
|
|
|
|
# Empty means unstable branch
|
|
|
|
VALENTINA_BRANCH='' # for example 05x
|
|
|
|
|
2023-05-17 15:10:10 +02:00
|
|
|
LANGUAGES="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"
|
|
|
|
|
2023-01-12 17:33:39 +01:00
|
|
|
# Certant languages like he_IL and zh_CN are not supported by math parser
|
2023-05-17 15:10:10 +02:00
|
|
|
tx pull -r valentina-project.valentina_${VALENTINA_BRANCH}ts --mode=default -f --skip -l "${LANGUAGES}" &
|
2023-01-12 17:33:39 +01:00
|
|
|
wait
|
|
|
|
|
2023-05-17 15:10:10 +02:00
|
|
|
# cannot fix incorrect placing for pattern making systems
|
|
|
|
cp -r ./share/translations/* ../share/translations
|
|
|
|
rm -r ./share
|
|
|
|
|
2023-01-12 17:33:39 +01:00
|
|
|
# Resolve any changes to config
|
2023-05-08 16:47:26 +02:00
|
|
|
qbs resolve -d ../../build_translations modules.i18n.update:true moduleProviders.Qt.qmakeFilePaths:$HOME/Qt6.5/6.5.0/gcc_64/bin/qmake
|
2023-01-12 17:33:39 +01:00
|
|
|
# Update local strings
|
2023-05-08 16:47:26 +02:00
|
|
|
qbs -d ../../build_translations -f ../valentina.qbs -p 'Translations' modules.i18n.update:true moduleProviders.Qt.qmakeFilePaths:$HOME/Qt6.5/6.5.0/gcc_64/bin/qmake
|
2023-01-12 17:33:39 +01:00
|
|
|
|
|
|
|
end=$(date +%s)
|
2023-05-08 16:47:26 +02:00
|
|
|
runtime=$(python3 -c "print('Time passed %u:%02u seconds' % ((${end} - ${start})/60, (${end} - ${start})%60))")
|
2023-01-12 17:33:39 +01:00
|
|
|
echo $runtime
|
|
|
|
|