If I execute this simple example with Apache+PHP+Gettext:
https://github.com/nota-ja/php-gettext-example
Which basically just do this:
Code: Select all
<?php
// I18N support information here
$language = 'en_US';
putenv('LANG=' . $language);
setlocale(LC_ALL, $language);
// Set the text domain as 'messages'
$domain = 'messages';
$localedir = dirname(__FILE__) . '/locale';
echo $localedir . ': ';
bindtextdomain($domain, $localedir);
textdomain($domain);
echo gettext('hello-world') . '<br/>';
?>
- It works on shared webhosting solution from a webhosting provider.
- It doesn't work on my local computer with following settings, that is, it display 'hello-world' without any error:
* Linux Mint 19 Tara
* Cinnamon 3.8.9
* PHP Version 7.2.10-0ubuntu0.18.04.1
* Apache/2.4.34 (Ubuntu)
* Gettext module enabled as is displayed on phpinfo()
* mbstring module enabled as is displayed on phpinfo()
To the test I just sudo cp the files to /var/www/html
I tried multiple combinations from the change the files, locales and nothing works on my Linux Mint.
Cheers