[wp-hackers] wordpress.org *.pot file feature for pluginsgetsbroken by PoEdit

Nikolay Bachiyski nb at nikolay.bg
Wed Jul 22 05:56:30 UTC 2009

On Wed, Jul 22, 2009 at 03:47, Heiko Rabe<heiko.rabe at code-styling.de> wrote:
>>> I know this. But the point is, that a lot of translation frameworks only
>>> based on normal gettext capabilities and also assume, that a rescan process
>>> can run every time on demand if required.
>>> Out of this scope this breaks all arround based on normal gettext
>>> behavoir.
>>> Any msgid not having a line number/file reference and can't be found by
>>> the gettext function definitions will be declared as obsolete.
>> We can add line numbers if this causes a problem with the tools.
> The Problem are not only the line number themselves, it the way gettext
> processors scanning sources.
> Even if there would be a line number attached, the scanner is unable to keep
> this at *.po file instead of trash it as absolete.

That's what I thought.

> But one thing for sure will be keeped by gettext processors, the header
> fields in msgid "" !
> ...
> you also could do the same as PoEdit did just for WordPress itself like:
> "X-WordPress-Plugin-Name: Custom Field Images\n"
> "X-WordPress-Plugin-Description: Easily associate any image to a post and
> display it in post excerpts, feeds etc.\n"
> ...
> and as new golden goal it would also work for gettextable themes, where you
> have currently no solution for:
> "X-WordPress-Theme-Name: My Super Theme\n"
> "X-WordPress-Theme-Description: This is the worlds best theme ever seen on
> earth.\n"
> ...
> I have written the proposed X-WordPress fields only english because of
> illustration but normally at a german file (de_DE.po) you would have german
> text there :-)
> This would be my proposal for keeping it inside the file and also can be
> keeped even if the files gets re-written by a new scan process.
> And because the header of a *.mo file get's processed dedicated (at least to
> get the pluralization formula and number) this fields could be extracted as
> easy as the plurals.

We can easily add the strings as headers, too.

The problem is that gettext editors don't give a interface to edit the headers.

Let's say the strings are lost from the POT file for some reason. In
order to recover them, you will have to open the POT file using a text
editor, copy the strings from the headers and put them into a
msgid/msgstr blocks. Just re-running the makepot script is easier and
less error-prone than that.

Happy hacking,

More information about the wp-hackers mailing list