8

I am developing a new project from scratch with Django. I see that there are many apps for handling translation of dynamic content.

  • Django-multilingual
  • Django-pluggable-model-i18n
  • Django-modeltranslation
  • Transdb
  • Django-multilingual-model-
  • Django-transmeta

to name few.

Transdb, transmeta and multilingual sounded fair, but I want to read some personal experiences.

Which one of them should I choose?

2
  • 1
    With no actual requirements, the answer is "roll a die." There are six choices. Six faces on a die. Roll and go. If you don't like the dice answer, then you'll have to either think about requirements or think about reasons why you wouldn't like one of the choices if it was picked for you by an outsider.
    – S.Lott
    Commented Aug 20, 2010 at 15:16
  • With no actual requirements, the answer remains "roll a die."
    – S.Lott
    Commented Aug 20, 2010 at 19:26

4 Answers 4

5

I agree with S.Lott in that you will want to think about what you need from internationalization. However, this is a very good run-down of all of the mentioned packages:

http://blog.muhuk.com/2010/01/06/dynamic-translation-apps-for-django.htm

My personal pick thus far is "none of the above". I am currently prototyping with datatrans:

http://github.com/citylive/django-datatrans

http://www.botondus.com/dynamic-translation-with-django-datatrans/

But I may yet choose another solution.

3

There are 2 kinds of model translation:

  1. Adding extra columns/fields to the model to translate
  2. Using a second table for translations

The 1st approach is more efficient because you don't use extra joins. And the 2nd one is less intrusive because it doesn't modify the original model table. I personally like the 1st option better and that's one of the main reasons why I use django-modeltranslation.

You can also have a look to this comparison grid.

2

Django-nani is a brand-new application, which is fast, and well-written using probably the best design approach.

It's still in development but works well and has a very complete documentation.

This is a snippet to see how the multilingual models are defined:

from django.db import models
from nani.models import TranslatableModel, TranslatedFields


class DjangoApplication(TranslatableModel):
    name = models.CharField(max_length=255, unique=True)
    author = models.CharField(max_length=255)

    translations = TranslatedFields(
        description = models.TextField(),
        description_author = models.CharField(max_length=255),
    )

    def __unicode__(self):
        return self.name
0

I'm using the django i18n for a bilingual project: I'm really really satisfied of this one and I definitely would recommend it, but I've got to say that I've never tried one of the others...

2
  • It's not an elegant method to use with dynamic content.
    – yigit
    Commented Aug 20, 2010 at 16:03
  • 3
    First of all you need some kind of a hack to add the translatable content in database to .po files. Then you need to provide an interface for the content generators to edit and compile that files. Lastly, you need to restart to your application to make changes effect, which can be abusable if your operators have this privilege. Django's built-in i18n support is only great for static text.
    – yigit
    Commented Aug 20, 2010 at 17:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.