我收到以下错误:
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
编码:
<?php
setlocale( LC_MESSAGES, $_GET['language']);
bindtextdomain('messages', 'locale');
...
?>
我测试了gettext扩展是否与php一起安装(受支持)
解决方法:
参见manual(重点是我的):
LC_MESSAGES for system responses (available if PHP was compiled with libintl)
LC_ALL可能是您有用的替代品.