diff options
| author | Tobias McNulty <tobias@caktusgroup.com> | 2019-03-11 20:33:23 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-11 20:33:23 -0400 |
| commit | 68ecaee55c0e07f1b48bb681cbb249a9b50eab2f (patch) | |
| tree | bfe4d96f4a3f974533d99e6ed6da20b7709cb401 /update-translations.sh | |
| parent | 0a6cf5cc7e1d8a0a6b5634ade5524ccc5b1f2da6 (diff) | |
Reorganized locale directories and added Transifex config for managing the translation process (#866)
Diffstat (limited to 'update-translations.sh')
| -rwxr-xr-x | update-translations.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/update-translations.sh b/update-translations.sh new file mode 100755 index 00000000..cdb65ba6 --- /dev/null +++ b/update-translations.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +# Update translations from Transifex for the supported languages, and remove +# the source location references (to help keep the diff noise down). Adapted from: +# https://github.com/django/django-docs-translations/blob/stable/2.1.x/manage_translations.py + +set -ex + +LANGUAGES="fr" + +LOCALE_DIRS="dashboard/locale/ docs/locale/ locale/" + +for LANG in $LANGUAGES; do + tx pull -f -l $LANG --minimum-perc=70 + for DIR in $LOCALE_DIRS; do + PO_FILE="$DIR$LANG/LC_MESSAGES/django.po" + if [ -f "$PO_FILE" ]; then + msgcat --no-location -o $PO_FILE $PO_FILE + fi + done +done |
