[wp-hackers] Why strings aren't translated here?

Otto otto at ottodestruct.com
Mon Nov 2 15:10:07 UTC 2009

On Fri, Oct 30, 2009 at 3:20 PM, Milan Dinić <liste at srpski.biz> wrote:
> Now I tried what you suggested ( $gse_options['tip_text'] = sprintf(__("It
> seems that ... ) but it still doesn't translate that string. Maybe is
> problem because it is run in register_activation_hook.

Yes, that is indeed your problem. Or, rather, the lack of the init is
your problem.

When the activation hook fires, your plugin has just been included.
Init occurred before that happened. So your init doesn't get run, and
thus your text domain never gets loaded before you try to start
translating things. You need to load the text domain before you use
translation functions.

Sent from Memphis, TN, United States

More information about the wp-hackers mailing list