$page_hook should not be translated in localized wordpress versions
|Reported by:||whoismanu||Owned by:||anonymous|
|Severity:||normal||Keywords:||page_hook localization translation admin_print_scripts|
localized version of wordpress like e.g. the french one that can be obtained at http://fr.wordpress.org/ translate page hooks.
to me this is bad practice because non localized plugins which use page hooks will no longer work with these localized versions of wordpress (even though they work perfectly fine with the english one).
my plugin used the admin_print_scripts-page_hook hook like this:
add_action('admin_print_scripts-manage_page_whoismanu-photoq', array(&$this,'addHeaderCode'), 1);
this works perfectly fine on the english wp. on the french version however the same page hook is translated to gerer_page_whoismanu-photoq and to work the hook in my plugin would have to be
add_action('admin_print_scripts-gerer_page_whoismanu-photoq', array(&$this,'addHeaderCode'), 1);
this translation is done in fr_FR.po on lines 4642-4646:
#: wp-admin/menu.php:17 #: wp-admin/menu.php:19 #: wp-admin/menu.php:21 msgid "Manage" msgstr "Gérer"
to see that this what happens, just install the french version of wp and
echo "page hook: " . $page_hook;
now, i cannot account for all possible translations in my plugin so i guess the page hooks should not be translated but be unique. otherwise the admin_print_scripts-page_hook function seems to be quite useless as already stated here: http://trac.wordpress.org/ticket/4563 (this ticket was quite old and closed and seems to describe the same problem. so not sure whether it was never fixed or whether it just resurfaced. as it was closed and old, i.e., not recently opened and closed as the guidelines state, i didn't post there but made a new ticket. sorry if this wasn't the approach to take).