I’ve got gettext setup within PHP5. After some struggling with the charactersets and the like, I’ve managed to translate some basic strings. Now I’ve ran into a problem. When translating an empty string I expect to get the untranslated (empty) string back (correct me if I’m wrong ;)).
However instead of returning the input string, I get the header of the .PO file as the translation:
Project-Id-Version: PACKAGE VERSION Report-Msgid-Bugs-To: POT-Creation-Date: 2011-09-22 15:03+0200 PO-Revision-Date: 2011-09-22 15:37+0200 Last-Translator: timo Language-Team: English Language: en MIME-Version: 1.0 Content-Type: text/plain; charset=ASCII Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1);
When I look in the .mo file with a text-editor I see that the header seems to placed at a random place within the file. I would like to show you, but I can’t paste the file in. It looks like there is a list of my msgid’s, then the header and then a list of my msgstr’s
I’ve used the following command to generate the .mo file:
msgfmt -c -v -o en/LC_MESSAGES/messages.mo messages_en.po
After this command I’ve restarted my webserver (lighttpd).
What did I do wrong and how can I fix it?
After searching around with some different queries I stumbled upon this site:
http://framework.zend.com/issues/browse/ZF-2914
Here I found that the translation of the empty string to meta information is actually in the specifications of gettext: