This commit is contained in:
Marco Bonetti 2015-02-10 09:58:29 +01:00
parent 4bf0c04988
commit 81c94d7f95
8 changed files with 57 additions and 115 deletions

2
.gitignore vendored
View file

@ -13,4 +13,4 @@ testproject/htmlcov/
testproject/rosetta.db
testproject/src/
testproject/.coverage
.venv_*
.tox

View file

@ -10,6 +10,8 @@ Version 0.7.5
* Use content_type instead of mimetype in HttpResponse. (Issue #115, thanks @vesteinn)
* Don't assume that request.user has settable properties, this was a silly idea anyway (Issue #114, thanks @stevejalim)
* Preserve HTML code when receiving translations from the Yandex translation service (Issue #116, thanks @marcbelmont)
* Use TOX for testing
* Test against Django 1.8a
Version 0.7.4

View file

@ -42,6 +42,11 @@ To install Rosetta:
Testing:
``pip install tox && tox``
Note: you can use whatever you wish as the URL prefix.
To uninstall Rosetta, simply comment out or remove the ``'rosetta'`` line in your ``INSTALLED_APPS``

View file

@ -1,2 +1 @@
from .tests import *
from microsofttranslator.test import *

View file

@ -1,113 +0,0 @@
#!/bin/bash
if [ ! -d .venv_14 ]
then
virtualenv --no-site-packages --distribute --python=python2.7 .venv_14
. .venv_14/bin/activate
pip install --use-mirrors Django==1.4 coverage python-memcached six requests==2.1.0 polib==1.0.4 microsofttranslator==0.5
deactivate
fi
if [ ! -d .venv_15 ]
then
virtualenv --no-site-packages --distribute --python=python2.7 .venv_15
. .venv_15/bin/activate
pip install --use-mirrors Django==1.5 coverage python-memcached six requests==2.1.0 polib==1.0.4 microsofttranslator==0.5
deactivate
fi
if [ ! -d .venv_15_p3 ]
then
virtualenv --no-site-packages --distribute --python=python3 .venv_15_p3
. .venv_15_p3/bin/activate
pip install --use-mirrors Django==1.5 coverage python3-memcached six requests==2.1.0 polib==1.0.4 microsofttranslator==0.5
deactivate
fi
if [ ! -d .venv_16 ]
then
virtualenv --no-site-packages --distribute --python=python2.7 .venv_16
. .venv_16/bin/activate
pip install --use-mirrors coverage python-memcached six Django==1.6.1 requests==2.1.0 polib==1.0.4 microsofttranslator==0.5
deactivate
fi
if [ ! -d .venv_16_p3 ]
then
virtualenv --no-site-packages --distribute --python=python3 .venv_16_p3
. .venv_16_p3/bin/activate
pip install --use-mirrors coverage python3-memcached six Django==1.6.1 requests==2.1.0 polib==1.0.4 microsofttranslator==0.5
deactivate
fi
if [ ! -d .venv_17 ]
then
virtualenv --no-site-packages --distribute --python=python2.7 .venv_17
. .venv_17/bin/activate
pip install Django==1.7
pip install --use-mirrors coverage python-memcached six requests==2.1.0 polib==1.0.4 microsofttranslator==0.5
deactivate
fi
if [ ! -d .venv_17_p3 ]
then
virtualenv --no-site-packages --distribute --python=python3 .venv_17_p3
. .venv_17_p3/bin/activate
pip install Django==1.7
pip install --use-mirrors coverage python3-memcached six requests==2.1.0 polib==1.0.4 microsofttranslator==0.5
deactivate
fi
. .venv_14/bin/activate
cd testproject
python manage.py --version
python --version
python manage.py test rosetta
cd ..
deactivate
. .venv_15/bin/activate
cd testproject
python manage.py --version
python --version
python manage.py test rosetta
cd ..
deactivate
. .venv_15_p3/bin/activate
cd testproject
python manage.py --version
python --version
python manage.py test rosetta
cd ..
deactivate
. .venv_16/bin/activate
cd testproject
python manage.py --version
python --version
python manage.py test rosetta
cd ..
deactivate
. .venv_16_p3/bin/activate
cd testproject
python manage.py --version
python --version
python manage.py test rosetta
cd ..
deactivate
. .venv_17/bin/activate
cd testproject
python manage.py --version
python --version
python manage.py test rosetta
cd ..
deactivate
. .venv_17_p3/bin/activate
cd testproject
python manage.py --version
python --version
python manage.py test rosetta
cd ..
deactivate
# Check translations
for d in `find rosetta -name LC_MESSAGES -type d`; do msgfmt -c -o $d/django.mo $d/django.po; done

49
tox.ini Normal file
View file

@ -0,0 +1,49 @@
[tox]
envlist =
{py26,py27}-django14,
{py26,py27,py34}-django{15,16},
{py27,py34}-django{17,18alpha},
gettext
skipsdist = True
[testenv]
changedir = testproject
commands =
python manage.py test rosetta
setenv =
PYTHONDONTWRITEBYTECODE=1
deps =
django14: Django==1.4.19
django15: Django==1.5.12
django16: Django==1.6.10
django17: Django==1.7.4
django18alpha: https://www.djangoproject.com/download/1.8a1/tarball/
{py26,py27}-django{14,15,16,17,18alpha}: python-memcached
py34-django{14,15,16,17,18alpha}: python3-memcached
requests
polib>=1.0.6
microsofttranslator==0.5
six
[testenv:gettext]
changedir = rosetta/locale/
whitelist_externals =
msgfmt
commands =
msgfmt -c -o cs/LC_MESSAGES/django.mo cs/LC_MESSAGES/django.po
msgfmt -c -o de/LC_MESSAGES/django.mo de/LC_MESSAGES/django.po
msgfmt -c -o es/LC_MESSAGES/django.mo es/LC_MESSAGES/django.po
msgfmt -c -o fa/LC_MESSAGES/django.mo fa/LC_MESSAGES/django.po
msgfmt -c -o fr/LC_MESSAGES/django.mo fr/LC_MESSAGES/django.po
msgfmt -c -o hu/LC_MESSAGES/django.mo hu/LC_MESSAGES/django.po
msgfmt -c -o it/LC_MESSAGES/django.mo it/LC_MESSAGES/django.po
msgfmt -c -o nl/LC_MESSAGES/django.mo nl/LC_MESSAGES/django.po
msgfmt -c -o pl/LC_MESSAGES/django.mo pl/LC_MESSAGES/django.po
msgfmt -c -o ru/LC_MESSAGES/django.mo ru/LC_MESSAGES/django.po
msgfmt -c -o tr/LC_MESSAGES/django.mo tr/LC_MESSAGES/django.po
msgfmt -c -o uk/LC_MESSAGES/django.mo uk/LC_MESSAGES/django.po