[development] hook_perm() and t()

Peter Wolanin pwolanin at gmail.com
Wed Sep 6 13:38:23 UTC 2006


I assume this is true for 4.7 as well?  Anyone with CVS access can
checkout and update these docs-  see:

http://cvs.drupal.org/viewcvs/drupal/contributions/docs/developer/hooks/

-Peter

Date: Wed, 6 Sep 2006 19:42:55 +0800
From: "Augustin (Beginner)" <drupal.beginner at wechange.org>
Subject: Re: [development] hook_perm() and t()
To: development at drupal.org
Message-ID: <200609061942.55998.drupal.beginner at wechange.org>
Content-Type: text/plain;  charset="iso-8859-1"

On Wednesday 06 September 2006 07:19 pm, Gabor Hojtsy wrote:

> > http://api.drupal.org/api/HEAD/function/hook_perm
> > makes no mention of t() either way.
>
> There is no need to use t() here, since the string extractor takes care of
> extracting permission names defined in the perm hook for translation. It
> might be more consistent to use t() all over the user_acess() calls, but
> it seems superfluos. The permission names are translateable, they are just
> a special case in the extractor, and are t()-ed on the display of the
> permission table.

Thanks Gabor for the explanation.
:)


Maybe someone who has the power to do that could add a small comment about
this on the api documentation:
 http://api.drupal.org/api/HEAD/function/hook_perm
> > makes no mention of t() either way.


More information about the development mailing list