PHP-po-parser icon indicating copy to clipboard operation
PHP-po-parser copied to clipboard

write mo files

Open gemal opened this issue 9 years ago • 3 comments

could be super if it could write mo files

perhaps get inspiration here: https://github.com/phpmo/php.mo/blob/master/php-mo.php

gemal avatar Sep 21 '16 13:09 gemal

Hi,

Is there any way to generate the MO file in PHP ? I've try https://github.com/phpmo/php.mo/blob/master/php-mo.php and https://github.com/bigwhoop/potomoco

Nothing work, the mo file is generate but the translation on the page is wrong. And when I use PoEdit it works....

Thx !

Clemweb avatar Mar 15 '18 17:03 Clemweb

Well, I've never used mo files so have no idea how they work neither what's the best library out there.

pherrymason avatar Mar 16 '18 08:03 pherrymason

Thx @raulferras

Finaly I've found this : https://github.com/oscarotero/Gettext and it works.

But I've found a bug in EntryFactory, the msgid_plural is missing so I've add this in line 56 👍

$entry->setMsgIdPlural($entryArray['msgid_plural']);

You confirm ?

Clemweb avatar Mar 16 '18 09:03 Clemweb