yby
yby

Reputation: 31

Gettext and PHP 5.3.5 xampp - Use of undefined constant LC_MESSAGES - assumed 'LC_MESSAGES' in

I am getting the following error:

Notice: Use of undefined constant LC_MESSAGES - assumed 'LC_MESSAGES' in C:\Program Files\xampp\htdocs\xampp\phptest\resources\testi18n.php on line 19

Notice: Undefined index: language in C:\Program Files\xampp\htdocs\xampp\phptest\resources\testi18n.php on line 19

Deprecated: setlocale() [function.setlocale]: Passing locale category name as string is deprecated. Use the LC_* -constants instead in C:\Program Files\xampp\htdocs\xampp\phptest\resources\testi18n.php on line 19

the code:

<?php

  setlocale( LC_MESSAGES, $_GET['language']);

  bindtextdomain('messages', 'locale');
...
 ?>

I did test gettext extension is installed with php (it supported)

Upvotes: 3

Views: 3492

Answers (2)

Piet
Piet

Reputation: 11

please DON'T use LC_ALL, because you may have very bad side effect using languages like French.

In my case floatval() and float conversion to string use the coma instead of the dot as the decimal separator. And it just put a bug mess in my db.

Upvotes: 1

Pekka
Pekka

Reputation: 449613

See the manual (emphasis mine):

LC_MESSAGES for system responses (available if PHP was compiled with libintl)

LC_ALL may be a useful replacement for your purposes.

Upvotes: 3

Related Questions