mozilla/fxoss — pull request #8 by mlavin (2014-01-29 22:06:45+00:00)
Title: CMS Model Translation

Fixes #2.

This is the simplest thing that could possibly work for translating the CMS content. There are still some kinks to work out here but I wanted to get some review started before I got too far out. This adds translation support for the `Page`, `RichTextPage`, `Link`, `Field` and `Form` models built into Mezzanine. Right now it is setup for two languages: English and French. Tested it out locally and it works to show either the English or French version of the page based on the `Accept-Language` header via the `LocaleMiddleware`.

But here are the problems. django-modeltranslation stores the translations in the same table as the model itself. This is very fast but it means that new fields need to be added to the Mezzanine tables. There is a management command `sync_translation_fields` to add them but it's not the easiest workflow. In particular it means adding a new language adds a new column per column to be translated. In the case of the form `Field` model that means 5 more columns per language.

This becomes more of a problem for the Admin forms. Right now it shows all of the languages together in the form. That there is a `title_en` and `title_fr` field one on top of the other. Additional languages make this form even longer. The current `Field` inline barely fits with just two language and adding a third will make this form unusable. The Admin has a built-in language switcher so it might be possible to only show the fields for the selected language. While this would make the form easier to use in some ways it would make it harder to know which languages haven't been completed. It would also make it hard to compare the text in the two languages. It just depends on what the content authors/translators need or want to input this content.