March 2020
Intermediate to advanced
608 pages
17h 17m
English
The example of Idea will generate a model that is similar to the following:
class Idea(models.Model): title_bg = models.CharField( _("Title (Bulgarian)"), max_length=200, ) title_hr = models.CharField( _("Title (Croatian)"), max_length=200, ) # titles for other languages… title_sv = models.CharField( _("Title (Swedish)"), max_length=200, ) content_bg = MultilingualTextField( _("Content (Bulgarian)"), ) content_hr = MultilingualTextField( _("Content (Croatian)"), ) # content for other languages… content_sv = MultilingualTextField( _("Content (Swedish)"), ) class Meta: verbose_name = _("Idea") verbose_name_plural = _("Ideas") def __str__(self): return self.title
If there were any language codes with a dash, like "de-ch" for ...