Cog Rusty wrote:
Question: While trying to understand better the problem with the /admin/user/access page where strings like "edit your own [type] content" appear completely untranslated for imported or user-defined types if a translation for them has not been imported, I stumbled into the following:
Apparently the translation is performed in user.module, line 1823:
$form['permission'][$perm] = array('#value' => t($perm));
This displays the translation of the *whole* permission string IFF it already exists. So far so good. However the existing string "edit own book pages", which is included in book-module.pot, does not have a t() in book.module. How does potx find it and extract it?
t() is designed to translate literal (written in code, *not* user defined) strings. All literal permission names are collected from hook_perm() implementations by the extractor.
Gabor