mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
chore(ci): Check missing translations keys
This commit is contained in:
parent
fa906efb1f
commit
069e67f942
@ -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
|
||||
|
||||
14
scripts/translations/missing-keys.sh
Executable file
14
scripts/translations/missing-keys.sh
Executable 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
|
||||
Loading…
x
Reference in New Issue
Block a user