[wp-hackers] Plugin Language Translation

Andy Staines andy at yellowswordfish.com
Sun Mar 25 16:54:04 GMT 2007


Alex Günsche wrote:
> 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
>
>   
Yes.. .when your email came in  I was just looking at the source for 
load_plugin_textdomain and seeing the problem. Strange, as I pulled the 
original I had from a couple of other plugins but thinking about it.. 
they are both rather old (VERY old on e of them!) - and I use neither of 
them. So maybe the call has changed.

This seems to have licked it anyway. I am grateful to you and to Sabin 
as well for the help. And thanks for your patience... I'm getting too 
old for this!

regards
Andy


More information about the wp-hackers mailing list