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.
Problem/Motivation
Despite I know what StringTranslationTrait does I can't understand the doxygen.
Proposed resolution
Write a new one.
Remaining tasks
Comment | File | Size | Author |
---|---|---|---|
#20 | 2292197-20.patch | 1.44 KB | LinL |
Comments
Comment #1
chx CreditAttribution: chx commentedBetter -- extractor tools were twice.
Comment #4
cs_shadow CreditAttribution: cs_shadow commentedRe-roll of #1.
Comment #5
jhodgdonThis is great documentation -- very clear and explains why I would want to use this.
A few little things to fix:
a) Not only t() but formatPlural() is added, and using both methods is essential for making sure text is translatable.
b) translateable is misspelled (should be translatable).
c)
How about "... every translatable string, similar to how..." ?
d) Maybe add
at the end to link to the Services and Container topic (since you talk about injecting services)?
e)
Class namespace should start with \
Comment #6
er.pushpinderrana CreditAttribution: er.pushpinderrana commentedIncorporated all #5 suggested points in this patch. Please review.
Comment #7
jhodgdonThanks! Almost there...
Should say "add t() and formatPlural() methods" and "These must be used", since there are now two methods described. And then in the next sentence:
... global functions t() and formatPlural().
Also that first line is too long. Documentation lines should not exceed 80 characters.
Comment #8
er.pushpinderrana CreditAttribution: er.pushpinderrana commented@jhodgdon, please review, did the required changes.
Comment #9
jhodgdon99% there, thanks!
function -> functions
Comment #10
er.pushpinderrana CreditAttribution: er.pushpinderrana commentedChanged function to functions.
Comment #11
jhodgdonLooks good now, thanks!
Comment #12
alexpottformat_plural() - we're talking about the procedural function here.
Comment #13
chx CreditAttribution: chx commentedComment #15
chx CreditAttribution: chx commented@alexpott accidentally committed this in 4b91f16d48490343f0d0c5abf1b915b21788550c with the formatPlural still in place .
Comment #17
alexpottI've reverted 4b91f16d48490343f0d0c5abf1b915b21788550c so that we can get the correct commit history. Patch in #13 is the correct patch to review :)
Comment #18
jhodgdonLooking at the patch in #13:
No, I think the methods added are t() and formatPlural(), right?
and then:
this should say global functions t() and format_plural().
Comment #19
chx CreditAttribution: chx commentedbah, i got it totally backwards, didnt I? If noone else rerolls i will later today
Comment #20
LinL CreditAttribution: LinL commentedComment #21
jhodgdonThanks LinL! This patch looks right to me.
Comment #22
alexpottCommitted aa898f8 and pushed to 8.x. Thanks!