[wp-hackers] Actions dependent on locale cannot be loaded in a plugin

DD32 wordpress at dd32.id.au
Wed Apr 2 00:36:05 GMT 2008


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>  
wrote:

> Hi!
>
>
> I've run into a problem when updating one of my plugins (More Fields).  
> The action:
>
>
> add_action('load-' . sanitize_title(__('Settings')) . '_more-fields',  
> 'mf_queue_js');
>
>
> 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  
> changed?
>
>
> How can I access locale-dependent actions in my plugin?
>
>
> Any thoughts appreciated,
> Cheers,
> Henrik.
>
>
>
>
>       ____________________________________________________________________________________
> You rock. That's why Blockbuster's offering you one month of Blockbuster  
> Total Access, No Cost.
> http://tc.deals.yahoo.com/tc/blockbuster/text5.com
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>




More information about the wp-hackers mailing list