[wp-hackers] i18n of plugin description

Jennifer Hodgdon yahgrp at poplarware.com
Thu Jan 24 15:09:44 GMT 2008


One thing to consider is that locales are very very specific and there 
are a zillion of them. For instance, if you specify you have a 
description for en_EN, someone who uses locale en_US or en_CA could 
certainly read that description. Then again, for some languages, maybe 
the locale is important for understanding. The plugin author should 
not have to make a list of all possible locales for matching.

Given that, I don't like any of the suggestions so far proposed for 
providing descriptions in different languages. In my opinion, the 
matching scheme should somehow tie in to the POT/PO/MO/gettext 
internationalization scheme, not rely on matching the person's exact 
locale setting with a locale the plugin author decided to include a 
description for.

One possibility that could possibly be made to work is to put 
something like this into the plugin header:

/* Plugin Name: ...
    Description: Plugin to save the world
    (rest of header)
*/

$myplugin_desc = __( "Plugin to save the world" );

Now, the plugin description (as long as it is typed carefully the same 
in two spots) is part of the gettext scheme, and will be translated 
whenever the plugin is translated. The plugin listing page in the 
admin screen could try running the description through gettext before 
displaying it, and if that string has been translated in the MO file, 
it would get displayed in the user's preferred language.

How about that? The main pitfall would be that you have to remember, 
if you edit the description in the header, to put the same description 
into the $desc variable, so they stay in sync.

     --Jennifer

-- 
Jennifer Hodgdon

Poplar ProductivityWare * www.poplarware.com
Web Databases/Scripts * Modeling/Analysis/Palm OS Software



More information about the wp-hackers mailing list