From 1cf60cbd38d31686e0eab01fbb31a7d1c03341bb Mon Sep 17 00:00:00 2001 From: Estelle Comment Date: Thu, 8 Feb 2024 17:57:41 +0100 Subject: [PATCH] i18n in CI : create a config.json when not present --- scripts/tchap/translations/crawl-for-translations.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/tchap/translations/crawl-for-translations.sh b/scripts/tchap/translations/crawl-for-translations.sh index 8d1a9ccae6..8ba5dd4c25 100755 --- a/scripts/tchap/translations/crawl-for-translations.sh +++ b/scripts/tchap/translations/crawl-for-translations.sh @@ -52,6 +52,11 @@ merge_json_files $CRAWLED_WEB $CRAWLED_REACT $CRAWLED # Extra hack : config.json is not crawled by matrix-gen-i18n, so the terms_and_conditions_links are missing. Add them in. # Get the terms_and_conditions strings from config.json export TOC_TRANSLATIONS=`realpath modules/tchap-translations/tmp/terms_and_conditions_EN.json` +# Create a config.json if there isn't file +if [[ ! -f config.json ]]; +then + cp config.prod.json config.json +fi jq '.terms_and_conditions_links[] | { (.text): .text} ' config.json | jq -s add > $TOC_TRANSLATIONS merge_json_files $TOC_TRANSLATIONS $CRAWLED $CRAWLED