What's new? | Help | Directory | Sign in
Google
django-rosetta
A Django application that eases the translation process of your Django projects
  
  
  
  
    
Show all Featured Downloads:
rosetta-0.3.1.tar.gz
Join project
Project owners:
  mbonetti

Rosetta

About

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.

Features

Installation

To install Rosetta:

  1. Download the application and place the rosetta folder anywhere in your Python path (your project directory is fine, but anywhere else in your python path will do)
  2. Add a 'rosetta' line to the INSTALLED_APPS in your project's settings.py
  3. Add an URL entry to your project's urls.py, for example:
  4. url(r'^rosetta-i18n/',include('rosetta.urls')),  

Note: you can use whatever you wish as the URL prefix.

To uninstall Rosetta:

  1. Comment out or remove the 'rosetta' line in your INSTALLED_APPS
  2. Comment out or remove the url inclusion

Security

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:

  1. create a 'translators' group in your admin interface
  2. add the user you wish to grant translating rights to this group

Usage

Generate a batch of files to translate

See Django's documentation on Internationalization to setup your project to use i18n and create the gettext catalog files.

Translate away!

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.

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.

Acknowledgments