编程语言
首页 > 编程语言> > Gettext和PHP 5.3.5 xampp-使用未定义的常数LC_MESSAGES-假定为“ LC_MESSAGES”

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

标签:gettext,setlocale,php
来源: https://codeday.me/bug/20191102/1989815.html