Commit 52820d62 by Will Daly

Merge pull request #524 from edx/will/more-i18n-automation

More i18n automation
parents a13cc165 6ccb842f
......@@ -9,6 +9,6 @@ before_script:
- "sh -e /etc/init.d/xvfb start"
script:
- "make test"
- "./scripts/i18n.sh eo > /dev/null"
- "python manage.py makemessages -l eo"
after_success:
coveralls
......@@ -78,13 +78,23 @@ To run the JavaScript tests in Chrome so you can use the debugger:
i18n
====
You will need to install `getttext <http://www.gnu.org/software/gettext/>`_.
You will need to:
To extract strings and compile messages:
1. Install `i18n-tools <https://github.com/edx/i18n-tools>`_.
2. Configure Transifex, as described in the `docs <http://docs.transifex.com/developer/client/setup>`_.
3. Install `gettext <http://www.gnu.org/software/gettext/>`_.
To extract strings and push to Transifex
.. code:: bash
./scripts/i18n-push.sh
To pull strings from Transifex
.. code:: bash
./scripts/i18n.sh
./scripts/i18n-pull.sh
License
......
#!/usr/bin/env bash
###################################################################
#
# Pull i18n strings from Transifex.
#
# You will need to configure your Transifex credentials as
# described here:
#
# http://docs.transifex.com/developer/client/setup
#
# Usage:
#
# ./i18n-pull.sh
#
##################################################################
cd `dirname $BASH_SOURCE` && cd ..
echo "Pulling strings from Transifex..."
i18n_tool transifex pull
echo "Validating strings..."
i18n_tool validate
echo "Compiling strings..."
read -p "Compile strings? [y/n] " RESP
if [ "$RESP" = "y" ]; then
python manage.py compilemessages
else
echo "Cancelled"
fi
#!/usr/bin/env bash
###################################################################
#
# Extract i18n strings and push them to Transifex.
#
# You will need to configure your Transifex credentials as
# described here:
#
# http://docs.transifex.com/developer/client/setup
#
# You also need to install gettext:
#
# https://www.gnu.org/software/gettext/
#
# Usage:
#
# ./i18n-push.sh
#
##################################################################
cd `dirname $BASH_SOURCE` && cd ..
echo "Extracting i18n strings..."
python manage.py makemessages --all
python manage.py makemessages --all -d djangojs
echo "Generating dummy strings..."
i18n_tool dummy
read -p "Push strings to transifex? [y/n] " RESP
if [ "$RESP" = "y" ]; then
i18n_tool transifex push
echo " == Pushed strings to Transifex"
else
echo "Cancelled"
fi
#!/usr/bin/env bash
cd `dirname $BASH_SOURCE` && cd ..
if [ -z $1 ]; then LOCALE='--all'; else LOCALE="-l $1"; fi
python manage.py makemessages $LOCALE
python manage.py makemessages $LOCALE -d djangojs
i18n_tool dummy
python manage.py compilemessages $LOCALE
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment