diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2022-10-19 13:55:49 +0200 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2022-10-21 10:10:57 +0200 |
| commit | 5a93ef0ce76c62d339f553d54e6186b975cb6aaa (patch) | |
| tree | d8ce4ce4f7fdad658484b658263a5ec37f0588f1 | |
| parent | 0c6bf34d23c44f5c7c16a03f089291eb3c1876cb (diff) | |
| download | mullvadvpn-5a93ef0ce76c62d339f553d54e6186b975cb6aaa.tar.xz mullvadvpn-5a93ef0ce76c62d339f553d54e6186b975cb6aaa.zip | |
Move translation verification to localization script
| -rw-r--r-- | .github/workflows/translations.yml | 18 | ||||
| -rwxr-xr-x | scripts/localization | 19 |
2 files changed, 20 insertions, 17 deletions
diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml index dde8b9c2fd..3472426265 100644 --- a/.github/workflows/translations.yml +++ b/.github/workflows/translations.yml @@ -41,19 +41,5 @@ jobs: toolchain: stable default: true - - name: Extract messages from desktop GUI - working-directory: gui/locales - run: npm run update-translations - - - name: Convert translations into Android resources - working-directory: android/translations-converter - run: cargo run - - - name: Check if repository is up to date - run: | - git diff - ! git status -s | grep . - - - name: Check if format specifiers are correct - working-directory: gui/scripts - run: npm exec ts-node verify-translations-format.ts + - name: Verify translations + run: scripts/localization verify diff --git a/scripts/localization b/scripts/localization index 6d0f6ac104..097f113a4d 100755 --- a/scripts/localization +++ b/scripts/localization @@ -13,8 +13,9 @@ function main { upload) upload_to_crowdin;; download) download_from_crowdin;; sync-local-files) sync_localizations;; + verify) verify;; "") - echo "Available subcommands: prepare, upload, download and sync-local-files" + echo "Available subcommands: prepare, upload, download, sync-local-files and verify" ;; *) echo "Unknown parameter: $1" @@ -102,5 +103,21 @@ function download_from_crowdin { commit_changes "Update translations" } +function verify { + sync_localizations + git diff + ! git status -s | grep . + local out_of_sync=$? + + pushd ../gui/scripts + npm exec ts-node verify-translations-format.ts + local incorrect_format=$? + popd + + if [ "$out_of_sync" -ne 0 ] || [ "$incorrect_format" -ne 0 ]; then + exit 1 + fi +} + main "$@" |
