Generic label of default flag causes problems for translated sites

Created on 10 January 2024, 6 months ago
Updated 12 January 2024, 5 months ago

Problem/Motivation

The default configuration causes translations to be overwritten.

I had a very puzzling experience after installing this module and trying to customize the labeling of the flags, partially because I was completely unaware of a feature of Drupal core. It boiled the problem down to this:

This module comes with a few default flag configurations, one of which has as its label "Content". I wanted to change this to something like "Subscribe to content", but my site is configured to show the Dutch language, so all content gets saved as Dutch, wherever it is translatable. "Subscribe to content" is "Abonneren op inhoud" in Dutch. After applying this change, "Abonneren op inhoud" would show up everywhere it would normally say "Inhoud", which as you've probably guessed, is the translation for "Content",

Someone more familiar with the Drupal config translation may already be guessing where this is going, but I was completely unaware of this mechanism until now. Apparently, when you are changing a translatable string in a config item that is derived from a default content item (from a module's config/install directory), the locale module will load that default content, pull the translatable strings out, and assume that whatever you are supplying now is an update to the *interface translation* of that string.

Steps to reproduce

  • Have a site with at least one extra language in addition to English
  • Go an configure the content flag created by this module
  • Change the label. Doesn't really matter what, just make sure you are saving the config item in another language than English
  • Notice how the default translation for "Content" is changed

Proposed resolution

Change the labels of the default shipped flags for this module to "Subscribe to content", "Subscribe to terms" and "Subscribe to users".

Remaining tasks

  • Create MR
  • Review
  • Merge

User interface changes

The labels of the default flags will change.

API changes

None.

Data model changes

None.

πŸ’¬ Support request
Status

Closed: duplicate

Version

1.3

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands eelkeblok Netherlands πŸ‡³πŸ‡±

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

Comments & Activities

Production build 0.69.0 2024