[wp-hackers] i18n of plugin description

Lutz Schröer latz at elektroelch.de
Thu Jan 24 14:02:02 GMT 2008


Jacob Santos wrote:
>
> 3. The third method extends the second and allows for placing all of 
> the locale in the same file. So it extends upon the previous patch, 
> where brackets are used, except that the parsing would be a little bit 
> more slower and the locale would absolutely have to be before the 
> description text.
I thought of something like this:

/*
Plugin Name: ...
Plugin URI: ....
Description: {de_??} Dies ist eine deutsche Beschreibung. {en_EN} This 
is an English description. {nl} Nederlandse taal.
Version: ...
*/

(or any other delimiter instead {...} like [...] or $...$ which are 
rarely used in descriptions)
This should be easy to parse, is quite intuitive, and you don't have to 
insert the description part more than once.

Another solution would be to place only the English description in the 
plugin header and the foreign descriptions in a single file and parse 
this file. This would keep the header clear:

/*
Plugin Name: ...
Plugin URI: ....
Description: This is an English description. {descriptions.lang}
Version: ...
*/

and the file description.lang:
{de_??}     Dies ist eine deutsche Beschreibung.
{en_EN}   This is an English description.
{nl, dut}     Nederlandse taal.

(or instead of defining the filename in the plugin header there may be a 
predefined filename).
Solution 1 and 2 are sub optimal since you are definitely violating the 
DRY (Don't Repeat Yourself) principle and they're hard to maintain.

Lutz

BTW: Is this the correct list to discuss this topic or should we move 
somewhere else?)



More information about the wp-hackers mailing list