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.
There may be an alternate API for injected translations based on how #2018411: Figure out a nice DX when working with injected translation figures this out. Should support that too.
Comment | File | Size | Author |
---|---|---|---|
#7 | potx-d8_t.patch | 1.2 KB | herom |
Comments
Comment #1
Gábor HojtsyComment #2
Gábor Hojtsy#2018411: Figure out a nice DX when working with injected translation is not yet decided, so I don't think we can do anything here yet.
Comment #3
Gábor Hojtsy#2018411-34: Figure out a nice DX when working with injected translation says it is settled on $this->t(), that is what should be supported. This is an alter-ego of t() from the POV of potx. Any $this->t() should be parsed as t().
Comment #4
herom CreditAttribution: herom commentedI guess this was never an issue. Because from the point of view of tokens, the "t" in $this->t is no different from just calling "t"; they are bost T_STRING.
I have confirmed this by checking for some strings manually.
Comment #5
Gábor HojtsyWow, it just works? Wow!
Comment #6
Gábor HojtsyCan we add test coverage to prove/ensure it works? :)
Comment #7
herom CreditAttribution: herom commentedsomething like this?
Comment #8
Gábor HojtsyYay, committed that to 6.x-3.x. Needs to be ported to 7. Thanks a lot!
Comment #9
YesCT CreditAttribution: YesCT commentedMaybe a tiny related.
Comment #12
SebCorbin CreditAttribution: SebCorbin commentedPorted to 7.x-3.x as it has been branched directly from 6.x-3.x