From 21eb62c1556cabf7bebcb25defc9f2da8a8e5094 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Tue, 22 Oct 2024 13:03:06 +0200 Subject: [PATCH] build: Print RTL limited characters in translation-checker Signed-off-by: provokateurin --- build/translation-checker.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/translation-checker.php b/build/translation-checker.php index b6d947ecbf091..6f131336ef3df 100644 --- a/build/translation-checker.php +++ b/build/translation-checker.php @@ -77,8 +77,8 @@ $content = file_get_contents($file->getPathname()); $language = pathinfo($file->getFilename(), PATHINFO_FILENAME); - if (!in_array($language, $rtlLanguages, true) && preg_match('/[' . implode('', $rtlCharacters) . ']/u', $content)) { - $errors[] = $file->getPathname() . "\n" . ' ' . 'Contains a RTL limited character in the translations.' . "\n"; + if (!in_array($language, $rtlLanguages, true) && preg_match('/[' . implode('', $rtlCharacters) . ']/u', $content, $matches)) { + $errors[] = $file->getPathname() . "\n" . ' ' . 'Contains a RTL limited characters in the translations. Offending Unicode codepoints: ' . implode(', ', array_map(static fn (string $match) => mb_ord($match), $matches)) . "\n"; } $json = json_decode($content, true);