File: make-ts

package info (click to toggle)
rosegarden 1%3A25.12-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 42,888 kB
  • sloc: cpp: 209,189; xml: 6,580; sh: 1,608; perl: 755; python: 416; ansic: 324; lisp: 139; ruby: 33; makefile: 20
file content (48 lines) | stat: -rwxr-xr-x 1,211 bytes parent folder | download | duplicates (3)
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