Commit 3b2b6d6c by Farhanah Sheets

Added validate_translations logic to makefile, travis, & tox.

Remove previous translations scripts.
parent 8b999964
...@@ -35,6 +35,28 @@ verify-generated-files: ...@@ -35,6 +35,28 @@ verify-generated-files:
@git diff --quiet || (echo 'Modifications exist locally! Run `make javascript` or `make sass` to update bundled files.'; exit 1) @git diff --quiet || (echo 'Modifications exist locally! Run `make javascript` or `make sass` to update bundled files.'; exit 1)
################ ################
#Translations Handling
################
# creates the django-partial.po & django-partial.mo files
extract_translations:
i18n_tool extract -v
# compiles the *.po & *.mo files
compile_translations:
i18n_tool generate -v
# generate dummy translations
generate_dummy_translations:
i18n_tool dummy
# check if translation files are up-to-date
detect_changed_source_translations:
i18n_tool changed
# extract, compile, and check if translation files are up-to-date
validate_translations: extract_translations compile_translations generate_dummy_translations detect_changed_source_translations
################
#Tests and checks #Tests and checks
################ ################
quality: quality:
......
...@@ -74,7 +74,9 @@ dummy_locales: ...@@ -74,7 +74,9 @@ dummy_locales:
# Directories we don't search for strings. # Directories we don't search for strings.
ignore_dirs: ignore_dirs:
- build
- docs - docs
- edx-ora2
- logs - logs
- node_modules - node_modules
- performance - performance
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"repository": "https://github.com/edx/edx-ora2.git", "repository": "https://github.com/edx/edx-ora2.git",
"dependencies": { "dependencies": {
"backbone": "~1.2.3", "backbone": "~1.2.3",
"backgrid ": "~0.3.8", "backgrid": "~0.3.8",
"edx-ui-toolkit": "1.5.3", "edx-ui-toolkit": "1.5.3",
"moment": "^2.15.1", "moment": "^2.15.1",
"moment-timezone": "~0.5.5", "moment-timezone": "~0.5.5",
......
pep8==1.7.0 pep8==1.7.0
git+https://github.com/edx/edx-lint.git@0.5.4#egg=edx_lint==0.5.4 git+https://github.com/edx/edx-lint.git@0.5.4#egg=edx_lint==0.5.4
git+https://github.com/edx/i18n-tools.git@v0.3.9#egg=i18n_tools==0.3.9 git+https://github.com/edx/i18n-tools.git@v0.3.9#egg=i18n_tools==0.3.9
\ No newline at end of file
#!/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 ..
# Note we only extract the English language strings so they can be
# sent to Transifex. All other language strings will be pulled
# down from Transifex and so don't need to be generated.
echo "Extracting i18n strings..."
django-admin.py makemessages --locale=en --ignore="edx-ora2/*" --ignore="build/*" --ignore="node_modules/*"
echo "Extracting client-side i18n strings..."
django-admin.py makemessages --locale=en --ignore="edx-ora2/*" --ignore="build/*" --ignore="node_modules/*" -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
...@@ -32,9 +32,11 @@ whitelist_externals = ...@@ -32,9 +32,11 @@ whitelist_externals =
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
deps = deps =
-rrequirements/base.txt -rrequirements/base.txt
-rrequirements/django.txt
-rrequirements/quality.txt -rrequirements/quality.txt
commands = commands =
npm install jshint --no-save npm install jshint --no-save
npm install jscs --no-save npm install jscs --no-save
make quality make quality
python manage.py makemessages -l eo python manage.py makemessages -l eo
make validate_translations
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