Browse Source
Merge pull request #48839 from nextcloud/build/translation-checker-print-rtl-limited-characters
build: Print RTL limited characters in translation-checker
refactor/apps/declare-strict-types
Ferdinand Thiessen
12 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
2 additions and
2 deletions
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 )) {
$errors [] = $file -> getPathname () . " \n " . ' ' . 'Contains a RTL limited character in the translations.' . " \n " ;
if ( ! in_array ( $language , $rtlLanguages , true ) && preg_match_all ( '/^(.+ [' . implode ( '' , $rtlCharacters ) . '].+)$ /m u' , $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 );