diff --git a/build/translation-checker.php b/build/translation-checker.php index 7bc80d53cdb08..636fa9aee27d8 100644 --- a/build/translation-checker.php +++ b/build/translation-checker.php @@ -48,6 +48,12 @@ } $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"; + } + $json = json_decode($content, true); $translations = json_encode($json['translations']);