[development] t() function concept/bug/patch proposal

Alan Dixon alan.g.dixon at gmail.com
Thu Sep 7 18:27:13 UTC 2006


there have been enough recent posts referring to the t() function that
I'd like to draw attention to my previous bug report/patch again:

http://drupal.org/node/74181

In summary - the current concept of t() is officially that it only
supports fixed, module defined strings, not 'user-defined' (which
means anything else, e.g., a title, a taxonomy term, etc.). In
particular, when given an empty string as an argument, it wastes an
expensive sql lookup (and really bombs if those are in an init
function before the db caching is started).

Nevertheless, I see a number of recent posts that are using t() for
lookups of arbitrary user strings, a kind of hopeful translation
mechanism, instead of the rigorous one originally intended for it. I'd
like to propose an official change to the concept of the t() function
that it accepts any arguments, including dynamically generated ones,
since that seems to be the common usage, and in that light accept the
simple patch proposed above, all in the name of simple performance for
a wide range of sites/modules.




-- 
Alan Dixon, Web Developer
http://alan.g.dixon.googlepages.com/


More information about the development mailing list