From dee2c8d23bc4c1fc83c1263cf29ea2de2b1098ec Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 25 Apr 2017 11:01:34 +0200 Subject: Check whether we can json decode the translations Signed-off-by: Joas Schilling --- .drone.yml | 7 +++++++ 1 file changed, 7 insertions(+) (limited to '.drone.yml') diff --git a/.drone.yml b/.drone.yml index 9b6a01bd4f0..6dccfa6d4d8 100644 --- a/.drone.yml +++ b/.drone.yml @@ -26,6 +26,13 @@ pipeline: when: matrix: TESTS: check-mergejs + translation-check: + image: nextcloudci/php7.0:php7.0-7 + commands: + - php ./build/translation-checker.php + when: + matrix: + TESTS: translation-check app-check-code: image: nextcloudci/php7.0:php7.0-7 commands: -- cgit v1.2.3 From 7ea492b69a24435c4aa62567cf31a0a246afc517 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 25 Apr 2017 14:35:51 +0200 Subject: Loop over the apps directory and add the task Signed-off-by: Joas Schilling --- .drone.yml | 1 + build/translation-checker.php | 34 +++++++++++----------------------- 2 files changed, 12 insertions(+), 23 deletions(-) (limited to '.drone.yml') diff --git a/.drone.yml b/.drone.yml index 6dccfa6d4d8..69893719778 100644 --- a/.drone.yml +++ b/.drone.yml @@ -543,6 +543,7 @@ pipeline: matrix: include: - TESTS: signed-off-check + - TESTS: translation-check - TESTS: htaccess-checker - TESTS: nodb-codecov - TESTS: db-codecov diff --git a/build/translation-checker.php b/build/translation-checker.php index 296a20243da..5532fb9f65b 100644 --- a/build/translation-checker.php +++ b/build/translation-checker.php @@ -22,29 +22,17 @@ $directories = [ __DIR__ . '/../core/l10n', __DIR__ . '/../settings/l10n', - __DIR__ . '/../apps/admin_audit/l10n', - __DIR__ . '/../apps/comments/l10n', - __DIR__ . '/../apps/dav/l10n', - __DIR__ . '/../apps/encryption/l10n', - __DIR__ . '/../apps/federatedfilesharing/l10n', - __DIR__ . '/../apps/federation/l10n', - __DIR__ . '/../apps/files/l10n', - __DIR__ . '/../apps/files_external/l10n', - __DIR__ . '/../apps/files_sharing/l10n', - __DIR__ . '/../apps/files_trashbin/l10n', - __DIR__ . '/../apps/files_versions/l10n', - __DIR__ . '/../apps/lookup_server_connector/l10n', - __DIR__ . '/../apps/provisioning_api/l10n', - __DIR__ . '/../apps/sharebymail/l10n', - __DIR__ . '/../apps/systemtags/l10n', - __DIR__ . '/../apps/testing/l10n', - __DIR__ . '/../apps/theming/l10n', - __DIR__ . '/../apps/twofactor_backupcodes/l10n', - __DIR__ . '/../apps/updatenotification/l10n', - __DIR__ . '/../apps/user_ldap/l10n', - __DIR__ . '/../apps/workflowengine/l10n', ]; +$apps = new \DirectoryIterator(__DIR__ . '/../apps'); +foreach ($apps as $app) { + if (!file_exists($app->getPathname() . '/l10n')) { + continue; + } + + $directories[] = $app->getPathname() . '/l10n'; +} + $errors = []; foreach ($directories as $dir) { if (!file_exists($dir)) { @@ -73,9 +61,9 @@ foreach ($directories as $dir) { echo "\n\n"; if (count($errors) > 0) { echo sprintf('ERROR: There were %d errors:', count($errors)) . "\n"; - echo implode("\n", $errors); + echo implode("\n", $errors) . "\n"; exit(1); } -echo 'OK: all files parse'; +echo 'OK: all files parse' . "\n"; exit(0); -- cgit v1.2.3