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.
精彩评论