mattermost-mobile/scripts/precommit/i18n.sh
Elisabeth Kulzer 4bcb595e5b
Add check for empty translation strings. (#4718)
* Add check for empty translation strings.

* Test

* Update mmjstools

* Resolve conflicts

* Revert translation test.

* Also use fake dir

* Also use fake dir

* Add translation checks to precommit hook. Remove from Makefile. Add to circleci.

* Fix script to keep it consistent.

* Keep consistent
2020-08-29 19:14:17 +02:00

14 lines
493 B
Bash
Executable file

#!/bin/sh
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
rm -rf tmp