Files
mattermost-mobile/scripts/precommit/i18n.sh
Elisabeth Kulzer 8b8cd1ab4d Add check for empty translation source strings (#5044)
* Update sha

* Update check-deps cache

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-01-04 16:05:10 +01:00

16 lines
592 B
Bash
Executable File

#!/usr/bin/env bash
mkdir -p tmp
cp assets/base/i18n/en.json tmp/en.json
mkdir -p tmp/fake-webapp-dir/i18n/
echo '{}' > tmp/fake-webapp-dir/i18n/en.json
npm run mmjstool -- i18n extract-mobile --webapp-dir tmp/fake-webapp-dir --mobile-dir .
diff tmp/en.json assets/base/i18n/en.json
# Address weblate behavior which does not remove whole translation item when translation string is set to empty
npm run mmjstool -- i18n clean-empty --webapp-dir tmp/fake-webapp-dir --mobile-dir . --check
npm run mmjstool -- i18n check-empty-src --webapp-dir tmp/fake-webapp-dir --mobile-dir .
rm -rf tmp