There are several models in my design where I need to store certain fields in different languages. Has this been done before? I saw some Django modules that help with model translations, but some of them don't work properly.
Any best practices out there? Below is my code.
My model
class Lookup_I18n(models.Model):
i18n_code = models.CharField(max_length=5, default=settings.LANGUAGE_CODE)
value = models.CharField(max_length=300)
class Lookup(models.Model):
purpose = models.CharField(max_length=10)
key = models.CharField(max_length=10)
value_i18n = models.ForeignKey(Lookup_I18n)
value = models.Field()
class Meta:
unique_together = (('purpose', 'key'),)
source
share