From 3dd99e149291adb69392a7d62757e1f606150e52 Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Fri, 11 Jul 2025 20:02:59 +0200 Subject: [PATCH] updatepo: Drop strings that are obsolete for >1 script run This automatically removes old (and unused) translation strings such that the amount of garbage is kept in bounds. --- util/updatepo.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/util/updatepo.sh b/util/updatepo.sh index 5a0b9acfd..34f52bbd5 100755 --- a/util/updatepo.sh +++ b/util/updatepo.sh @@ -82,7 +82,10 @@ for lang in $langs ; do # note the missing quotes around $langs pofile=po/$lang/luanti.po if test -e $pofile; then echo "[$lang]: updating strings" - msgmerge --update --sort-by-file $pofile $potfile + # Drop old strings *before* updating such that they can be re-used + # until this script is run again. + msgattrib --output-file=$pofile --no-obsolete $pofile + msgmerge --update --backup=none --sort-by-file $pofile $potfile else # This will ask for the translator identity echo "[$lang]: NEW strings"