chore(ci): Check missing translations keys

This commit is contained in:
roschaefer 2020-02-12 15:10:20 +01:00 committed by Moriz Wahl
parent fa906efb1f
commit 069e67f942
3 changed files with 16 additions and 1 deletions

View File

@ -25,7 +25,8 @@ script:
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
- echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH"
# Miscellaneous
- ./scripts/sort-translations.sh
- ./scripts/translations/sort.sh
- ./scripts/translations/missing-keys.sh
# Backend
- docker-compose exec backend yarn run lint
- docker-compose exec backend yarn run test --ci --verbose=false --coverage

View File

@ -0,0 +1,14 @@
#! /usr/bin/env bash
ROOT_DIR=$(dirname "$0")/..
english="$ROOT_DIR/webapp/locales/en.json"
german="$ROOT_DIR/webapp/locales/de.json"
listPaths="jq -c 'path(..)|[.[]|tostring]|join(\".\")'"
if eval "diff -q <( $listPaths < $english ) <( $listPaths < $german )";
then
: # all good
else
eval "diff -y <( $listPaths < $english ) <( $listPaths < $german )";
printf "\nEnglish and German translation keys do not match, see diff above.\n"
exit 1
fi