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'),
]);
Issue fork datetimehideseconds-3220991
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
geek-merlinLGTM!
https://www.drupal.org/docs/develop/git/using-git-to-contribute-to-drupa...
;-)
Comment #3
mably commented@geek-merlin do you want me to implement the suggested fix?
Comment #4
geek-merlin@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.
Comment #5
mably commentedOriginal widget string is defined here, excerpt below:
So OP's suggestion is ok, but it will still require a translation because of the format.
Or do you prefer that we totally remove the format part?
Comment #7
mably commentedComment #8
geek-merlinThanks 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.