On Tue, Aug 21, 2001 at 08:20:32PM +0200, Abigail wrote:
> >
> > I'm here (JANPAZ); I've wrote Cz::Time which is a module to provide
> > correct Czech versions of date strings, which is hard to do using
> > standard locale because some of the grammatical rules/categories are
> > not supported by the POSIX standard.
> >
> > I believe its functionality could be merged into some more generic
> > framework.
>
> Like Date::Manip, that already provides versions of date strings for
> many languages?
Maybe. If I try the example from the documentation I get
perl -MDate::Manip -e '&Date_Init("Language=French","DateFormat=non-US");
$date=&ParseDate("1er decembre 1990"); print $date;'
ERROR: Date::Manip unable to determine TimeZone.
Date::Manip::Date_TimeZone called at
/packages/run/perl-5.6.1/lib/site_perl/5.6.1/Date/Manip.pm line 629
Date::Manip::Date_Init('Language=French', 'DateFormat=non-US') called at -e
line 1
so the question is how much this framework is stable. Also, reading
If you look in CPAN, you'll find that there are a number of
Date and Time packages. Is Date::Manip the one you should
be using? In my opinion, the answer is no most of the time.
This sounds odd coming from the author of the software, but
read on.
Date::Manip is written entirely in perl. It's the most
powerful of the date modules. It's also the biggest and
slowest.
the question is what is the way to go. Also, I don't believe that using
} elsif ($L eq "German") {
&Date_Init_German(\%lang);
} elsif ($L eq "Polish") {
&Date_Init_Polish(\%lang);
in the code of the module is the best approach to add many and most
language versions -- separate file for language specific things sounds
better to me.
In Date::Format, there also is a support for languages and there even
is one for Czech (clickety click ... huh, it's by me), but the result
is similar as with Date::Manip in terms of stability:
perl -MDate::Format -e 'Date::Format->language("Czech"); print time2str("%a %b %e %T
%Y\n", time);'
Can't locate object method "language" via package "Date::Format"
(perhaps you forgot to load "Date::Format"?) at -e line 1.
and I get the same result for German.
So. Which way?
To explain briefly what I need in terms of localization:
"January" is "leden"
in Czech. But
"1st January" is "1. ledna"
So I at least need to have a hook to change the month name when in
follows the day, besides the natural translation of the month and days
names. In Date::Language::Czech there seems to be code for that
but I'm uncertain in what shape I left it.
Yours,
--
------------------------------------------------------------------------
Honza Pazdziora | [EMAIL PROTECTED] | http://www.fi.muni.cz/~adelton/
.project: Perl, DBI, Oracle, MySQL, auth. WWW servers, DBD::XBase.
------------------------------------------------------------------------