diff --git a/.drone.yml b/.drone.yml index 59aa8fa..e991cd4 100644 --- a/.drone.yml +++ b/.drone.yml @@ -67,6 +67,26 @@ trigger: branch: - master +--- +kind: pipeline +type: docker +name: translations + +steps: + - name: validate + image: golang:1.20 + pull: always + commands: + - apt update && apt -y install jq + - make validate-translations + +trigger: + event: + - push + - pull_request + branch: + - master + --- kind: pipeline type: docker @@ -372,6 +392,6 @@ depends_on: - migrations-manifest --- kind: signature -hmac: adb6f2a2d07f26eb833ea4cac0f54bb6aea7bc53a38d423afe7408701b270ac2 +hmac: 4fa2583c281aacc0e4d0dc87296a2ce6ff7facf71d1ce2e9f5d4157b35635d4f ... diff --git a/Makefile b/Makefile index a313619..e0c7c42 100644 --- a/Makefile +++ b/Makefile @@ -47,3 +47,7 @@ create-sql-migration: install-goose .PHONY: validate-migrations validate-migrations: install-goose @goose -dir migrations -v validate + +.PHONY: validate-translations +validate-translations: + @./validate_translations.sh diff --git a/validate_translations.sh b/validate_translations.sh new file mode 100755 index 0000000..e670ab2 --- /dev/null +++ b/validate_translations.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +LOCALE_EN_PATH="./internal/discord/internal/discordi18n/locale.en.json" + +status=0 + +for path in ./internal/discord/internal/discordi18n/locale.*.json; do + if [ "$path" = $LOCALE_EN_PATH ]; then + continue + fi + echo "----- ${path}" + if diff <(jq 'keys' $LOCALE_EN_PATH) <(jq 'keys' "$path"); then + echo "----- Success" + else + status=1 + echo "----- Failed" + fi +done + +exit "$status"