Skip to content

Commit 2055516

Browse files
authored
Merge pull request #48839 from nextcloud/build/translation-checker-print-rtl-limited-characters
build: Print RTL limited characters in translation-checker
2 parents 74cd6e2 + 61e3fa0 commit 2055516

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

build/translation-checker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@
7676
$content = file_get_contents($file->getPathname());
7777

7878
$language = pathinfo($file->getFilename(), PATHINFO_FILENAME);
79-
if (!in_array($language, $rtlLanguages, true) && preg_match('/[' . implode('', $rtlCharacters) . ']/u', $content)) {
80-
$errors[] = $file->getPathname() . "\n" . ' ' . 'Contains a RTL limited character in the translations.' . "\n";
79+
if (!in_array($language, $rtlLanguages, true) && preg_match_all('/^(.+[' . implode('', $rtlCharacters) . '].+)$/mu', $content, $matches)) {
80+
$errors[] = $file->getPathname() . "\n" . ' ' . 'Contains a RTL limited characters in the translations. Offending strings:' . "\n" . implode("\n", $matches[0]) . "\n";
8181
}
8282

8383
$json = json_decode($content, true);

0 commit comments

Comments
 (0)