I am using the php_gettext extension in my project to translate strings using ".mo"-files. I am in the process of transferring the project to Google's Cloud Platform but apparently the php_gettext extension is not enabled (see here).
Is there a way to install this extension? And if not, what alternative is there to internationalization for PHP?
They still do not support the gettext
extension (now June 2016, issue started October 2014), so in the end I resorted to using this gettext library, which works just fine.
I used the following code to check if the gettext
extension is enabled or not, and only in case it isn't, then load the library. In case the extension gets enabled in the future, my code will be prepared. And locally, where I do have it enabled, it works just fine.
if (!function_exists('gettext'))
require_once __DIR__ . '/../libs/gettext/gettext.inc';
You can still vote for the issue here so that Google might start implementing it.