delight-im / PHP-I18N

Internationalization and localization for PHP
MIT License
57 stars 13 forks source link

Undefined constant LC_MESSAGES #2

Closed zukilover closed 9 years ago

zukilover commented 9 years ago

I got this strange error and couldn't figure out what's the problem. What might cause such issue?

Notice: Use of undefined constant LC_MESSAGES - assumed 'LC_MESSAGES' in
..\I18N.php on line 54
redelschaap commented 9 years ago

I got it too once, it turned out my system didn't define the LC_MESSAGES constant. So I defined it myself:

if ( ! defined( 'LC_MESSAGES' ) ) {
    define( 'LC_MESSAGES', 5 );
}
ocram commented 9 years ago

Thanks a lot for your help, @redelschaap!

@zukilover: You may try the solution provided by @redelschaap, which should work because it's correctly defining the unknown constant.

If you wonder why the constant is missing, the PHP manual says that it's only "available if PHP was compiled with libintl".