Rosetta is a Django 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.
Rosetta requires Django 1.4 or newer. When running with Django 1.5, Python 3.x is supported.
To install Rosetta:
pip install django-rosetta
Add 'rosetta' to the INSTALLED_APPS in your project's settings.py
Add an URL entry to your project's urls.py, for example:
from django.conf import settings if 'rosetta' in settings.INSTALLED_APPS: urlpatterns += patterns('', 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
Rosetta can be configured via the following parameters, to be defined in your project settings file:
To prevent re-reading and parsing the PO file catalogs over and over again, Rosetta stores them in a volatile location. This can be either the HTTP session or the Django cache.
Django 1.4 has introduced a signed cookie session backend, which stores the whole content of the session in an encrypted cookie. Unfortunately this doesn't work with large PO files, as the limit of 4096 chars that can be stored in a cookie are easily exceeded.
In this case the Cache-based backend should be used (by setting ROSETTA_STORAGE_CLASS = 'rosetta.storage.CacheRosettaStorage'). Please make sure that a proper CACHES backend is configured in your Django settings if your Django app is being served in a multi-process environment, or the different server processes, serving subsequent requests, won't find the storage data left by previous requests.
Alternatively you can switch back to using the Session based storage by setting ROSETTA_STORAGE_CLASS = 'rosetta.storage.SessionRosettaStorage in your settings. This is perfectly safe on Django 1.3. On Django 1.4 or higher make sure you have DON'T use the signed_cookies SESSION_BACKEND with this Rosetta storage backend or funky things might happen.
TL;DR: if you run Django with gunincorn, mod-wsgi or other multi-process environment, the Django-default CACHES LocMemCache backend won't suffice: use memcache instead, or you will run into issues.
Because Rosetta requires write access to some of the files in your Django project, access to the application is restricted to the administrator user only (as defined in your project's Admin interface)
If you wish to grant editing access to other users:
See Django's documentation on Internationalization to setup your project to use i18n and create the gettext catalog files.
Start your Django development server and point your browser to the URL prefix you have chosen during the installation process. You will get to the file selection window.
Select a file and translate each untranslated message. Whenever a new batch of messages is processed, Rosetta updates the corresponding django.po file and regenerates the corresponding mo file.
This means your project's labels will be translated right away, unfortunately you'll still have to restart the webserver for the changes to take effect. (NEW: if your webserver supports it, you can force auto-reloading of the translated catalog whenever a change was saved. See the note regarding the ROSETTA_WSGI_AUTO_RELOAD variable in conf/settings.py.
If the webserver doesn't have write access on the catalog files (as shown in the screen shot below) an archive of the catalog files can be downloaded.
By default Rosetta hides its own catalog files in the file selection interface (shown above.) If you would like to translate Rosetta to your own language:
|File||Type||Python Version||Uploaded On||Downloads|
|django-rosetta-0.7.4.zip||Source||Feb. 28, 2014||4,220|
|django-rosetta-0.7.4.tar.gz||Source||Feb. 28, 2014||37,465|
|0.7.4||Feb. 28, 2014|
|0.7.3||Dec. 26, 2013|
|0.7.2||May 6, 2013|
|0.7.1||March 1, 2013|
|0.7.0||March 1, 2013|
|0.6.8||June 7, 2012|
|0.6.6||March 27, 2012|
|0.6.5||Jan. 28, 2012|
|0.6.3||Jan. 5, 2012|
|0.6.2||June 16, 2011|
|0.6.1||Nov. 4, 2014|
|0.6.0||Nov. 4, 2014|
|Nov. 4, 2014, 1:44 p.m.||django-rosetta||0.6.1||Release Created|
|Nov. 4, 2014, 1:44 p.m.||django-rosetta||0.6.6||Release Created|
|Nov. 4, 2014, 1:44 p.m.||django-rosetta||0.6.5||Release Created|
|Nov. 4, 2014, 1:44 p.m.||django-rosetta||0.7.1||Release Created|
|Nov. 4, 2014, 1:44 p.m.||django-rosetta||0.7.0||Release Created|
|Nov. 4, 2014, 1:44 p.m.||django-rosetta||0.7.3||Release Created|
|Nov. 4, 2014, 1:44 p.m.||django-rosetta||0.7.2||Release Created|
|Nov. 4, 2014, 1:44 p.m.||django-rosetta||0.6.0||Release Created|
|Nov. 4, 2014, 1:44 p.m.||django-rosetta||0.7.4||Release Created|
|Nov. 4, 2014, 1:44 p.m.||django-rosetta||0.6.2||Release Created|
|Nov. 4, 2014, 1:44 p.m.||django-rosetta||0.6.3||Release Created|
|Nov. 4, 2014, 1:44 p.m.||django-rosetta||0.6.8||Release Created|
|Nov. 4, 2014, 1:44 p.m.||django-rosetta||Package Created|