Closed (outdated)
Project:
Pathauto
Version:
7.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
19 Mar 2008 at 16:02 UTC
Updated:
7 Feb 2026 at 10:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
aufumy commented+1
re-rolled the patch against latest cvs head.
Comment #2
aufumy commentedComment #3
gregglesThat patch is fine for 5.x but not for 6.x. Can you create one for 6.x as well/first?
Comment #4
aufumy commentedHi Greggles
Here is a patch for 6.x
Thanks
Audrey
Comment #5
aufumy commentedComment #6
Freso commentedThis won't do:
watchdog('pathauto', $update_msg);.watchdog()should be fed the "raw", untranslated string and then handle the translation when displaying the message in the logs. I'm not sure how to handle plurals withinwatchdog()though, so this might have to be looked into.Also, I'd vote for waiting with committing this for 6.x-2.x.
Comment #7
gregglesThat was my concern as well about this being non-trivial for the new watchdog system.
And, yes, let's postpone this to 6.x-2.x.
Comment #8
aufumy commentedre-worked with the new watchdog system.
Comment #9
Freso commentedComment #10
Freso commentedis a clear regression of the current code, where "one/@count alias(es)" was a part of the string. First of all, it's splitting one string into two strings, meaning that translators will have to translate some of it out of context. I could easily imagine how "alias" may have to be put differently, depending on what it's an alias of. This would not be possible with the previous patch. Second, it's handing a variable to
t()instead of a string.I'm still not sure how to handle plurals within the watchdog system though, but the way the patch currently does it, is not the way.
Comment #11
gábor hojtsyThe Drupal 6 watchdog system does not allow other callbacks but t() with watchdog. This might mean that you need to reformulate your text, like 'Bulk generation of index aliases completed (%aliases)' or 'Bulk generation of index aliases completed: %aliases' (I'd prefer the first) and then make %aliases the 'one alias' and '@count aliases'. Thus this breaks the sentence flow, so should be easier to translate.
Drupal 7 should allow arbitrary translation callbacks, such as the Drupal 6 menu system does. We unfortunately did not end up there in Drupal 6, so there are some dirty tricks to be used with plurals in Drupal 6 watchdog.
Comment #12
aufumy commentedReworked the patch with suggestion 1 from Gabor.
The idea to break out the strings, was inspired from core modules, for example user.module:
Comment #13
Freso commentedAh well. I bow before Gábor's knowledge of the t() system, though I think it's an ugly hack, but if there's no elegant way of doing it for 6.x... *sigh*
Anyway, there's still a small issue with the patch: most of the
$update_msg's (all except one, actually) aren't rounded off by a full stop ("."). I believe they should be, unless there's a reason (e.g., a convention for watchdog messages that I'm not aware of) that the messages shouldn't be treated with proper English grammar. And even if so, the first instance shouldn't have it then. Consistency is King (or something).Comment #14
aufumy commentedOkay, patch includes full stops.
Comment #15
Freso commentedFor some reason, I missed this in my last comment. Sorry to keep you tossing patch versions about. :/ If you don't get around to it first, I'll fix the patch myself when I get around to test, but... the
$update_msginstances really ought to be replaced with the string itself, as a PO/T extractor won't know what to work with, if it's given a variable instead of a string.Comment #16
aufumy commentedWhile a little annoying, it is actually quite helpful for me, as I learn things I would not otherwise know about.
Also, it is a pleasure to work with module maintainers who are on top of the issue queue.
Comment #17
Freso commentedI think Greg will testify that I'm one of the Drupal devs who pick on the most nits (but really, I'm just trying aspiring to reach the level of Morbus, chx, et al). Greg has been hit by my nit-picking quite a few times by now. Both before and after he decided to make me a co-maintainer. :p
Anyway, the code looks good now. I can't find anything else to pick on off-hand, but I'd like to comment on the loveliness of
drupal_set_message(t(andwatchdog('pathauto',aligning perfectly. It's beautiful. :DAnd just as I was about to send this off, I noticed an an "
alias" which should probably read "$alias". (pathauto_taxonomy.inc, 2nd hunk) ;)Comment #18
aufumy commentedokay here it is...
Comment #19
aufumy commentedDiffed against current DRUPAL-6--1 branch.
Comment #20
gregglesAny chance you could update this for 7.x-1.x-dev?
I'm sorry this took so long, but if we change strings we should do it in 7.x-1.x.
Comment #21
dave reidTagging all the bulk alias issues for #713238: RFC: Pathauto Bulk module.
Comment #22
dave reidComment #23
mably commented