Casing of translatable string incorrectly hard coded

Created on 19 June 2025, about 2 months ago

Problem/Motivation

 public function getTitle(?Request $request = NULL) {
    // Take custom 'config_translation_plugin_id' plugin definition key to
    // retrieve title. We need to retrieve a runtime title (as opposed to
    // storing the title on the plugin definition for the link) because
    // it contains translated parts that we need in the runtime language.
    $type_name = mb_strtolower($this->mapperManager()->createInstance($this->pluginDefinition['config_translation_plugin_id'])->getTypeLabel());
    return $this->t('Translate @type_name', ['@type_name' => $type_name]);
  } 

Steps to reproduce

Proposed resolution

Remove string to lower function used incorrectly

Remaining tasks

Write patch

User interface changes

Correct casing of translated string e.g. in German and all other languages

Introduced terminology

None

API changes

None

Data model changes

None

Release notes snippet

🐛 Bug report
Status

Active

Version

11.2 🔥

Component

config_translation.module

Created by

🇩🇪Germany marc.bau

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

Merge Requests

Comments & Activities

  • Issue created by @marc.bau
  • 🇮🇳India annmarysruthy

    annmarysruthy changed the visibility of the branch 3531117-casing-of-translatable to hidden.

  • 🇮🇳India annmarysruthy

    annmarysruthy changed the visibility of the branch 3531117-casing-of-translatable to active.

  • 🇮🇳India annmarysruthy

    annmarysruthy changed the visibility of the branch 3531117-casing-of-translatable to hidden.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 877s
    #527000
  • Pipeline finished with Failed
    about 1 month ago
    Total: 750s
    #527100
  • Pipeline finished with Failed
    about 1 month ago
    Total: 493s
    #527133
  • Pipeline finished with Failed
    about 1 month ago
    Total: 583s
    #527219
  • Pipeline finished with Success
    about 1 month ago
    Total: 470s
    #527227
  • 🇩🇪Germany marc.bau

    Looks nice codewise. Thanks for the patch!

  • 🇬🇧United Kingdom longwave UK

    While the strtolower is incorrect, the test strings look incorrect in English now, with the capitalisation mid sentence - e.g. "Translate Taxonomy vocabulary" or "Translate Contact form"

    Entities have singular labels available for this sort of thing, shouldn't we be using label_singular here instead?

    #[ConfigEntityType(
      id: 'taxonomy_vocabulary',
      label: new TranslatableMarkup('Taxonomy vocabulary'),
      label_collection: new TranslatableMarkup('Taxonomy'),
      label_singular: new TranslatableMarkup('vocabulary'),
      label_plural: new TranslatableMarkup('vocabularies'),
    

    with the button text "Translate vocabulary"

    #[ConfigEntityType(
      id: 'contact_form',
      label: new TranslatableMarkup('Contact form'),
      label_collection: new TranslatableMarkup('Contact forms'),
      label_singular: new TranslatableMarkup('contact form'),
      label_plural: new TranslatableMarkup('contact forms'),
    

    with the button text "Translate contact form"

    #[ConfigEntityType(
      id: 'view',
      label: new TranslatableMarkup('View', ['context' => 'View entity type']),
      label_collection: new TranslatableMarkup('Views', ['context' => 'View entity type']),
      label_singular: new TranslatableMarkup('view', ['context' => 'View entity type']),
      label_plural: new TranslatableMarkup('views', ['context' => 'View entity type']),
    

    with the button text "Translate view", etc.

  • 🇺🇸United States smustgrave

    Seems like something definitely should be looked at. Agree "Translate Taxonomy vocabulary" seems wrong.

  • 🇳🇿New Zealand quietone

    In Drupal core changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies . Also mentioned on the version section of the list of issue fields documentation. Thanks.

  • 🇩🇪Germany joachim namyslo Kulmbach 🇩🇪 🇪🇺

    It's good to know, that this is a bigger issue. We where looking for the root cause multiple years, so if we came across a solution that solve this uppercase/lowercase issue in all affected places, that would be very great.

Production build 0.71.5 2024