Problem/Motivation

I have a site with 4 (+ main English) languages and all needed configuration setup. I want to be able to translate a piece of content to all 4 languages at once.
I go to "Automatic translate" on a node and select all 4 languages. That node has a few regular fields and a few paragraph fields. The regular fields work fine and get correctly translated to all languages. Paragraph fields, however, do not. In my specific example fields get translated in German and French fine, while Spanish and Croatian just remain with the old English values.

When I go one by one, translations work as expected.

Steps to reproduce

Trigger auto translate for more than 1 language at a time and some paragraph text fields will probably remain in the original language instead of being translated.

Proposed resolution

I've tried and tested a bunch of things but couldn't figure out where the problem is. The values actually do get translated correctly but the paragraph entity just does not save for some reason.

Comments

abaudoin created an issue. See original summary.

abaudoin’s picture

StatusFileSize
new1.66 KB

After additional research I came up with a patch that seems to work in my particular situation, but to be honest I'm not quite sure why exactly and where the error lies. Still needs review. Patch attached. <- Patch was on old 2.1.7 version. Adding new patched from 2.1.8, sorry about that.

abaudoin’s picture

abaudoin’s picture

StatusFileSize
new431 bytes
abaudoin’s picture

StatusFileSize
new637 bytes

Last patch (orphaned-paragraphs-09012024.patch) is only if you've already had some paragraphs that were created before the issue was patched. In that case the untranslated paragraphs were always displayed because they actually have a translation but it just isn't displayed on the node. The patch omits the check if the paragraph has a translations, and just translates is again, overriding it.

Edit: this patch made single translations on paragraph not display, added hopefully a last fix for that.

abaudoin’s picture

abaudoin’s picture

StatusFileSize
new1015 bytes
kallado’s picture

Sorry we've been very busy will change the status and review wenever possible.

kallado’s picture

Status: Active » Needs review
jmauricio’s picture

@abaudoin

If you translate the node manually do the paragraphs translate?

Have you made this configuration?
https://www.drupal.org/docs/contributed-modules/paragraphs/multilingual-...

willibautista’s picture

I have the same problem, but I have noticed that the translation of the content and paragraphs is effectively executed only in the first language selected; for the other languages, the paragraphs are not translated.

abaudoin’s picture

@jmauricio

Yeah, the configuration is correct, paragraph translations work except in the scenario I've written in the opening ticket.

jmauricio’s picture

Status: Needs review » Needs work

Working on it

jmauricio’s picture

Status: Needs work » Needs review
StatusFileSize
new9.4 KB

@abaudoin @WilliBautista can you please test this patch. I think it solves this problem.

abaudoin’s picture

Hey @jmauricio, thanks for the patch. I'll test it a bit tomorrow.

abaudoin’s picture

Patch #14 works in all cases except when a piece of content was affected with the bug before.

Example: I don't have the patch applied yet. I translate an article in German, French and Spanish and get the bug in question - Spanish not translated. I apply the patch, try to retranslate all languages again - Spanish remains unchanged and in original language. I try to retranslate only Spanish - it works.

For newly created content patch works as expected.

jmauricio’s picture

Status: Needs review » Reviewed & tested by the community

Yes, it it because the code was creating a new paragraph instead of translating it in those cases, don't really know how to fix that, maybe just delete the translations and run the auto translation again.

I'll commit the patch, run some more tests and release a new version.

Thanks

  • jmauricio committed f3c6cda8 on 1.0.x
    Issue #3412616 by abaudoin, jmauricio, kallado, WilliBautista: Paragraph...
jmauricio’s picture

Status: Reviewed & tested by the community » Fixed

Released on 2.1.9

jmauricio’s picture

Status: Fixed » Closed (fixed)