[wp-hackers] Localizing plugins

Jamie Talbot wphackers at jamietalbot.com
Thu Jan 26 01:10:03 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Per Søderlind wrote:
> Hi,
> 
> I'm trying to localize my WordPress 2.0 plugin
> (http://soderlind.no/ImageManager) and discovered that
> load_plugin_textdomain('ImageManager'); still looks for the
> ImageMananger-$locale.mo file in wp-content/plugins.
> 
> Any plans for changing this in the near future? I'd prefer that
> load_plugin_textdomain() looks in the same folder as the plugin is
> installed (ImageManager is installed in wp-content/plugins/ImageManager).

Hi,

It's already implemented!  You can set the directory yourself:

define ("IM_DIR", "wp-content/plugins/ImageManager/");
define ("IM_DOMAIN", "ImageManager");

load_plugin_textdomain(IM_DOMAIN, IM_DIR);

Then:

__('A returned string', IM_DOMAIN);
_e('An echoed string', IM_DOMAIN);

Hope this helps,

Jamie.

- --
http://jamietalbot.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFD2CFrrovxfShShFARAkwEAJ0QLXMqvnhpxZZu3rnNqzkEMhl3+QCfcctP
owne5ZHryskOqCXk4j+3Aq8=
=SDDh
-----END PGP SIGNATURE-----


More information about the wp-hackers mailing list