From 9a7e34d491b828a227930654d4f99e4fd2eb93ec Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 6 May 2025 18:11:33 +0200 Subject: Pass --check to msgfmt and fix broken format strings The check option discovers broken format string translations as well as other issues like broken headers, enable it. The Japanese translation was discovered to both use the wrong ordering for %.*s translations with different positions, and missing the dot, e.g. %1$*2$s should have been %2$.*1$s (the number after % matches the string and the number after .* the size) --- CMake/Translations.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'CMake') diff --git a/CMake/Translations.cmake b/CMake/Translations.cmake index a7fe6c95b..d8e5a3698 100644 --- a/CMake/Translations.cmake +++ b/CMake/Translations.cmake @@ -114,7 +114,7 @@ function(apt_add_translation_domain) DEPENDS ${file} ${CMAKE_CURRENT_BINARY_DIR}/${domain}.pot-tmp ) add_custom_command(OUTPUT ${outdir}/${domain}.mo - COMMAND msgfmt --statistics -o ${outdir}/${domain}.mo ${outdir}/${domain}.po + COMMAND msgfmt --check --statistics -o ${outdir}/${domain}.mo ${outdir}/${domain}.po DEPENDS ${outdir}/${domain}.po ) @@ -179,7 +179,7 @@ function(apt_add_po_statistics excluded) add_custom_command( TARGET statistics PRE_BUILD COMMAND printf "%-6s " "${langcode}:" - COMMAND msgfmt --statistics -o /dev/null ${translation} + COMMAND msgfmt --check --statistics -o /dev/null ${translation} VERBATIM ) endforeach() -- cgit v1.2.3-70-g09d2