Easier field translation with django-transmeta

Follow me for more content or contact for work opportunities:
Twitter / LinkedIn

django-transmeta is a new project that provides django field translations in a simpler way than existing ones like django-multilingual and transdb.

The basis of that simplicity is creating a field in the database table for every translation, so internally we'll have something like:

CREATE TABLE app_model (     [...]     myfield_en varchar,     myfield_ca varchar,     [...] );

where "en" and "ca" are the languages in our application (English and Catalan in this case).

For the developer, translating a model is as simple as adding a metaclass to the model, and specify the fields to translate in its Meta class:

from transmeta import TransMeta

class MyModel(models.Model):     __metaclass__ = TransMeta

    name = models.CharField(max_length=64)     description = models.TextField()     price = models.FloatField()

    class Meta:         translate = ('name', 'description', )

Even with this project is still as tricky as transdb and multilingual, its main goal is being really really simple, for its design, for developers, and its code (that mainly it's about 120 lines of code). It also breaks some limitations of transdb (its most simple predecessor IMHO) like translating non-text fields.

I also want to mention that I just discovered a new project for translating model fields, named django-modeltranslation, that looks cool, but I don't like the (admin like) registering way to set translatable fields (too much complicated).

Follow me for more content or contact for work opportunities:
Twitter / LinkedIn