forked from KDE/marble
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Messages.sh
executable file
·41 lines (36 loc) · 1.7 KB
/
Messages.sh
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
#! /bin/sh
for fname in `find -iname \*.dgml`; do
for field in name description heading text ; do
grep -inH "<$field>.*<\/$field>" $fname \
| sed 's/\"/\\\"/g' \
| sed 's/<!\[CDATA\[\(.*\)\]\]>/\1/' \
| sed "s/\\([^:]*\\):\\([^:]*\\):.*<$field>\(.*\)<\/$field>.*/\
\/\/i18n: file \1 line \2\n\
i18n(\"\3\");\
/i" \
>> rc.cpp
done
done
cat data/legend.html \
| tr -d '\n' \
| sed -e 's/.*<body>\(.*\)<\/body>/\1/' \
-e 's/^<!DOCTYPE html>//' \
-e 's@<link href="legend.css" rel="stylesheet" type="text/css" />@@' \
-e 's/%!{bootstrap}%//' \
-e 's/body *{ *padding: 10px; *}//' \
-e 's/<!--[- "&'\''./0-9:;<=>A-Z_a-z]*-->[\t ]*/\n/g' \
-e 's/<[A-Za-z0-9]*\( [a-z:]*=\"[-A-Za-z0-9:/_.% ]*\"\)*>[\t ]*/\n/g' \
-e 's/<\/[A-Za-z0-9]*>[\t ]*/\n/g' \
| sed -e 's/^ *//' -e 's/ *$//' -e 's/^ $//' -e '/^$/d' \
| sed -e 's/^\(.*\)$/\/\/i18n: file .\/data\/legend.html\ni18n(\"\1\");/' \
>> rc.cpp
cut -d ';' -f 1 data/stars/names.csv | sed -e 's/^/tr(\"/' -e 's/$/\");/' >> rc_qt.cpp
# Eliminate empty i18n calls.
egrep -B1 'i18nc?\(".*[^ ].*"\)' rc.cpp > rc.cpp.1
mv rc.cpp.1 rc.cpp
$EXTRACTRC `find . -name '*.ui' \
-o -name '*.rc' -a ! -name marble.rc \
-o -name '*.kcfg'` >> rc.cpp
$XGETTEXT src/apps/marble-kde/kdemain.cpp src/apps/marble-kde/marble_part.cpp rc.cpp -o $podir/marble.pot
$XGETTEXT_QT src/apps/marble-qt/QtMainWindow.cpp src/apps/marble-qt/qtmain.cpp src/apps/marble-ui/ControlView.cpp `find src/plugins -name '*.cpp' | grep -v '/test/'` `find src/lib -name '*.cpp'` src/lib/marble/global.h src/lib/marble/MarbleGlobal.h rc_qt.cpp -o $podir/marble_qt.pot
rm -f rc_qt.cpp