[wp-hackers] load_plugin_textdomain()
DD32
wordpress at dd32.id.au
Wed Jul 23 14:09:36 GMT 2008
Thats not very compatible with 2.6 & custom wp-content directories.
http://trac.wordpress.org/ticket/7075#comment:3
On Thu, 24 Jul 2008 00:02:22 +1000, Stephen Rider
<wp-hackers at striderweb.com> wrote:
> On Jul 23, 2008, at 8:48 AM, Otto wrote:
>
>> What is the correct and forward compatible way to call
>> load_plugin_textdomain() inside a plugin? Assume that I want the .mo
>> files to be inside the plugin's own directory and not in a lang
>> directory or some such thing.
>>
>> The codex and documentation is less than clear on this point, and the
>> code is somewhat difficult to understand.
>
>
> I just worked this out yesterday.
>
> This works for me, with .mo in a /languages/ folder inside the plugin
> folder:
>
> $plugin_dir = basename(dirname(__FILE__));
> load_plugin_textdomain( 'myplugin', 'wp-content/plugins/'.
> $plugin_dir.'/languages', $plugin_dir.'/languages' );
>
> I'm sure you can adjust that for the .mo in the base plugin folder. ;-)
>
> Stephen
> _______________________________________________
> 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