Updating language weight from the overview reverts label if translated

Created on 10 August 2023, over 1 year ago
Updated 28 January 2024, 10 months ago

Problem/Motivation

Updating the weight of a language from the overview, either manually or by dragging a language, overwrites the label if it has a translation for the current language.

Steps to reproduce

Start with a fresh installation which has at least two languages (i.e. English & German) enabled.

  • Enable configuration translation
  • Edit label of the 2nd language to its native name (i.e. Deutsch)
  • Add a translation (i.e. 'German' for English)
  • Make sure your current interface language is the same as the translation you've just created (i.e. English)
  • On the language configuration overview admin page, change the weight of the second language either by dragging or selecting
  • Save the new order

Expected behaviour: The language weight is updated, while the label and translation remain the same.
Observed behaviour: The language weight is updated, but the label is reset to what was displayed in the interface and no translation is shown.

While the native label is lost, the translation isn't. It will be restored if the label is set to what it was before.

Proposed resolution

When submitting the language overview form, Drupal should take into account that the label may have been translated and use the native label instead. Or probably better, the form state should contain the original, not the overridden object. So the label doesn't get overwritten on save.

Remaining tasks

  • Confirm issue
  • Decide an approach
  • Implement a fix

User interface changes

-

API changes

Form state may no longer contain the overridden configuration object, but the original.

Data model changes

-

Release notes snippet

🐛 Bug report
Status

Needs work

Version

10.2

Component
Language system 

Last updated 3 days ago

  • Maintained by
  • 🇩🇪Germany @sun
Created by

🇨🇭Switzerland phma Basel, CH

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024