Jan 08

Using .mo and .po file without native gettext php function

If you have followed the article “Setup local translation in PHP using gettext function” and you got in trouble, most probably the problem is around the fact that you don’t have gettext functionality available in you server environment. And now what if you want to take advantage of .mo and .po files and hence of gettext functionality? The solution is simple and is around the corner, just look deeper and the solution name is php-gettext .

Php-gettext is a PHP library developed by Danilo Segan and released under GPLv2 license, so you can be free to use it. Thank to Danilo effort, you can use .mo and .po files without having gettext library installed in you server. I found that also popular web software like Phpmyadmin and WordPress take advantage of Danilo’s work implementing it in a custom fashion.

To implement php-gettext in your environment, simply follow the great instructions you will find in the library under “example” folder.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>