[wp-hackers] Settings API -- Translation issues

wpmidia lab wpmidia at gmail.com
Sun Sep 30 17:42:21 UTC 2012

Thanks Otto. I managed to solve the problem. =)

2012/9/30 Otto <otto at ottodestruct.com>

> On Sun, Sep 30, 2012 at 9:13 AM, wpmidia lab <wpmidia at gmail.com> wrote:
> > I'm having difficulty translating the options page of my plugin, using
> > Settings API.
> > Only the menu item and the page title are translated. Form fields
> > configuration (an array), do not translate.
> > What am I doing wrong?
> You're defining these options and translating those strings into a
> variable in the main body of the plugin (inside global scope), but not
> calling the load_plugin_textdomain call until the 'init' action hook.
> This means that your strings are being translated before your
> text-domain loads, because the plugin load happens before init runs.
> Move the definition of the settings (and translation of those strings)
> into a function, then call that from your init function *after* you've
> loaded your text-domain.
> -Otto
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

*Míriam de Paula *
*Twitter:* @miriamdepaula

*desenvolvimento web*
twitter: @wpmidia

*WordPress Brasil no Facebook:*

*OpenCart Brasil no Facebook:*

*Hospedagem de Qualidade é na HostGator<http://www.hostgator.com.br/6133-4.html>

More information about the wp-hackers mailing list