From fe1c819163ba5b256e27176b1c5c94a7a6069836 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Wed, 21 Apr 2021 14:02:41 +0200 Subject: [PATCH] Add check for unused languages in deploy.sh --- deploy.sh | 9 +++++++++ src/shared/i18next.ts | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/deploy.sh b/deploy.sh index 3ff2518..e840821 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -e git submodule update --remote git add lemmy-docs @@ -7,6 +8,14 @@ git add joinlemmy-translations git commit -m"Updating translations" git push +# look for unused translations +for langfile in joinlemmy-translations/translations/*.json; do + lang=$(basename $langfile .json) + if ! grep -q "\"./translations/$lang\"" src/shared/i18next.ts; then + echo "Unused language $lang" + fi +done + new_tag="$1" git tag $new_tag diff --git a/src/shared/i18next.ts b/src/shared/i18next.ts index 93ad357..afad0a3 100644 --- a/src/shared/i18next.ts +++ b/src/shared/i18next.ts @@ -13,6 +13,8 @@ import { fr } from "./translations/fr"; import { el } from "./translations/el"; import { ko } from "./translations/ko"; import { pl } from "./translations/pl"; +import { ar } from "./translations/ar"; +import { eo } from "./translations/eo"; // https://github.com/nimbusec-oss/inferno-i18next/blob/master/tests/T.test.js#L66 const resources = { @@ -28,6 +30,8 @@ const resources = { el, ko, pl, + ar, + eo, }; function format(value: any, format: any): any {