开发者

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

开发者 https://www.devze.com 2023-04-03 20:01 出处:网络
I am getting the following error: Notice: Use of undefined constant LC_MESSAGES - assume开发者_运维技巧d \'LC_MESSAGES\' in C:\\Program Files\\xampp\\htdocs\\xampp\\phptest\\resources\\testi18n.php o

I am getting the following error:

Notice: Use of undefined constant LC_MESSAGES - assume开发者_运维技巧d '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)


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消