blob: 85c4b39f5ebd41f40ca51eb87483b302ed8b9c39 [file] [log] [blame]
avm999639f77d0d2020-12-28 22:16:12 +01001#!/bin/bash
2emptyTranslationFile="{}"
3
4# Download new translations
5if [ ! -f "crowdin.yml" ]; then
6 echo "Copy crowdin.template.yml to crowdin.yml and fill in the API token."
7fi
8
9crowdin download -c crowdin.yml
10
11cd ../../src/_locales
12
avm99963ac2dc4a2021-01-10 20:01:35 +010013# Delete empty translations
avm999639f77d0d2020-12-28 22:16:12 +010014for lang in *; do
avm99963ac2dc4a2021-01-10 20:01:35 +010015 if [[ "$lang" == "README.md" ]]; then
16 continue
17 fi
avm999639f77d0d2020-12-28 22:16:12 +010018 if [ "x$emptyTranslationFile" = "x$(cat $lang/messages.json)" ]; then
19 echo "$lang has an empty translation. Deleting folder..."
20 rm -rf $lang
avm99963ac2dc4a2021-01-10 20:01:35 +010021 else
22 git add $lang/messages.json
avm999639f77d0d2020-12-28 22:16:12 +010023 fi
24done
avm99963ac2dc4a2021-01-10 20:01:35 +010025
26# Commit new translations
27git commit -m "Updating i18n files from Crowdin"