|
From: Jeff D. <da...@da...> - 2001-03-14 15:55:37
|
>Reini says:
>date() is not localised, use strftime() instead. =
>but strftime() has a different template syntax. edit index.php also then=
=2E
Good observation. Is there a reason we shouldn't switch to using
strftime rather than date everywhere?
>setlocale("LC_TIME", "german"); =
Speaking of which, has anyone tried the latest CVS code to see if
my hacks to accept international characters in WikiW=F6rter work? =
(Steve: alpha/index.php needs to be updated --- new $WikiNameRegexp)
=3D=3D=3D=3D=3D=3D=3D
As for transform bugs:
}Steve says:
}Do you mean the <P><p> here? Isn't the first one from the template?
Actually, it's from lib/savepage.php. It only appears in a freshly
saved page. (It should be removed, I think -- but it's certainly no big
deal.)
}The rest below look well formed to me.
Me too.
Jeff
|
|
From: Jeff D. <da...@da...> - 2001-03-14 23:18:06
|
In message <3AA...@x-...>,Reini Urban writes:
>> Is there a reason we shouldn't switch to using
>> strftime rather than date everywhere?
>>
>> >setlocale("LC_TIME", "german");
>
>yes, there is.
>I couldn't figure out which locale on which platform is best, or just works.
>at least for german :)
Uh oh. I was afraid of that.
>LC_TYPE "german" works for me on win2000 and linux now,
>but the recommended settings ("de_GE" or "de_AT") do not work as they should.
> (austrians need different sublocales for weekday and month names for
>example)
'de_GE' (probably a typo?) is incorrect, I think. Should be 'de_DE'?
Datapoint: I've tested 'de_DE' and 'de_AT', and 'german' on four Linux
systems. They all seem to work (at least they do something) on all of them.
The systems were:
RedHat 7.0, glibc 2.2
RedHat 6.2, glibc-2.1
RedHat 5.2, glibc-2.1
Debian 2.2?, glibc 2.1
Plain 'de' does not work on any of those systems. I though it should,
but perhaps I'm wrong.
(A simple way to test, at least on unix systems, is from the command
line, e.g.:)
LANG=de_DE date "+%x"
Which should print the date in the locale-specific format.
That said, even if you can't find the correct locale setting, does
switching from date() to strftime() break anything? With date()
you're stuck with English days/months no matter what --- with strftime()
you have a chance of getting dates in your native language.
Jeff
|
|
From: Reini U. <ru...@x-...> - 2001-03-15 01:12:28
|
Jeff Dairiki schrieb: > 'de_GE' (probably a typo?) is incorrect, I think. Should be 'de_DE'? oh yes. > Datapoint: I've tested 'de_DE' and 'de_AT', and 'german' on four Linux > systems. They all seem to work (at least they do something) on all of them. > The systems were: > RedHat 7.0, glibc 2.2 > RedHat 6.2, glibc-2.1 > RedHat 5.2, glibc-2.1 > Debian 2.2?, glibc 2.1 > > Plain 'de' does not work on any of those systems. I though it should, > but perhaps I'm wrong. > > (A simple way to test, at least on unix systems, is from the command > line, e.g.:) > > LANG=de_DE date "+%x" on bash only. that's fine, thanks! Suse v?? glibc-2.1 $LANG=de_AT date "+%x %X" 2001-03-15 02:05:44 $LANG=de_DE date "+%x %X" 15.03.2001 02:05:55 $LANG=de date "+%x %X" 03/15/01 02:06:00 $LANG=german date "+%x %X" 15.03.2001 02:06:04 $LANG=deutsch date "+%x %X" 15.03.2001 02:06:11 strange, but okay for me. austrians seem to favor standards :) > Which should print the date in the locale-specific format. > > That said, even if you can't find the correct locale setting, does > switching from date() to strftime() break anything? With date() > you're stuck with English days/months no matter what --- with strftime() > you have a chance of getting dates in your native language. everything works okay. I tested it in my first php project ever (a movie database) and there my problems were probably just my mistake. -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ |
|
From: Jeff D. <da...@da...> - 2001-03-15 03:04:20
|
>Suse v?? glibc-2.1 I suspect all glibc-2.x's will work similarly. Older libc's (and non glibc's, I don't know about.) >$LANG=de date "+%x %X" >03/15/01 02:06:00 That's a failure (just like I saw in my tests). It's can't find 'de', so the locale defaults to "C". You can be even more sure of this by printing the day-name: LANG=de_DE date +%A Mittwoch LANG=de date +%A Wednesday So tell me again: which of these worked under which version(s) of Windows? I just tested an older SunOS machine: 'de' and 'de_AT' worked, but NOT 'de_DE' nor 'german' nor 'deutsch'. Ug. |
|
From: Reini U. <ru...@x-...> - 2001-03-16 09:07:18
|
win2000: on cygwin (latest) all these date commands just do the C locale. but php is better: I use the [2001-02-20] php4.0.5-dev testbranch (the second i guess, but locale stuff didn't change) from the german binary download site http://www.mm4.de/php4win/. <dl> <dt>php version:</dt><dd><b><?php print phpversion()?></b></dd> <dt>server api:</dt><dd><b><?php print function_exists("php_sapi_name") ? php_sapi_name() : "unable to detect" ?></b></dd> <dt>system:</dd><dd><b><?php print function_exists("php_uname") ? php_uname() : "unable to detect" ?></b></dd> <?php function testlctime ($loc) { setlocale ("LC_TIME", $loc); echo "<dt>$loc:</dt><dd><b>"; echo strftime ("%a., %d. %b %Y - %x %X", time()); echo "</b></dd>"; } testlctime ("de"); // wrong testlctime ("de_AT"); // wrong testlctime ("de_DE"); // wrong testlctime ("deutsch"); // wrong testlctime ("german"); // okay ?> </dl> => php version: 4.0.5-dev server api: apache system: Windows NT 5.0 build 2195 de: Fri., 16. Mar 2001 - 03/16/01 09:05:21 de_AT: Fri., 16. Mar 2001 - 03/16/01 09:05:21 de_DE: Fri., 16. Mar 2001 - 03/16/01 09:05:21 deutsch: Fri., 16. Mar 2001 - 03/16/01 09:05:21 german: Fr., 16. Mrz 2001 - 16.03.2001 09:05:21 Jeff Dairiki schrieb: > > >Suse v?? glibc-2.1 > > I suspect all glibc-2.x's will work similarly. Older libc's (and > non glibc's, I don't know about.) > > >$LANG=de date "+%x %X" > >03/15/01 02:06:00 > > That's a failure (just like I saw in my tests). It's can't find 'de', > so the locale defaults to "C". You can be even more sure of this > by printing the day-name: > > LANG=de_DE date +%A > Mittwoch > > LANG=de date +%A > Wednesday > > So tell me again: which of these worked under which version(s) of > Windows? > > I just tested an older SunOS machine: 'de' and 'de_AT' worked, but NOT > 'de_DE' nor 'german' nor 'deutsch'. Ug. -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ |
|
From: Steve W. <sw...@pa...> - 2001-03-14 16:17:55
|
On Wed, 14 Mar 2001, Jeff Dairiki wrote:
> >Reini says:
> >date() is not localised, use strftime() instead.
> >but strftime() has a different template syntax. edit index.php also then.
>
> Good observation. Is there a reason we shouldn't switch to using
> strftime rather than date everywhere?
None... or perhaps better yet wrap strftime() in a function or method, and
give it a more user-friendly appearance. (I wonder how long it takes
non-English speaking people to figure out what "strftime" means?)
> (Steve: alpha/index.php needs to be updated --- new $WikiNameRegexp)
I'll check to see if it's updated lately. I have never seen an unreliable
crond until I started running jobs on Sourceforge.
~swain
---
http://www.panix.com/~swain/
"Without music to decorate it, time is just a bunch of boring
production deadlines or dates by which bills must be paid."
-- Frank Zappa
|
|
From: Thomas K. <th...@co...> - 2001-03-14 17:33:49
|
Sorry making so mutch trouble about it, next time i will be more modest creating the subject line ;-) T. |
|
From: Reini U. <ru...@x-...> - 2001-03-14 22:41:01
|
Jeff Dairiki schrieb:
> >Reini says:
> >date() is not localised, use strftime() instead.
> >but strftime() has a different template syntax. edit index.php also then.
>
> Good observation. Is there a reason we shouldn't switch to using
> strftime rather than date everywhere?
>
> >setlocale("LC_TIME", "german");
yes, there is.
I couldn't figure out which locale on which platform is best, or just works.
at least for german :)
LC_TYPE "german" works for me on win2000 and linux now,
but the recommended settings ("de_GE" or "de_AT") do not work as they should.
(austrians need different sublocales for weekday and month names for
example)
my /usr/share/locale dirs are not very rich on TC_TIME settings. Or I just
cannot find them.
Win2000 has a better native (ie builtin) SDK on this.
> Speaking of which, has anyone tried the latest CVS code to see if
> my hacks to accept international characters in WikiWörter work?
>
> (Steve: alpha/index.php needs to be updated --- new $WikiNameRegexp)
not yet. this is a massive change for existing content.
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/
|