Problem/Motivation
The t() documentation says:
When possible, use the \Drupal\Core\StringTranslation\StringTranslationTrait $this->t()
The documentation for the Drupal\Core\Render\Element is using $this->t in an inconsistent way.
There are places where t() is used. In other places $this->t() is used.
Also there are are some strings that should be translatable and they are not wrapped into t().
Proposed resolution
Replace all the t() with $this->t() in the Drupal\Core\Render\Element.
Remaining tasks
User interface changes
None
API changes
None
Data model changes
None
Comments
Comment #2
dagmarHere is the patch.
Comment #3
jhodgdonThanks! I think this patch is a good idea.
It needs an update though -- in several places, you did
instead of
In other words, the "t" in the t() method call got left out by mistake. Whoops!
I found several places where this occurred, but other than that the patch looks great:
missing t
same here, missing t
missing t
both of these are missing the t
more missing t
missing t
Comment #4
dagmarSorry! I did a bad search & replace. Here is the new patch.
Comment #5
jhodgdonLooks good, thanks!
Comment #6
alexpottCommitted 72cca02 and pushed to 8.1.x and 8.2.x. Thanks!
I committed this to 8.1.x as well because it is a docs fix only.