I'm trying this on Apache running on Ubuntu 14.04 and it works fine:
<?php
// Set language to Polish
var_dump(setlocale(LC_ALL, 'pl_PL.UTF8'));
echo file_get_contents('/var/www/app/backend/gettext/locale/pl_PL/LC_MESSAGES/app.mo');
// Specify location of translation tables
var_dump(bindtextdomain("app", "/var/www/app/backend/gettext/locale"));
var_dump(bind_textdomain_codeset("app", 'UTF-8'));
// Choose domain
var_dump(textdomain("app"));
echo _('I want translate this!');
echo _('This to!');
But when I try it on PHP built in webserver I get only English version and that's the only difference between these two. Is gettext supported by php built in webserver? Any way to get around it?
Thanks for help!