[wp-hackers] Actions dependent on locale cannot be loaded in a
henrikmelin at yahoo.com
Wed Apr 2 01:26:26 GMT 2008
Yeh, I agree, it is confusing with locale dependent actions - the existence of which is easily overlooked when developing plugins on an English WP installation. I was tearing my hair out trying to figure out why the JS was absent on a sv_SE (Swedish) installation.
Thanks for the help - that worked! And for completion, the action is:
add_action('load-' . sanitize_title(__('Settings')) . '_page_more-fields', 'mf_queue_js')
and nothing else.
----- Original Message ----
From: DD32 <wordpress at dd32.id.au>
To: wp-hackers at lists.automattic.com
Sent: Tuesday, April 1, 2008 5:36:05 PM
Subject: Re: [wp-hackers] Actions dependent on locale cannot be loaded in a plugin
If hooks are being run with translated names, It seems pretty stupid IMHO.
However, If you want to make sure the textdomain has been loaded at the
time, Try adding your actions on the init hook, I think that runs after
the translatable stuff has been loaded and setup.
On Wed, 02 Apr 2008 11:23:30 +1100, Henrik Melin <henrikmelin at yahoo.com>
> I've run into a problem when updating one of my plugins (More Fields).
> The action:
> add_action('load-' . sanitize_title(__('Settings')) . '_more-fields',
> changes depending on the locale, i.e. the translation of 'settings', but
> when the plugin is loaded and the action is added, __('Settings') does
> get translated, but remains 'Settings' and so I'm calling an action
> which does not exist.
> I understand from http://trac.wordpress.org/ticket/4563 that this was
> possible back in 2.2. Has the point at which the locale is loaded
> How can I access locale-dependent actions in my plugin?
> Any thoughts appreciated,
> You rock. That's why Blockbuster's offering you one month of Blockbuster
> Total Access, No Cost.
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
wp-hackers mailing list
wp-hackers at lists.automattic.com
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.
More information about the wp-hackers