Hi, hook_perm() doesn't use t()? I've checked a few core modules, and the perms are not wrapped in t(). Does this mean that the perms in ?q=admin/user/access are never translated? Is this valid? /************************************* * Implementation of hook_perm() *************************************/ function hook_perm() { return array(t('administer hook')); } and: 'access' => user_access(t('administer demexp')), ??? http://api.drupal.org/api/HEAD/function/hook_perm makes no mention of t() either way. thanks, Augustin. -- http://www.wechange.org/ Because we and the world need to change. http://www.reuniting.info/ Intimate Relationships, peace and harmony in the couple.
Hi Augustin,
hook_perm() doesn't use t()? I've checked a few core modules, and the perms are not wrapped in t(). Does this mean that the perms in ?q=admin/user/access are never translated?
Is this valid?
/************************************* * Implementation of hook_perm() *************************************/ function hook_perm() { return array(t('administer hook')); } and: 'access' => user_access(t('administer demexp')),
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. Gabor
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.
A. -- http://www.wechange.org/ Because we and the world need to change. http://www.reuniting.info/ Intimate Relationships, peace and harmony in the couple.
Augustin (Beginner) wrote:
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
Anyone with CVS access can change this. The file to change is contributions/docs/developer/hooks/core.php. -Angie
participants (3)
-
Angie Byron -
Augustin (Beginner) -
Gabor Hojtsy