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.
I just noticed that it is impossible to translate the status texts when filtering nodes in the admin section. The texts were never incorporated into the translation templates (even for 5.x and before!) because the string was passed to t()
as a variable. See the screenshot (note the untranslated text on an otherwise 100% translated Drupal).
This can also be backported to 5.
Comment | File | Size | Author |
---|---|---|---|
#5 | node-filter-translation_1.patch | 1.35 KB | Freso |
#2 | node-filter-translation_0.patch | 1.39 KB | kkaefer |
#1 | node-filter.translation.png | 16.56 KB | kkaefer |
node-filter-translation.patch | 1.39 KB | kkaefer | |
Comments
Comment #1
kkaefer CreditAttribution: kkaefer commentedComment #2
kkaefer CreditAttribution: kkaefer commentedDuh, I should actually syntax-check before posting...
Comment #3
Freso CreditAttribution: Freso commentedJust curious, but is there a reason to move from
foo ? bar : baz
toif foo {bar} else {baz}
? Thet()
should easily be able to go into the former test, but I don't know if there is any performance or anything to be gained either way, so, really, I'm simply curious. :)Also, again, I'll probably test this in the morrow.
Comment #4
kkaefer CreditAttribution: kkaefer commentedWe have shorter and more readable lines. I am not aware of any performance penalties.
Comment #5
Freso CreditAttribution: Freso commentedRe-rolled to attached patch and fixed problems with parentheses. (Btw, would
if (!empty($i++))
be faster thanif ($i++ > 0)
? See Guidelines for better performing code.)I'm apparently having some issues with locale.module though, right now, so further testing of the patch will have to wait a wee bit.
Comment #6
kkaefer CreditAttribution: kkaefer commentedThanks for rerolling. I doubt that
empty()
is faster because$i++ > 0
is a very basic integer comparison.Comment #7
Freso CreditAttribution: Freso commentedUsing a patched potx-cli.php from kkaefer, I did the following:
Having previously tested the patch for b0rkage, I think it does what it says it does, without any glitches that I can see, and probably without affecting performance. Can't see why it shouldn't be RTBC.
Comment #8
Gábor HojtsyOh, I noticed this was not translated properly on some sites, but never thought that it is actually not translatable... Hm, good catch. Also lamented on the patch a bit, thinking about moving the t()s back to a ternary assignment. But it would not save much code for us, so committed this if() based version, which is a bit more clear. Thanks!
Setting for porting to 5.x. (Because a new 5.x release might hit the shelfs soon, it might be a good idea to roll this backport sooner then later).
Comment #9
kkaefer CreditAttribution: kkaefer commentedThe patch from #2 is code-wise identical with the committed patch and applies to Drupal 5 with an offset of 569 lines.
Comment #10
drummCommitted to 5.x.
Comment #11
(not verified) CreditAttribution: commented