Gettext和PHP 5.3.5 xampp-使用未定义的常数LC_MESSAGES-假定为“ LC_MESSAGES”

我收到以下错误:

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可能是您有用的替代品.

上一篇:java-在android中动态创建“ values-en”文件夹


下一篇:MSP430 单片机 SHT30 SHT31 温湿度传感器 MSP430F5529 MSP430G2553