[wp-hackers] Internationalisation or Internationalization

Ryan Boren ryan at boren.nu
Fri Sep 17 05:13:03 UTC 2004


On Thu, 2004-09-16 at 13:10 -0600, Randy Peterman wrote:
> So, I want to internationalize my plugin, StatTraq 
> (http://www.randypeterman.com/StatTraq/).  Here are my questions:
> 1) Is there a way to work in tandem with the WordPress 
> internationalization code?

Yes, although at the moment it's not as easy as it should be.  I would
like to have WP automatically load mo files for each plugin that
provides a mo for the currently active language and merge that mo with
the WordPress catalog.  

> 2) If not, is it legit/legal to copy the code and re-use it in my plugin?

The stream reader and gettext classes are available for you to
instantiate and use.  See how wp-l10n.php loads a mo.  Hopefully, I'll
have time to make WordPress do this for you.

> 3) What's the best way to find translators?

Markup your plugin source with __() and _e(), as appropriate, create a
POT file, and make a request for translators on this list and the
forums.

Translating plugins that don't ship with WP has been on my to-think-
about list.  Unfortunately, I haven't really thought about it yet.
Perhaps the German translations for a plugin named my-plugin.php  could
be contained in a file named de.my-plugin.mo (or some similar filename
schema).  The mo could be placed in either the languages or plugin
directory.  WordPress would, somehow, load this up if my-plugin is
activated.  Our php implementation of gettext() doesn't merge catalogs,
if I recall correctly, so we'll need to either add that feature or work
around it.  I'll investigate.  Since I've being saying that for months,
anyone else should feel free to take a crack at it.

Ryan




More information about the hackers mailing list