4

How can you set up a translation system in Drupal which displays, for example, the English and the French node edit forms side-by-side? Is this possible using any of the contrib modules?

Additionally, how would I go about setting a requirement that a translation must always be entered when entering English content. Eg, to publish a piece of content, it must have both an English and French translation. Maybe through rules?

  • 1
    Need this too. To bad Drupal ties interface language with content language on edit pages. That one decision makes it pretty hard to force it to display more than one language... My workarounds was: content type with fields for all languages in one node, editable views and custom modules. All of them was bad in some ways. – Mołot May 14 '13 at 10:59
  • Yes, I think I'm going to have to do it that way, but as you say, it's not ideal. Thanks. – Dylan Spencer James May 14 '13 at 14:56
  • 1
    The Local Translator that comes with drupal.org/project/tmgmt provides a side-by-side translation UI which is the answer to your question title but not your actual question I think as you want a side-by-side node edit form. So just posting as a comment. We've built this once with a lot of form altering and custom code for a project, it was ugly :) – Berdir May 14 '13 at 21:22
1

This is very easy to do using Views + Editable Fields + Entity Reference + Panels (Optional).

Side by Side

  1. Forget about the /edit page. Create a new /node/%node/translation page in Page Manager. All the translations will be viewed on the parent's page.
  2. Add an entity reference field to the content type so that non-English nodes can link back to their parent English node. In the screenshot, "Translation Node Spanish" references node 1.
  3. Create two views. English Edit View: Contextual Filter: Provide Default: Content ID.
  4. Spanish Edit View: Content>English Node (Entity Reference field): Provide Default: Content ID.
  5. For both views, add a Content Pane and change the required fields to Editable in their settings. In the screenshot, I just have the body. (Note the two Save buttons). Add the content panes to the /node/%node/translation panel.
  6. If you have lots of languages, each extra view can have a "Content: Language" Contextual Filter as well with a fixed value of es or de etc. All of these views can then be added to the panel. (This is really just for layout reasons).
  7. Create an extra block to list the English nodes by only showing nodes in that content type whose English Node (Entity Reference field) field is empty in the filter settings. Rewrite the field so that the url is node/[nid]/translation and only let content editors see it.

Unless I'm mistaken, this should pretty much deal with the side-by-side thing.. Panels are unnecessary but it was easier for me to demonstrate with them. You can find out how to use Entity Reference elsewhere.

  • Never thought of such approach ... interesting! – Pierre.Vriens Dec 18 '16 at 8:29
  • The never-ending usefulness of Entity References. – Niall Murphy Dec 19 '16 at 1:33
1

There hasn't been a whole lot of public work on this that I can find.

Some module options:

  1. Side-by-Side Translation (no code)
  2. Entity Translation Side-by-side Editor (code, no release)
  3. Dual-Language Editor (code, no release)

liquidcms helped me find that last one.

I'd recommend trying the latter two and seeing how far you get. Post patches for missing functionality as necessary.

Also, see the issue Create Node With Multiple Translations Using Single Form.

0

I have not tried this, but you may be able to do this with Panels and Form Block module. I have not used panels in a while, but I know it has the ability to pick up context or parameters from the node object. If the translated node id not already available, you might need to use entity relation and manually set a reference to the translated node. The field value should be available in the panel.

Only thing I'm really not sure about is if form block can pick up the node id dynamically from the Panel context. If it can, then you might be able to do without modifying any of the modules.

Another caveat, I haven't used the d7 versions of panels or form block. I used these much more in drupal 6, but I remember panels having a lot of power to pick up and reuse these parameters in the different panes.

  • I added my solution with Panels and Editable Fields.. Pretty simple and no code required. – Niall Murphy Aug 8 '16 at 3:21
-2

for D7 there is entity_translation_unified_form it is the best one that I have found https://www.drupal.org/project/entity_translation_unified_form

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.