build: Show the actual string

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/48839/head
Joas Schilling 2024-10-23 09:39:57 +07:00
parent f660e4c09f
commit 61e3fa054d
No known key found for this signature in database
GPG Key ID: F72FA5B49FFA96B0
1 changed files with 2 additions and 2 deletions

@ -76,8 +76,8 @@ foreach ($directories as $dir) {
$content = file_get_contents($file->getPathname()); $content = file_get_contents($file->getPathname());
$language = pathinfo($file->getFilename(), PATHINFO_FILENAME); $language = pathinfo($file->getFilename(), PATHINFO_FILENAME);
if (!in_array($language, $rtlLanguages, true) && preg_match('/[' . implode('', $rtlCharacters) . ']/u', $content, $matches)) { if (!in_array($language, $rtlLanguages, true) && preg_match_all('/^(.+[' . implode('', $rtlCharacters) . '].+)$/mu', $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"; $errors[] = $file->getPathname() . "\n" . ' ' . 'Contains a RTL limited characters in the translations. Offending strings:' . "\n" . implode("\n", $matches[0]) . "\n";
} }
$json = json_decode($content, true); $json = json_decode($content, true);