Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
build: Print RTL limited characters in translation-checker
Signed-off-by: provokateurin <[email protected]>
  • Loading branch information
provokateurin authored and backportbot[bot] committed Oct 23, 2024
commit 21eb62c1556cabf7bebcb25defc9f2da8a8e5094
4 changes: 2 additions & 2 deletions build/translation-checker.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down