diff --git a/build/translation-checker.php b/build/translation-checker.php index 9422f7e5dcb59..86646ac47ca5f 100644 --- a/build/translation-checker.php +++ b/build/translation-checker.php @@ -76,8 +76,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);