$page_hook should not be translated in localized wordpress versions

Description

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).

to see that this what happens, just install the french version of wp and

echo "page hook: " . $page_hook;

in admin-header.php.

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).

Oldest firstNewest firstThreaded

Comments only

Change History (2)

ok, after a lot of searching and digging i finally found a proper way of doing this. apparently you should never hard code the page_hook part of the admin_print_scripts-page_hook hook. instead use return values that you get when adding menu pages. Example: