Closed (fixed)
Project:
Translation template extractor
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
18 Mar 2009 at 17:24 UTC
Updated:
16 Apr 2009 at 11:00 UTC
I get a warning every time I create a translation template for my module:
"The first two watchdog() parameters should be literal strings. There should be no variables, concatenation, constants or even a t() call there. At watchdog('path_redirect',format_plural($count,'Removed 1 inactive redirect from the database.','Removed @count inactive redirects from the database.')) in path_redirect.module on line 142. Read more at http://drupal.org/node/323101"
Core uses this with actions_synchronize(). How should I be using format_plural with watchdog? Or should we fix this warning in potx?
Comments
Comment #1
gábor hojtsyUnfortunately watchdog() does not allow for any callback to use but t(). The warning can say that you should try to rework your text to work with t() without requiring any other heavy lifting. Core abuses the API just as it does at some other places with calling t() on dynamic data (where it could not tell whether it comes from code or users). Drupal 7 could fix this by implementing a callback specification mechanism similar to menu title callbacks and arguments.
Comment #2
gábor hojtsyNo feedback, so closing.