[drupal-devel] Internationalization, Usability and changes in the coding conventions

Gabor Hojtsy gabor at hojtsy.hu
Sat Feb 19 20:21:14 UTC 2005

> Second guessing but,
> Can someone tell me why this is like this:
> print theme("page", message_access(), t("Access denied"));
> rather than this?
> print theme("page", t('Please login or register to see this material'),
> t("Access denied"));
> Why is there a call to a Function like this anyway? Is is a mistake in
> the filestore2 module or is this something that has to be used? I
> noticed this after killes posted. Is this legacy code and should be removed?

The role of this was not to repeat the same t() at multiple places. But 
see the patch submitted by Killes. It is a good step forward. You 
proposed to change message_access() to

function message_access($message = 'You are not authorized to access
this page.') {
   return t($message);

Which would be easy to reduce to a single t() call instead of passing a 
string into message_access, and that single t() call would actually 
enable the automatic translation template generation, unlike this 
solution you proposed.


More information about the drupal-devel mailing list