I thought I read somewhere that potx was supposed to pick up permissions strings from hook_perm(). Does it try to analyze the code, or does it actually run the hook function?

I have this hook:

function subscriptions_perm() {
  return array_merge(array('administer user subscriptions', 'subscribe to all content types'), subscriptions_types('access'));
}

potx doesn't pick up anything.

Comments

gábor hojtsy’s picture

Status: Active » Closed (works as designed)

It has no way to run the function. The permission names can only be collected, if you have a static array() list. This is the same rule as with t(). t($text) cannot be translated, while t('Text') can be.