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

Gerhard Killesreiter gerhard at killesreiter.de
Thu Sep 7 20:31:52 UTC 2006

Moshe Weitzman wrote:
>> 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).
> i support that ...

What? I didn't see a proposal. :p

> one way to move this along is to make a patch (it is 
> really simple) and get it reviewed and into the cvs commit queue. then a 
> decision is needed. otherwise, you are seeking a policy change with no 
> effects and that merits little time.

If you only want to exit t() if there is no argument, you have my ok, 
even if I think that this case shouldn't happen.

If you want to use t() for user supplied strings, then not. t() has 
already not the best performance. Drupal comes with 1200 strings 
nowadays. All strings below 75 characters are stored in the locale 
cache. That is quite a bit of data. For a rather incomplete de cache I 
have 130kB which is loaded per page view.


More information about the development mailing list