From 36b08e69d148d665827967c65df2b818b25b6d66 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Sun, 9 Oct 2022 17:24:08 +0200 Subject: [PATCH] [po] meson target update-po --- po/meson.build | 3 +++ po/update_po.sh | 15 +++++++++++++++ 2 files changed, 18 insertions(+) create mode 100755 po/update_po.sh diff --git a/po/meson.build b/po/meson.build index 26a943bd6..30712da1b 100644 --- a/po/meson.build +++ b/po/meson.build @@ -9,3 +9,6 @@ endif check_po_sh = find_program('check_po.sh') run_target('check-po', command:[check_po_sh]) + +update_po_sh = find_program('update_po.sh') +run_target('update-po', command:[update_po_sh]) diff --git a/po/update_po.sh b/po/update_po.sh new file mode 100755 index 000000000..d54abd4fa --- /dev/null +++ b/po/update_po.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +SRC=$(dirname -- ${BASH_SOURCE[0]}) + +for po in "$SRC"/*.po +do + lang=$(basename $po .po) + echo -n "$lang" + if $(msgmerge "$SRC/$lang.po" "$SRC/elinks.pot" -o "$lang.new.po"); then + mv -f "$lang.new.po" "$SRC/$lanf.po" + else + echo "msgmerge failed!" + rm -f "$lang.new.po" + fi +done