From: Joas Schilling Date: Wed, 23 Oct 2024 07:39:57 +0000 (+0200) Subject: build: Show the actual string X-Git-Tag: v28.0.12rc1~31^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fheads%2Fbackport%2F48839%2Fstable28;p=nextcloud-server.git build: Show the actual string Signed-off-by: Joas Schilling --- diff --git a/build/translation-checker.php b/build/translation-checker.php index 6f131336ef3..6676a49caa8 100644 --- a/build/translation-checker.php +++ b/build/translation-checker.php @@ -77,8 +77,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);