Multilanguage Form Display

Component ID

2922533

Component name

Multilanguage Form Display

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Downloads

77

Component created

Component changed

Component body

Purpose - Side-by-side editing!

This module will attempt to make your multi-language editing experience a bit easier. By enabling this module and following its simple steps, it will display on one entity form (i.e.: Node Edit form) all the translatable fields available for that content type. It will perform all appropriate validation and submission according to Drupal Best Practices.

How it works

By hooking into a node entity and modifying the edit form with all viable translatable fields, the module inserts all the selected language fields into the form according to the placement of the Multilingual Form Display Field. You have a few settings to play with for visibility and Quality of Life stuff (i.e.: user experience / user interface).

The module should play nicely with Display Suite and Panels since we've done nothing out of the ordinary here.

History

The original module was called the Dual Language Editor (DLE). It was made for Drupal 7 and had a lot of workarounds to try and solve a problem a few of us had trouble resolving.

Several years later, with the introduction of Drupal 8 and the Object Oriented nature of the Symfony framework it leverages, we can now better leverage the various APIs and drastically reduce the lines of code from the previous version of the module.

Dependencies from core

  • content_translation
  • language

How To Use

The module is quite simple at the moment.

  1. Install and Enable the module
  2. Ensure you've got your dependencies enabled
  3. Make sure you've got at least two languages on your site
  4. From the Content Language admin page (admin/config/regional/content-language),
    select the content types and their fields which will be translatable
  5. From your entity page or content types admin page (admin/structure/types), choose to manage fields
  6. Add the Multilingual Form Display field (no settings right now)
  7. In the Manage Form Display page, choose where in the form you would like the translatable fields to be displayed
  8. The formatter does nothing at present

That should be it for now. You'll now see, as in the image attached to this module, all your Translatable fields for all languages other than the default one you are visiting the site with.

Note

This module works really nicely with a multi-column layout. You can activate these by using the field_layout module and picking a layout for the form. Then, by placing the default fields in one column and the multilingual form display in a second column, you get a nice side-by-side editing experience.

So far, this has been tested with under 10 languages at a time with content types that have a small number of fields which are translatable (less than five). Loading several more languages and multiplying the number of fields which are translatable by that will cause the form to have a very large number of fields to render. So be careful not to overload your browser. Especially if any of the fields are using some sort of Text Editor like CKEditor or TinyMCE. Those will greatly impact the UX of the form. We are aware of this and will be addressing it as we move forward. For the time being, please take note that performance can be affected by excessive abuse of field placement in a form.

** Active Development **

Please be aware, this project is under active development and will be changing frequently. Once, it has stabilized, it will be made available in the normal course of releases.

Roadmap

  • Add widget settings
  • Add formatter settings
  • Add layout settings
  • Add node rendering settings
  • Add permissions
  • When using more than one MFD field, have one of the field be the "language swapping"
    field
  • Add yaml configuration file
  • Add test scripts

Wishlist

  • Add field formatter template file
  • Add Drupal 7 version
  • Add AJAX / Lazy loading of languages
  • Add hot-swappable language loading on form (with auto-saving)