How to reproduce:
- creates a new node with paragraphs
- add node traslation
= Button "Add paragraph" removed

problem node translation

Comments

BOESbo created an issue. See original summary.

miro_dietiker’s picture

Category: Bug report » Support request
Status: Active » Fixed

This is by design.

A translation can only have the very same paragraphs (but translated) like the host entity has.
If you want to add a new paragraph, add it by editing the host entity in the source language.

boesbo’s picture

but you can remove them from the translation, this makes no sense because then you can not add them. I think it is a core function

I add: If you add a paragraph to the original node that is not added in the translation so you have to recreate the node again, is a serious limitation (then it does not work what you suggested)

thz for support

boesbo’s picture

Status: Fixed » Active
miro_dietiker’s picture

Status: Active » Fixed

For both cases you mention, we have issues pending.

One fixes button consistency that makes sure the remove and add buttons are shown consistently and dropped when translating.
#2698239: Multilingual workflow bugs

The other is about supporting a translatable entity reference revision field that allows totally different paragraphs per translation. In most cases you don't want this, but people are asking for it. #2461695: Support asymmetric translations

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

lluisandreu’s picture

Hi there,

Is this issue fixed? I can't add or remove paragraphs on translations using latest dev version.

pyxio’s picture

i am having the same issue. if i add a paragraph on the host entity it does not appear on the translated instance of the same page and there are no buttons available to manually add it. however,as long as i add the paragraph BEFORE generating the language instance it works.

pyxio’s picture

so i figured this out. it is necessary to ensure the "Users may translate this field" box is NOT ticked for the paragraph reference field on the host entity.

jatinkumar1989’s picture

Hi @drupalstrap , i have same issue, can you please explain a bit more.

sorry i am nit undrstanding your comment.

Kind regards
-Jatin

pyxio’s picture

@mail2jatingarg - go to fields for the entity and for that specific paragraphs field that is a reference you need to uncheck the box translate this field.

miro_dietiker’s picture

Checkout the related issue. We decided that we hide all "shared" / "structure" operations (that affect all languages) during translation.

If you don't like this direction, there's an issue to make it configurable.

jatinkumar1989’s picture

Hi,

@drupalstrap, i done that alraedy , but no luck..
still hving the same issue. "add more" option is coming on default language "EN", but not on other language like "fr" etc.

dont know what is the issue for me here.

Thanks
-Jatin

Andrain’s picture

#10 Works.

BUT: If you already translated some of the paragraphs, it will replace them with untranslated paragraphs.

How do you fix that? We have about 5000 nodes with already translated paragraphs and if you untick the box on the host entity now, the bug is solved but all these paragraphs are untranslated.

nimoatwoodway’s picture

#10 Works for me too but with same problem as described in #15.

natemow’s picture

In addition to #10, also be sure that the "Hide non translatable fields on translation forms" option is NOT checked on the host entity.

scb’s picture

Would it be possible to keep the add/remove paragraph buttons in the translation, but working exactly like the ones in the source entity (they would add/remove the paragraph in both source and translation)? I agree in most cases we don't need asymmetric paragraphs, but it would be more user friendly being able to add/remove them from both the source and the translation.

cyber555’s picture

Hi!
I need same that in the #18 of scb. Does the patch exists to return back to the form buttons for adding paragraphs on the translated form? Help, please!
It is impossible to explain to user, that addition paragraphs are only on another language form. I don't understand why non-translatable field can't be visible as all other non-translatable fields :-(

cyber555’s picture

StatusFileSize
new894 bytes

If anybody want to open buttons to add paragraphs in translation mode, use my patch (in attach). It seems to be working ok...

vindesh’s picture

Showing new paragraphs on specific languages only
What if they want to add a paragraph in the original language and it should only display in that language, not in the other languages?
It should be possible to display paragraphs only in the original language?

Anyone have any idea to resolve this problem.

Above patch is working but there are some limitation , if i add paragraph on specific language then paragraph will add successfully for that language but it also add blank paragraph for others languages. I don't know why it is happed.
if anyone have any solution please let me know.

bennof’s picture

Same as #18. We have some projects where sometimes the english version of content comes first, sometimes the german. So this is nasty...

To allow both delete and add, you could do two changes (version 8.x-1.12, remove both && !$this->isTranslating statements, 2nd as mentioned #20):

--- a/web/modules/contrib/paragraphs/src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php
+++ b/web/modules/contrib/paragraphs/src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php
@@ -403,7 +403,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
         // Avoid checking delete access for new entities.
        $delete_access = $paragraphs_entity->isNew() || $paragraphs_entity->access('delete');
         // Hide the button when translating.
-        $button_access = $delete_access && !$this->isTranslating;
+        $button_access = $delete_access;
         if ($item_mode != 'remove') {
          $links['remove_button'] = [
            '#type' => 'submit',
@@ -933,7 +933,7 @@ public function formMultipleElements(FieldItemListInterface $items, array &$form
     
    $host = $items->getEntity();
    $this->initIsTranslating($form_state, $host);
 
-    if (($this->realItemCount < $cardinality || $cardinality == FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED) && !$form_state->isProgrammed() && !$this->isTranslating) {
+    if (($this->realItemCount < $cardinality || $cardinality == FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED) && !$form_state->isProgrammed()) {
      $elements['add_more'] = $this->buildAddActions();
    }

Or directly set '#access' => $delete_access, on line 418 and remove lines 402 & 403.

NOTE:
The problem of this is, that future paragraphs added to a node are not propagated to the translation of that node. This breaks, you have to care about all content in any translation manually.
The effect is probably similar to activating translation on the parent field (the paragraph reference field in a node), which is not advised!

=> So it's better to force the editors to fill in the original language first, if possible.

thirstysix’s picture

yogesh kambari’s picture

I am submitting the following patch to address a specific project requirement.