Problem/Motivation

When editors delete paragraphs they sometimes inadvertently also delete translations that they did not intend to delete. Thus a need was identified to ensure that users are informed if translations are available for any given paragraph as a reminder.

Proposed resolution

The proposed solution is to add a warning icon to each paragraph input that has existing translations with text that is displayed when the user hovers over it. This will look similar to the edit warning icon currently available but the warning text will differ to state "There is a translation on this paragraph.".

Remaining tasks

The code has been updated and a patch will follow shortly, thus all that remains is for the patch to be reviewed and tested.

User interface changes

An additional warning icon will be displayed when editing page content for all paragraphs that have translations.

Issue fork paragraphs-3370126

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

roaldnel created an issue. See original summary.

roaldnel’s picture

The patch to implement this change is attached.

Please use the latest patch below, this one can safely be ignored.

roaldnel’s picture

I have created an updated patch. A new translation icon was added to the icons library and the message text and icon was updated. The latest patch is attached.

Esther Tempel was the developer that laid the groundwork for this patch before I started working on it - https://www.drupal.org/u/esthertempel.

esthertempel’s picture

Thank you @roaldnel for your work on this patch. This is really helpful!

esthertempel’s picture

Updated the patch for compatibility with paragraphs 1.20 and included a minor fix for detecting translations. Tested this patch on Drupal 11.3.3 with paragraphs 1.20

yashaswi18 made their first commit to this issue’s fork.

yashaswi18’s picture

Applied the above patch and created an MR for easier review.

While reviewing the code changes and checking the behavior locally, I can see that the translation icon is displayed and the message appears on hover, which helps indicate the impact of deletion.

I had a small question regarding the behavior - since this currently shows only an informational message on hover, should there also be an additional warning or confirmation when removing such paragraphs?

Thank you for your work on this!