From: SourceForge.net <no...@so...> - 2010-02-15 08:37:57
|
Bugs item #2951148, was opened at 2010-02-13 10:26 Message generated for change (Comment added) made by liedekef You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=108956&aid=2951148&group_id=8956 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Admin Group: 2.1.3 Status: Open Resolution: None Priority: 5 Private: No Submitted By: https://www.google.com/accounts () >Assigned to: Franky Van Liedekerke (liedekef) Summary: esp_setlocale quietly fails to set up locale Initial Comment: System: Linux (Ubuntu, Hardy), PHP5, Apache2, gettext compiled in When the en_US.UTF-8 locale is not available on the host, setlocale() will quietly fail to change the locale. esp_setlocale($lang) will also quietly fail. (I presume this is true if ANY locale you attempt to use is not available on the host, when using the gettext native extension). One noticeable symptom is that test.php reports gettext is available and real but "%%%% Gettext Test Failed" is still displayed. I see messages on the mailing list about this issue. For the most part this is a minor issue; the failure will mostly be unnoticed as the failover language is English. However, poor suckers like me who try to modify the en_US localization file will be very confused. The output of test.php may also be confusing. The root cause of the problem can be resolved by installing the en_US.UTF-8 locale. In ubuntu, sudo locale-gen en_US.UTF-8 Note that "locale -a" will list existing locales. On the php_ESP side, when the locale is not set correctly, this should be detected and reported. For example, adding this code at the appropriate place in test.php will retrieve the current locale setting and ensure it was accurately set to language.charset. <li>LC_ALL: <?php check_string(setlocale(LC_ALL, 0), $ESPCONFIG['lang'].".".$ESPCONFIG['charset']); ?></li> Additional checks in esp_setlocale() may be called for; PHP docs say the return value of setlocale() when a locale is actually set varies from system to system, but also says it should return the locale if set properly. ---------------------------------------------------------------------- >Comment By: Franky Van Liedekerke (liedekef) Date: 2010-02-15 09:37 Message: Indeed many people on this list had this problem and always when I asked them "is the locale installed on your server" the person stopped responding. It is your own problem for selecting a locale not available, but indeed it should be made more fool-proof. I'll take a look at this! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=108956&aid=2951148&group_id=8956 |