From a4c6749b020d5cb4e63a54b0aa9ca5ebe961ee4d Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 30 Mar 2021 20:19:41 +0200 Subject: Add a check for the pipe character Signed-off-by: Joas Schilling --- build/translation-checker.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'build') diff --git a/build/translation-checker.php b/build/translation-checker.php index 1f7ec343af5..2c3a7856d81 100644 --- a/build/translation-checker.php +++ b/build/translation-checker.php @@ -48,6 +48,11 @@ foreach ($directories as $dir) { $content = file_get_contents($file->getPathname()); $json = json_decode($content, true); + $translations = json_encode($json['translations']); + if (strpos($content, '|') !== false) { + $errors[] = $file->getPathname() . "\n" . ' ' . 'Contains a | in the translations' . "\n"; + } + if (json_last_error() !== JSON_ERROR_NONE) { $errors[] = $file->getPathname() . "\n" . ' ' . json_last_error_msg() . "\n"; } else { -- cgit v1.2.3