From ced060a295a0ea037b90e801a403632034eb0814 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 5 Mar 2024 16:58:10 +0100 Subject: [PATCH] add shell script to normalize all locale files --- scripts/translations/normalize.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 scripts/translations/normalize.sh diff --git a/scripts/translations/normalize.sh b/scripts/translations/normalize.sh new file mode 100755 index 000000000..2f5933977 --- /dev/null +++ b/scripts/translations/normalize.sh @@ -0,0 +1,19 @@ +#! /usr/bin/env bash + +ROOT_DIR=$(dirname "$0")/../.. +tmp=$(mktemp) + +locale_list=("es.json" "fr.json" "it.json" "nl.json" "pl.json" "pt.json" "ru.json") + +for locale_file in "${locale_list[@]}" +do + jq -n \ + -f $(dirname "$0")/normalize-locales.jq \ + --argfile source $ROOT_DIR/webapp/locales/en.json \ + --argfile target $ROOT_DIR/webapp/locales/$locale_file \ + > "$tmp" + mv "$tmp" $ROOT_DIR/webapp/locales/$locale_file +done + +exit 0 +