summaryrefslogtreecommitdiffstats
path: root/refresh-translations
diff options
context:
space:
mode:
authoranonym <anonym@riseup.net>2017-09-06 16:13:47 +0200
committeranonym <anonym@riseup.net>2017-09-12 23:58:15 +0200
commit3cffc9c5b8ad409f2122cd259c85d521ad36b744 (patch)
tree8e807def78c5550683dcf2c321dc8e06282b173b /refresh-translations
parentc95383d3b0d66c921d03e50d3dde581713356573 (diff)
Normalize both POT files before comparing.
Otherwise we'll often converge to a state where we always get into the "Real changes ..." case, which feels wrong; after a single run, consecutive runs should always end up in the "Only header ...# case.
Diffstat (limited to 'refresh-translations')
-rwxr-xr-xrefresh-translations7
1 files changed, 6 insertions, 1 deletions
diff --git a/refresh-translations b/refresh-translations
index 3b40261..a19a6b8 100755
--- a/refresh-translations
+++ b/refresh-translations
@@ -28,6 +28,10 @@ LOCALE_BASEDIR=config/chroot_local-includes/usr/share/locale
### Functions
+normalize_pot () {
+ sed -i "s@^\"Content-Type: text/plain\; charset=CHARSET\\\n\"@\"Content-Type: text/plain\; charset=UTF-8\\\n\"@" "${@}"
+}
+
prog_potfile () {
prog=$1
@@ -57,7 +61,7 @@ refresh_pot () {
cp "${pot}" "${orig}"
xgettext --language="${proglang}" --from-code=UTF-8 \
-o "${pot}" "${progpath}"
- sed -i "s@^\"Content-Type: text/plain\; charset=CHARSET\\\n\"@\"Content-Type: text/plain\; charset=UTF-8\\\n\"@" "${pot}"
+ normalize_pot "${pot}" "${orig}"
if diff_pot_only_line_comment_change "${pot}" "${orig}" ; then
echo "Only header or comment changes in '${orig}', restoring the old one."
mv "${orig}" "${pot}"
@@ -100,6 +104,7 @@ intltool_update_pot () {
cd po
cp -a tails.pot tails.pot.orig
intltool-update --pot --gettext-package=tails
+ normalize_pot tails.pot tails.pot.orig
if diff_without_pot_creation_date tails.pot.orig tails.pot && diff_pot_only_line_comment_change tails.pot.orig tails.pot ; then
echo "Only header or comment changes in tails.pot, restoring the old one."