Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Strings in configuration synchronization page cannot be translated as a t() function is missing.
Comment | File | Size | Author |
---|---|---|---|
#19 | drupal_core-missing-t-function_2659914_18.patch | 1.09 KB | c-c-m |
#4 | drupal_core-missing-t-function_2659914_3.patch | 1.06 KB | c-c-m |
Comments
Comment #2
c-c-m CreditAttribution: c-c-m commentedPatch provided.
Comment #4
c-c-m CreditAttribution: c-c-m commentedProviding new patch, as the previous one had an error.
Comment #5
c-c-m CreditAttribution: c-c-m commentedProviding new patch, as the previous one had an error.
Comment #6
c-c-m CreditAttribution: c-c-m commentedComment #7
c-c-m CreditAttribution: c-c-m commentedComment #8
rodrigoaguileraIs better to use the t function that is injected in the object $this->t() the same way is used in the line 191.
I'm not sure if this change can be in 8.0.x since the strings are frozen.
Comment #9
c-c-m CreditAttribution: c-c-m commentedComment #10
swentel CreditAttribution: swentel commentedHa, nice find. Should indeed use $this->t().
Since it's not a string change, it's probably fine for 8.0.x as well.
Comment #11
c-c-m CreditAttribution: c-c-m commentedThank you very much for your review @rodrigoaguilera. Could you please elaborate more on why should I do what you say? Apparently I did the same as line 189, but you know way more than me, so I am open to learn ;)
As per the other part of your answer: do you mean I should work with 8.1.x branch instead?
Comment #12
rodrigoaguileraYou can search about hlthe benefits of dependency injection.
Here is an intro.
http://blog.openlucius.com/en/blog/dependency-injection-drupal-8-introdu...
By calling t you are assuming there is a t function somewhere and might not be case in a test environment.
Comment #13
c-c-m CreditAttribution: c-c-m commentedProvided patch with $this->t() as requested by @rodrigoaguilera and @swentel
Hope to have understood fine.
If so, I am assuming I should also patch aforementioned line 189 in another issue.
Comment #14
c-c-m CreditAttribution: c-c-m commentedComment #16
c-c-m CreditAttribution: c-c-m as a volunteer commentedSubmitting right patch
Comment #18
swentel CreditAttribution: swentel commentedYou have todo something like this: array($this->t('Name'), $this->t('Operations')),
Comment #19
c-c-m CreditAttribution: c-c-m as a volunteer commentedProvided patch with swentel's instructions. Thank you very much!
Comment #20
rodrigoaguileraNow it looks OK
Comment #22
catchCommitted/pushed to 8.1.x, thanks!