[wp-hackers] Plugin Language Translation

Alex Günsche ag.ml2007 at zirona.com
Sun Mar 25 16:42:39 GMT 2007


On Sun, 2007-03-25 at 17:23 +0100, Andy Staines wrote:
> (2) I have put the load textdomain into an 'init' action as you advised:
> 
>     add_action('init', 'sf_localisation');
> 
>     function sf_localisation()
>     {
>         load_plugin_textdomain('sforum',
>     ABSPATH.'wp-content/plugins/simple-forum/languages/sforum-'.get_locale().'.mo');
>     //    load_plugin_textdomain('sforum',
>     ABSPATH.'/wp-content/plugins/simple-forum/languages/');
>     }

Try this one:

function sf_localisation() {
	global $locale;
	load_plugin_textdomain('sforum', '/wp-content/plugins/simple-forum/languages/');
}

This method works very well for my plugins.

Btw, 
Regards,
Alex

-- 
Alex Günsche, Zirona OpenSource-Consulting
work: http://www.zirona.com/ | leisure: http://www.roggenrohl.net
PubKey for this address: http://www.zirona.com/misc/ag.ml2007.asc



More information about the wp-hackers mailing list