Problem/Motivation

If you add and save a configuration translation without modifying anything, the success message indicates the changes were saved, which may be confusing since nothing is actually added. The translation is not added unless you modify something.

Steps to reproduce

  1. Install Drupal
  2. Enable Language and Configuration Translation
  3. Add a language that does not come with configuration translation (e.g. Tuvan)
  4. Go to /admin/structure/menu/manage/main/translate
  5. Click Add for Tuvan
  6. Save without making any changes
  7. Message says 'Successfully saved Tuvan translation.' but the translation is not saved because nothing was changed (he button still says Add)
  8. Click Add again
  9. Make a change and save
  10. Same message but now the translation is saved, and the button shows Edit

Proposed resolution

If the translation is not modified and therefore not added, show a different message:
@language translation was not added. To add a translation, you must modify the configuration.

Remaining tasks

  1. Agree on proposed approach
  2. Write patch with tests
  3. Review

User interface changes

Updated error message

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

Comments

mikemadison’s picture

Note that this behavior is inconsistent with the content translations, where I can add a translated node without changing anything and it simply clones the English text into the "Spanish" version.

The view translation component seems to work the same way as the menu, so depending on what is found / decided here, we may need to dup this issue for Views.

Version: 8.0.0-beta10 » 8.0.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.

Version: 8.0.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Branches prior to 8.8.x are not supported, and Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

pameeela’s picture

Status: Active » Closed (outdated)
Issue tags: -multilingual, -menu translation +Bug Smash Initiative

Given this is quite an old issue and was against an early version of D8, I wasn't surprised to find that I can't reproduce this. It seems to have changed quite a bit in fact, as the 'Add' option no longer appears at all.

If there is still a similar issue please feel free to re-open with updated steps.

pameeela’s picture

Status: Closed (outdated) » Active

Just realised how to reproduce this. Will update steps later.

pameeela’s picture

Title: Translated Menu Items Not Saving When Text Unchanged » Update message that displays when configuration translation is saved without changes
Version: 8.9.x-dev » 9.1.x-dev
Issue summary: View changes
Priority: Normal » Minor
StatusFileSize
new20.69 KB
new21.12 KB

Updated title and IS but bumping this to minor because if you haven't made any changes there is really no risk here. Agree the message could be more clear though.

mohit.bansal623’s picture

Status: Active » Needs review
StatusFileSize
new1.66 KB

Created a patch for this issue, I have updated the message when there is no changes in the configuration while adding.

Status: Needs review » Needs work

The last submitted patch, 7: 2488302-7.patch, failed testing. View results

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

mohit_aghera’s picture

Status: Needs work » Needs review
StatusFileSize
new3.68 KB
new2.02 KB

- Adding simple test cases for the same.
- The failures in the current patch seem a bit unclear to me as they are passing on local.
Note: Tuvan language lablel is throwing cspell errors on local, so I've added language title in local dictionary.

abhijith s’s picture

StatusFileSize
new4.24 MB
new4.2 MB

Applied patch #10 and it worked fine.

Before patch:
before

After patch:
after

RTBC +1

guilhermevp’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new19.96 KB
new13.46 KB

Patch works as intended. Adding image as evidence.

Moving to RTBC.

  • catch committed 284c73e on 9.2.x
    Issue #2488302 by mohit_aghera, mohit.bansal623, mikemadison, pameeela,...

  • catch committed 91e92aa on 9.1.x
    Issue #2488302 by mohit_aghera, mohit.bansal623, mikemadison, pameeela,...
catch’s picture

Version: 9.2.x-dev » 9.1.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 9.2.x and cherry-picked to 9.1.x, thanks!

Status: Fixed » Closed (fixed)

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

erwangel’s picture

Version: 9.1.x-dev » 10.3.x-dev
Component: menu.module » config_translation.module

Sorry to reopen this but I find this wording very confusing: To add a translation, you must modify the configuration. Which configuration ? I had to check all kind of settings/configurations, in structure (content type, content type field), in settings (region and languages, content language and translation, configuration translation), in module settings (I faced this problem while translating meta settings with metatag module) etc., before I realize that I just had to change something in a field of the present form!

So I suggest to change this message to To add a translation, you must modify at least a field on this form.