[dev] [Patch] Localization problems with strftime

Thierry Thomas thierry@pompo.net
Tue, 6 Aug 2002 10:09:16 +0200


Le 06/08/2002 à 05:53:42 +0200, Chuck Hagenbuch <chuck@horde.org> écrivait :
> > On some platforms (e.g. FreeBSD), strftime is not localized if setlocale
> > is not set. For example IMP, Kronolith, Nag, etc. show un-localized
> > dates.
> 
> We already call setlocale() from NLS::setLang().

OK, but it'is not sufficient (at least on FreeBSD): if I replace my
previous patch by

--- base.php.orig       Sat Jul 27 22:07:21 2002
+++ base.php    Tue Aug  6 09:58:33 2002
@@ -42,4 +42,6 @@
 $notification = &Notification::singleton();
 $notification->attach('status');
 
+NLS::setLang();
+
 ?>

it does nothing. In setLang(), $lang = "fr_FR" (or "de_DE", etc.), and
setlocale (LC_TIME, xx) requires something like "fr_FR.ISO8859-15" (or
"de_DE.ISO8859-1", etc.).

With NLS::setLang(), strftime returns the value for locale set to "C",
with strings and format in english.

Regards,
-- 
Th. Thomas.