Caumons
Caumons

Reputation: 9585

Translate Django model fields without having a default language

I'm currently using django-transmeta in order to translate some model fields, but now I have a big problem, as it is too restrictive for me.

In transmeta you define a default language and then you allow the users to add extra translations from a list of translatable languages that you have defined. But what I need now is to allow the user to write the content of the model fields into the language(s) he wants (from a concrete set of languages), without having a default language. So, e.g. if a user is from the USA, he'd fill the English version, while a Spanish user would fill the Spanish version and maybe the English as well. Using transmeta does not allow me to do so, as the default language is always mandatory and, therefore, both would have to fill in the Spanish or English version, which makes no sense for this site.

Googling a little bit I've found two more Django libraries dealing with Model translations callled django-modeltranslation and django-rosetta. Do you know if any of these would allow me to do what I need? Or is there any better option for this?

Thanks!

Upvotes: 1

Views: 1426

Answers (2)

Dirk Eschler
Dirk Eschler

Reputation: 2569

You can do that with django-modeltranslation. If the original field is optional (blank=True, null=True), the translation field(s) created by modeltranslation will be optional, too.

By the way, django-rosetta serves a different need. It adds an interface to translate static content (po files) through the admin interface.

Upvotes: 0

Tomáš Diviš
Tomáš Diviš

Reputation: 1066

django-multilingual-ds9 does not have any limitation of what translations can you have in the database.

Upvotes: 0

Related Questions