diff options
author | Joas Schilling <coding@schilljs.com> | 2024-10-23 09:39:57 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2024-10-23 09:39:57 +0200 |
commit | 61e3fa054de4e5df58bc8825dd7c1493cd25fb14 (patch) | |
tree | 4b6da33b3f938c47eec35f4d71e536a9f8776789 /build | |
parent | f660e4c09fd99805997ce37b265375dd702c9348 (diff) | |
download | nextcloud-server-61e3fa054de4e5df58bc8825dd7c1493cd25fb14.tar.gz nextcloud-server-61e3fa054de4e5df58bc8825dd7c1493cd25fb14.zip |
build: Show the actual stringbuild/translation-checker-print-rtl-limited-characters
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'build')
-rw-r--r-- | build/translation-checker.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/build/translation-checker.php b/build/translation-checker.php index 86646ac47ca..6b820bea190 100644 --- a/build/translation-checker.php +++ b/build/translation-checker.php @@ -76,8 +76,8 @@ foreach ($directories as $dir) { $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); |