From e6b75e5947205cdb2953d27765fc30696cfe3e18 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Mon, 18 Oct 2021 17:01:09 +0200 Subject: [PATCH] Add a test to check format strings in translations This should prevent #8358 from happening again. Note that, because it's not fixed yet, this test *will* fail. --- tests/checks/check-translations.fish | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/checks/check-translations.fish diff --git a/tests/checks/check-translations.fish b/tests/checks/check-translations.fish new file mode 100644 index 000000000..ba34ab2ad --- /dev/null +++ b/tests/checks/check-translations.fish @@ -0,0 +1,17 @@ +#RUN: %fish -C 'set -l fish %fish' %s +#REQUIRES: msgfmt --help + +set -l fail_count 0 +for file in $FISH_SOURCE_DIR/po/*.po + # We only check the format strings. + # Later on we might do a full "--check" to also check the headers. + msgfmt --check-format $file + or set fail_count (math $fail_count + 1) +end + +# Prevent setting timestamp if any errors were encountered +if test "$fail_count" -gt 0 + exit 1 +end + +# No output is good output