1

In setting up gettext for PHP, one needs to declare (among others) these two things (in my example I'm using en_US):

setlocale(LC_MESSAGES, 'en_US.utf8');
putenv('LANG=en_US.utf8');

I was trying to move these things into the PHP configuration file instead, so I've set the environment variable for LANG as such:

env[LANG] = 'en_US.utf8'

Which seems to be okay, and the second command is no longer necessary for it to work.

But there doesn't seem to be any such alternative for the LC_MESSAGES. Setting it up as an environment variable in my case didn't work, despite the fact that the documentation for setlocale() says:

If locale is NULL or the empty string "", the locale names will be set from the values of environment variables with the same names as the above categories, or from "LANG".

Because in my case the LC_MESSAGES isn't empty, but instead it returns C, which i have no idea what it means and where that value comes from.

The closest thing i have found in the php.ini file was one called intl.default_locale, which I've set to intl.default_locale=en_US.utf8, but with no change.

So I'm just wondering if it can be done via config files?

Vickel
  • 7,879
  • 6
  • 35
  • 56
Digital Ninja
  • 3,415
  • 5
  • 26
  • 51

0 Answers0