-
-
Save tobiasmcnulty/732e014bc140be504efd1afb81e217b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -ex | |
tx push -s -r dashboard-djangoproject-com.main | |
tx push -s -r django-docs.website-strings | |
# loop through all the languages that currently have translations | |
for LANG in af sq fr pt_BR sr pl uk tr ru ja it; do | |
PO_FILE="locale/$LANG/LC_MESSAGES/django.po" | |
PO_DIR="$(dirname $PO_FILE)" | |
# fetch the translation from the original / main project in Transifex | |
tx pull -f -l $LANG -r djangoproject-dot-com.main | |
for APP in dashboard docs; do | |
# copy the original translation into $APP | |
mkdir -p $APP/$PO_DIR | |
cp $PO_FILE $APP/$PO_FILE | |
cd $APP | |
# use Django's makemessages to filter out the strings from other apps | |
# (they will all be commented out with #~ at the end of the file) | |
django-admin.py makemessages -l $LANG --no-location | |
cd - | |
done | |
for RESOURCE in dashboard-djangoproject-com.main django-docs.website-strings; do | |
# push up the filtered translation file | |
tx push -t -l $LANG -r $RESOURCE | |
# pull back the clean one (with the #~ lines removed) for inspection | |
tx pull -f -l $LANG -r $RESOURCE | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment