mirror of
https://github.com/Hopiu/django-rosetta.git
synced 2026-04-24 15:04:45 +00:00
Merge branch 'develop' into pr/117
This commit is contained in:
commit
5b881382c2
11 changed files with 118 additions and 145 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -13,4 +13,4 @@ testproject/htmlcov/
|
|||
testproject/rosetta.db
|
||||
testproject/src/
|
||||
testproject/.coverage
|
||||
.venv_*
|
||||
.tox
|
||||
|
|
|
|||
20
.travis.yml
Normal file
20
.travis.yml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
language: python
|
||||
services: memcached
|
||||
python: 2.7
|
||||
env:
|
||||
- TOX_ENV=py26-django14
|
||||
- TOX_ENV=py27-django14
|
||||
- TOX_ENV=py26-django15
|
||||
- TOX_ENV=py27-django15
|
||||
- TOX_ENV=py34-django15
|
||||
- TOX_ENV=py26-django16
|
||||
- TOX_ENV=py27-django16
|
||||
- TOX_ENV=py34-django16
|
||||
- TOX_ENV=py27-django17
|
||||
- TOX_ENV=py34-django17
|
||||
- TOX_ENV=py27-django18alpha
|
||||
- TOX_ENV=py34-django18alpha
|
||||
install:
|
||||
- pip install tox
|
||||
script:
|
||||
- tox -e $TOX_ENV
|
||||
2
CHANGES
2
CHANGES
|
|
@ -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
|
||||
|
|
|
|||
13
README.rst
13
README.rst
|
|
@ -2,6 +2,10 @@
|
|||
Rosetta
|
||||
=======
|
||||
|
||||
.. image:: https://travis-ci.org/mbi/django-rosetta.png?branch=develop
|
||||
:target: http://travis-ci.org/mbi/django-rosetta
|
||||
|
||||
|
||||
Rosetta is a `Django <http://www.djangoproject.com/>`_ application that eases the translation process of your Django projects.
|
||||
|
||||
Because it doesn't export any models, Rosetta doesn't create any tables in your project's database. Rosetta can be installed and uninstalled by simply adding and removing a single entry in your project's `INSTALLED_APPS` and a single line in your main ``urls.py`` file.
|
||||
|
|
@ -40,12 +44,17 @@ To install Rosetta:
|
|||
url(r'^rosetta/', include('rosetta.urls')),
|
||||
)
|
||||
|
||||
|
||||
|
||||
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``
|
||||
|
||||
*******
|
||||
Testing
|
||||
*******
|
||||
|
||||
``pip install tox && tox``
|
||||
|
||||
|
||||
*************
|
||||
Configuration
|
||||
*************
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -2,22 +2,21 @@
|
|||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Rosetta\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-02-28 13:36+0100\n"
|
||||
"PO-Revision-Date: 2008-09-12 12:16\n"
|
||||
"Last-Translator: <tomasz@napierala.org>\n"
|
||||
"PO-Revision-Date: 2014-12-10 17:26+0124\n"
|
||||
"Last-Translator: Anonymous User <arrviasto@gmail.com>\n"
|
||||
"Language-Team: pl <LL@li.org>\n"
|
||||
"Language: pl\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Translated-Using: django-rosetta 0.4.RC2\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
|
||||
"|| n%100>=20) ? 1 : 2);\n"
|
||||
"Language: pl\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
||||
"X-Translated-Using: django-rosetta 0.7.4\n"
|
||||
|
||||
#: templates/rosetta/languages.html:5 templates/rosetta/languages.html.py:8
|
||||
msgid "Language selection"
|
||||
|
|
@ -30,30 +29,35 @@ msgstr "Początek"
|
|||
#: templates/rosetta/languages.html:9
|
||||
msgid ""
|
||||
"Couldn't load the specified language file. This usually happens when using "
|
||||
"the Encrypted Cookies Session Storage backend on Django 1.4 or higher.<br/"
|
||||
">Setting ROSETTA_STORAGE_CLASS = 'rosetta.storage.CacheRosettaStorage' in "
|
||||
"your settings file should fix this."
|
||||
"the Encrypted Cookies Session Storage backend on Django 1.4 or "
|
||||
"higher.<br/>Setting ROSETTA_STORAGE_CLASS = "
|
||||
"'rosetta.storage.CacheRosettaStorage' in your settings file should fix this."
|
||||
msgstr ""
|
||||
"Nie można załadować żądanego pliku. Zwykle spowodowane jest to użyciem "
|
||||
"szyfrowanego magazynu ciastek sesji (Encrypted Cookies Session Storage) na "
|
||||
"Django 1.4 lub nowszym.<br/>Ustawienie ROSETTA_STORAGE_CLASS = "
|
||||
"'rosetta.storage.CacheRosettaStorage' w pliku ustawień (settings.py) powinno"
|
||||
" rozwiązać problem."
|
||||
|
||||
#: templates/rosetta/languages.html:15
|
||||
msgid "Filter"
|
||||
msgstr ""
|
||||
msgstr "Filtr"
|
||||
|
||||
#: templates/rosetta/languages.html:16
|
||||
msgid "Project"
|
||||
msgstr ""
|
||||
msgstr "Projekt"
|
||||
|
||||
#: templates/rosetta/languages.html:17
|
||||
msgid "Third party"
|
||||
msgstr ""
|
||||
msgstr "Aplikacje zewnętrzne"
|
||||
|
||||
#: templates/rosetta/languages.html:19 templates/rosetta/pofile.html:39
|
||||
msgid "All"
|
||||
msgstr ""
|
||||
msgstr "Wszystko"
|
||||
|
||||
#: templates/rosetta/languages.html:32
|
||||
msgid "Application"
|
||||
msgstr ""
|
||||
msgstr "Aplikacja"
|
||||
|
||||
#: templates/rosetta/languages.html:33
|
||||
msgid "Progress"
|
||||
|
|
@ -69,7 +73,7 @@ msgstr "Przetłumaczone"
|
|||
|
||||
#: templates/rosetta/languages.html:36 templates/rosetta/pofile.html:61
|
||||
msgid "Fuzzy"
|
||||
msgstr ""
|
||||
msgstr "Niejednoznaczne (fuzzy)"
|
||||
|
||||
#: templates/rosetta/languages.html:37
|
||||
msgid "Obsolete"
|
||||
|
|
@ -88,15 +92,16 @@ msgid ""
|
|||
"You haven't specified any languages in your settings file, or haven't yet "
|
||||
"generated a batch of translation catalogs."
|
||||
msgstr ""
|
||||
"Nie podałeś żadnych języków w plikach ustawień, lub nie wygenerowałeś "
|
||||
"jeszcze katalogów do tłumaczeń."
|
||||
"Nie podałeś żadnych języków w plikach ustawień lub nie wygenerowałeś jeszcze"
|
||||
" katalogów do tłumaczeń."
|
||||
|
||||
# python-format
|
||||
#: templates/rosetta/languages.html:63
|
||||
#, python-format
|
||||
msgid ""
|
||||
"Please refer to <a href=\"%(i18n_doc_link)s\">Django's I18N documentation</"
|
||||
"a> for a guide on how to set up internationalization for your project."
|
||||
"Please refer to <a href=\"%(i18n_doc_link)s\">Django's I18N "
|
||||
"documentation</a> for a guide on how to set up internationalization for your"
|
||||
" project."
|
||||
msgstr ""
|
||||
"Sprawdź pomoc dotyczącą <a href=\"%(i18n_doc_link)s\">internacjonalizacji "
|
||||
"Django I18N </a>, aby znaleźć dokumentację na temat internacjonalizacji "
|
||||
|
|
@ -111,19 +116,21 @@ msgid "Download this catalog"
|
|||
msgstr "Pobierz ten katalog"
|
||||
|
||||
#: templates/rosetta/pofile.html:25
|
||||
#, fuzzy, python-format
|
||||
#, python-format
|
||||
msgid "Progress: %(percent_translated)s%%"
|
||||
msgstr "Postęp: %(percent_translated)s %"
|
||||
msgstr "Postęp: %(percent_translated)s%%"
|
||||
|
||||
#: templates/rosetta/pofile.html:27
|
||||
msgid "File is read-only: download the file when done editing!"
|
||||
msgstr "Plik jest tylko do odczytu: pobierz go kiedy skończysz edytować"
|
||||
msgstr "Plik jest tylko do odczytu: pobierz go, kiedy skończysz edytować"
|
||||
|
||||
#: templates/rosetta/pofile.html:28
|
||||
msgid ""
|
||||
"Some items in your last translation block couldn't be saved: this usually "
|
||||
"happens when the catalog file changes on disk after you last loaded it."
|
||||
msgstr ""
|
||||
"Niektóre elementy z twojego tłumaczenia nie zostały zapisane. Zwykle oznacza"
|
||||
" to, że plik katalogowy zmienił się od ostatniego załadowania."
|
||||
|
||||
#: templates/rosetta/pofile.html:32
|
||||
#, python-format
|
||||
|
|
@ -144,7 +151,7 @@ msgstr "Tylko przetłumaczone"
|
|||
|
||||
#: templates/rosetta/pofile.html:38
|
||||
msgid "Fuzzy only"
|
||||
msgstr ""
|
||||
msgstr "Tylko niejednoznaczne (fuzzy)"
|
||||
|
||||
#: templates/rosetta/pofile.html:46
|
||||
msgid "Search"
|
||||
|
|
@ -156,7 +163,7 @@ msgstr "Idź"
|
|||
|
||||
#: templates/rosetta/pofile.html:58
|
||||
msgid "Original"
|
||||
msgstr ""
|
||||
msgstr "Oryginał"
|
||||
|
||||
#: templates/rosetta/pofile.html:62
|
||||
msgid "Occurrences(s)"
|
||||
|
|
@ -165,7 +172,7 @@ msgstr "Wystąpienie(a)"
|
|||
#: templates/rosetta/pofile.html:76 templates/rosetta/pofile.html.py:79
|
||||
#: templates/rosetta/pofile.html:94 templates/rosetta/pofile.html.py:97
|
||||
msgid "Context hint"
|
||||
msgstr ""
|
||||
msgstr "Kontekst"
|
||||
|
||||
#: templates/rosetta/pofile.html:104
|
||||
msgid "suggest"
|
||||
|
|
@ -196,7 +203,7 @@ msgstr "Wyświetlanie:"
|
|||
msgid "%(hits)s/%(message_number)s message"
|
||||
msgid_plural "%(hits)s/%(message_number)s messages"
|
||||
msgstr[0] "%(hits)s/%(message_number)s komunikat"
|
||||
msgstr[1] "%(hits)s/%(message_number)s komunikatów"
|
||||
msgstr[1] "%(hits)s/%(message_number)s komunikaty"
|
||||
msgstr[2] "%(hits)s/%(message_number)s komunikatów"
|
||||
|
||||
#~ msgid "English"
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class CacheRosettaStorage(BaseRosettaStorage):
|
|||
|
||||
# Make sure we're not using DummyCache
|
||||
if 'dummycache' in settings.CACHES[rosetta_settings.ROSETTA_CACHE_NAME]['BACKEND'].lower():
|
||||
raise ImproperlyConfigured("You can't use the CacheRosettaStorage if your cache isn't correctly set up (you are use the DummyCache cache backend).")
|
||||
raise ImproperlyConfigured("You can't use the CacheRosettaStorage if your cache isn't correctly set up (you are using the DummyCache cache backend).")
|
||||
|
||||
# Make sure the actually actually works
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -1,2 +1 @@
|
|||
from .tests import *
|
||||
from microsofttranslator.test import *
|
||||
|
|
|
|||
|
|
@ -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
49
tox.ini
Normal 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
|
||||
Loading…
Reference in a new issue