Title translation

Created on 27 June 2021, about 4 years ago
Updated 30 October 2024, 8 months ago

I suggest changing the text of the translation string from:

$element['time']['#attributes']['title'] = t('Enter a valid time - e.g. @format', [
    '@format' => (new \DateTime())->format('h:i'),
]);

to:

$element['time']['#attributes']['title'] = t('Time (e.g. @format)', [
    '@format' => (new \DateTime())->format('h:i'),
]);
Feature request
Status

Active

Version

1.1

Component

User interface

Created by

🇨🇿Czech Republic hop

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇫🇷France mably

    @geek-merlin do you want me to implement the suggested fix?

  • 🇩🇪Germany geek-merlin Freiburg, Germany

    @mably: Please look what the string is in the original widget, and use the same one (apart from the format). That way, no re-translation is necessary.

  • 🇫🇷France mably

    Original widget string is defined here.

          // Adds the HTML5 attributes.
          $extra_attributes = [
            'type' => $element['#date_time_element'],
            'step' => $element['#date_increment'],
          ];
          $element['time'] = [
            '#type' => 'date',
            '#title' => t('Time'),
            '#title_display' => 'invisible',
            '#value' => $time_value,
            '#attributes' => $element['#attributes'] + $extra_attributes,
            '#required' => $element['#required'],
            '#size' => 12,
            '#error_no_message' => TRUE,
          ];
    

    So OP's suggestion is ok.

  • 🇩🇪Germany geek-merlin Freiburg, Germany

    Thanks for the research! Since #2, where i was open to this, i learnt a lot about translations.
    Setting to wontfix for reasons:
    - A t() string should be hard to mis-contextualize, because translators on localize.drupal.org do not see the UI.
    - String changes should only be made if absolutely necessary, as they invalidate existing community translations.
    - Anyone can translate the string as they like, even to english.

Production build 0.71.5 2024