summaryrefslogtreecommitdiff
path: root/lang/tests/translations.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lang/tests/translations.cpp')
-rw-r--r--lang/tests/translations.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/lang/tests/translations.cpp b/lang/tests/translations.cpp
new file mode 100644
index 0000000..1bb78a5
--- /dev/null
+++ b/lang/tests/translations.cpp
@@ -0,0 +1,29 @@
+#include <catch2/catch_test_macros.hpp>
+#include <catch2/generators/catch_generators.hpp>
+
+#include <libintl.h>
+
+#include <format>
+#include <string>
+
+TEST_CASE("All supported languages have translations")
+{
+ auto message = GENERATE(
+ "Turns",
+ "Add a participant",
+ "No active turn-order",
+ "_Quit"
+ );
+
+ auto locale = GENERATE(
+ "de_CH.UTF-8",
+ "de_DE.UTF-8",
+ "de_AT.UTF-8"
+ );
+
+ SECTION(std::format("'{}' has a translation in '{}'", message, locale))
+ {
+ setlocale(LC_ALL, locale);
+ REQUIRE(std::string{gettext(message)} != message);
+ }
+}