stephenmcd / django-forms-builder

Let users build forms in Django admin
BSD 2-Clause "Simplified" License
691 stars 281 forks source link

Multilanguage support #214

Closed jedie closed 6 years ago

jedie commented 6 years ago

I start a 'proof-of-concept' for multilanguage support.

As i described in #179 , the idea is:

  1. create a form in default language (settings.LANGUAGE_CODE)
  2. create a translation for all lables in one of the languages from (settings.LANGUAGES)
  3. render the form will used the translation, if available or fallback to default language

This worked yet for me. But it needs some love and tests. I'm waiting for feedback how this pull request can be accepted and merged ;)

jedie commented 6 years ago

Some notes:

I expand the example project:

I add the "translation" links into Form change view (/en/admin/forms/form/) here:


bildschirmfoto zu 2018-01-24 16-35-09


The Admin translation view looks like this (in this case in german):


grafik


Notes on this view:

And here i send the form in English:


grafik


and now the same in German:


grafik


And the entries:


grafik


Maybe it makes sense to save the language used for send the form, too?!?

jedie commented 6 years ago

ping

stephenmcd commented 6 years ago

This is already implemented in https://github.com/stephenmcd/mezzanine/tree/master/mezzanine/forms - the implementation here should mimic that.