summaryrefslogtreecommitdiffstats
path: root/refresh-translations
diff options
context:
space:
mode:
authoranonym <anonym@riseup.net>2017-09-06 18:47:12 +0200
committeranonym <anonym@riseup.net>2017-09-13 00:09:17 +0200
commit9dcf084257aba928345cec74ed483b402c1c94b4 (patch)
tree645a93ddf6baf4ceb9b068e01150fb28c27a6af9 /refresh-translations
parent0f0a980df96e19e31ca37714feb6be7270cfb747 (diff)
Implement refresh-translations --force.
Diffstat (limited to 'refresh-translations')
-rwxr-xr-xrefresh-translations24
1 files changed, 22 insertions, 2 deletions
diff --git a/refresh-translations b/refresh-translations
index bc3af33..1f9738c 100755
--- a/refresh-translations
+++ b/refresh-translations
@@ -62,7 +62,10 @@ refresh_pot () {
xgettext --language="${proglang}" --from-code=UTF-8 \
-o "${pot}" "${progpath}"
normalize_pot "${pot}" "${orig}"
- if diff_without_pot_creation_date_and_comments "${pot}" "${orig}" >/dev/null; then
+ if [ "${FORCE}" = yes ]; then
+ echo "Force-updating '${pot}'."
+ rm "${orig}"
+ elif diff_without_pot_creation_date_and_comments "${pot}" "${orig}" >/dev/null; then
echo "Only header or comment changes in '${orig}', restoring the old one."
mv "${orig}" "${pot}"
else
@@ -106,7 +109,10 @@ intltool_update_pot () {
intltool-update --pot --gettext-package=tails
normalize_pot tails.pot tails.pot.orig
- if diff_without_pot_creation_date_and_comments tails.pot.orig tails.pot >/dev/null; then
+ if [ "${FORCE}" = yes ]; then
+ echo "Force-updating 'tails.pot'."
+ rm tails.pot.orig
+ elif diff_without_pot_creation_date_and_comments tails.pot.orig tails.pot >/dev/null; then
echo "Only header or comment changes in tails.pot, restoring the old one."
mv tails.pot.orig tails.pot
else
@@ -126,6 +132,20 @@ intltool_merge () {
### Main
+FORCE=no
+while [ -n "${@:-}" ]; do
+ case "${1:-}" in
+ '--force')
+ FORCE=yes
+ ;;
+ *)
+ echo "Unknown option: ${1}"
+ exit 1
+ ;;
+ esac
+ shift
+done
+
# Update POT files
mkdir -p tmp/pot
for prog in $PERL_PROGS ; do refresh_pot $prog Perl ; done