1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
#!/bin/bash
# make-ts
# Set NOOBSOLETE to 1 to drop obsolete translations:
# $ NOOBSOLETE=1 scripts/make-ts
PERL=perl
# Get strings from presets.xml
$PERL scripts/extract_instrument_tr_strings.pl data/presets/presets.xml \
>data/InstrumentStrings.cpp
# Get strings from the .rc files.
$PERL scripts/extract_menu_tr_strings.pl data/rc/*.rc >data/QMenuStrings.cpp
# Get strings from autoload.rg
gunzip -c data/autoload/autoload.rg > data/autoload/autoload.xml
$PERL scripts/extract_autoload_tr_strings.pl data/autoload/autoload.xml \
>data/AutoloadStrings.cpp
rm -f data/autoload/autoload.xml
mkdir -p data/locale
# Get a list of the .ts files.
TRANSLATIONS=`ls data/locale/*.ts | grep -v rosegarden.ts`
if [ "$NOOBSOLETE" == "1" ]; then
NOOBSOPT="-noobsolete"
fi
LUPDATE=lupdate
if type $LUPDATE 2>/dev/null
then
echo found $LUPDATE
else
LUPDATE=lupdate-qt5
echo found $LUPDATE
fi
# Update the .ts files.
$LUPDATE $NOOBSOPT `find src -name '*.ui' -o -name '*.cpp' -o -name '*.h'` \
data/QMenuStrings.cpp data/InstrumentStrings.cpp \
data/AutoloadStrings.cpp -ts data/locale/rosegarden.ts \
$TRANSLATIONS $@
# Display statistics.
scripts/ts-stats
|