Skip to content

Commit

Permalink
build: Show the actual string
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Oct 23, 2024
1 parent f660e4c commit 61e3fa0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build/translation-checker.php
Original file line number Diff line number Diff line change
Expand Up @@ -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, $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";
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 strings:' . "\n" . implode("\n", $matches[0]) . "\n";
}

$json = json_decode($content, true);
Expand Down

0 comments on commit 61e3fa0

Please sign in to comment.