Skip to content

Commit 2f7837e

Browse files
Merge pull request #48856 from nextcloud/backport/48839/stable30
[stable30] build: Print RTL limited characters in translation-checker
2 parents e200099 + 99eb553 commit 2f7837e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

build/translation-checker.php

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

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

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

0 commit comments

Comments
 (0)