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

gitlab.com/Remmina/Remmina.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntenore Gatta <antenore@simbiosi.org>2019-01-09 16:10:01 +0300
committerAntenore Gatta <antenore@simbiosi.org>2019-01-09 16:10:01 +0300
commitba0fd73dd3a18cfae307705bb51395c20211275f (patch)
treee6822eb9c6288984e7f52c58354a7e98918b2f34 /scripts
parent64269ba366b914a88a85e7610b9da78da54e1abd (diff)
Adding basic script to update the po files
Diffstat (limited to 'scripts')
-rw-r--r--scripts/update-translations.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/scripts/update-translations.sh b/scripts/update-translations.sh
new file mode 100644
index 000000000..ca25ee6da
--- /dev/null
+++ b/scripts/update-translations.sh
@@ -0,0 +1,41 @@
+#!/bin/bash -
+
+SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
+REMMINATOP="$(dirname "$SCRIPTPATH")"
+
+cd "$REMMINATOP" || exit 1
+
+if ! find src plugins -name "*.c" | sed 's/^.\///' >| po/POTFILES.in ; then
+ exit 1
+fi
+if ! find data -name "*.glade" | sed 's/^.\///' >> po/POTFILES.in ; then
+ exit 1
+fi
+if ! find data -name "*.appdata.xml" | sed 's/^.\///' >> po/POTFILES.in ; then
+ exit 1
+fi
+
+xgettext --from-code=UTF-8 -k_ -kN_ -ktranslatable \
+ --keyword=C_:1c,2 --keyword=NC_:1c,2 \
+ --keyword=g_dngettext:2,3 \
+ --add-comments \
+ --files-from=po/POTFILES.in \
+ --output=po/messages.pot \
+ --copyright-holder="2014-2019 Antenore Gatta, Giovanni Panozzo" \
+ --package-name="Remmina" --package-version="1.2.31" \
+ --msgid-bugs-address="admin@remmina.org"
+
+cd "$REMMINATOP"/po || exit 1
+
+for i in *.po; do
+ msgmerge -N --backup=off --update "$i" messages.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
+
+rm messages.pot