Welcome to mirror list, hosted at ThFree Co, Russian Federation.

update-translations.sh « scripts - gitlab.com/Remmina/Remmina.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 57c942201e815d4b04a84cbb57931767ae19b4bc (plain)
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
49
50
51
52
#!/bin/bash -

SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
REMMINATOP="$(dirname "$SCRIPTPATH")"

cd "$REMMINATOP" || exit 1

if ! find src plugins -name "*\.c" -o -name "*\.h" | sed 's/^.\///'  >| po/POTFILES.in ; then
    exit 1
fi
if ! find data -name "*.glade" | sed 's/^.\///' >> po/POTFILES.in ; then
    exit 1
fi

xgettext --from-code=UTF-8 \
	--keyword=_ \
	--keyword=N_ \
	--keyword=translatable \
	--keyword=C_:1c,2 \
	--keyword=NC_:1c,2 \
	--keyword=g_dngettext:2,3 \
	--add-comments \
	--files-from=po/POTFILES.in \
	--output=po/remmina.temp.pot \
	--package-version="v1.3.0" \
	--package-name="Remmina" \
	--copyright-holder="Antenore Gatta and Giovanni Panozzo" \
	--msgid-bugs-address="admin@remmina.org"

cd "$REMMINATOP"/po || exit 1

# Set charset to UTF-8
sed -i -e 's/charset=CHARSET/charset=UTF-8/g' remmina.temp.pot

if diff -qI "POT-Creation-Date" remmina.temp.pot remmina.pot ; then
	echo "No new strings to be translated"
	rm remmina.temp.pot
	exit 0
fi

mv remmina.temp.pot remmina.pot

for i in *.po; do
    msgmerge -N --backup=off --update "$i" remmina.pot
done

for i in "$REMMINATOP"/po/*.po ; do
    TMPF=/tmp/f$$.txt
    sed '/^#~/d' "$i" > "$TMPF"
    awk 'BEGIN{bl=0}/^$/{bl++;if(bl==1)print;else next}/^..*$/{bl=0;print}' $TMPF >| "$i"
    rm $TMPF
done