Subject: | Problem with Italian I18N |
Date: | Mon, 16 Nov 2020 12:20:14 +0100 |
To: | bug-Date-Manip [...] rt.cpan.org |
From: | Leo Cacciari <leo.cacciari [...] gmail.com> |
Hi,
I'm using Date::Manip and I tried to make a script I made (content of
the script irrelevant) usable by Italian speakers but I bumped against
serious problems with date parsing when using "descriptive format".
Some examples will help understand the problem:
- first Monday in March 2020 translate to "primo lunedì di marzo
2020". However,this string
produces an "Invalid date string" error when feeded to the parse
or parse_date methods.
It should be noted that the parsing succeed, producing the
expected result of 2020030200:00:00
if we use the string "primo lunedì del marzo 2020" which is
however grammatically erroneous in
Italian
- Analogously, "second sunday in May 2020" translates to "seconda
domenica di maggio 2020"
which is refused by the parsing methods unless rewritten in the
erroneous form
"secondo domenica del maggio 2021" which makes my eyes bleed
Similar problems arise when trying for "thursday in fifteenth week of
2020", which would translate to "giovedì della quindicesima settimana
del 2020" or "1st monday in 2021", translating
to "1o lunedì del 2020", or again "1st sunday in january 2020" which
would be written
"1a domenica di gennaio 2020".
The problems with Date::Manip::Lang::italian are the following:
1. In italian most date components are masculine, but some (e.g
'settimana' = week and
'domenica' = sunday) are feminine, Ordinal numbers must be in
accord with the
counted object gender, so you have "terzo lunedì" for third
monday, but "terza domenica"
for third sunday. The 'nth' field in italian.pm doesn't take
this in account
2. Still speaking about the 'nth' field, the "numerical"
abbreviations listed there aren't those
an Italian would use. We would write 1o for 1st, not 1mo, and
13esimo or 13o for 13th,
not 13mo. Moreover, the remark in the preceding point still
holds: the abbreviations too
must accord in gender: is "1o lunedì", but "1a domenica".
3. Some of the words used to mean "in" are missing (e.g. "di")
4. Some other words are missing in other fields. e.g. "scorso" in
the second element of field
'nextprev' or "dopodomani" (overmorrow) and "l'altroieri"
(ereyesterday) tn the offset_data
field.
I already started patching the Date::Calc::Lang::italian module,
(adding some tests, too). So if you are agreeable to that I could
submit a patch in the next few days
--
Leo Cacciari
Aliae nationes servitutem pati possunt. Populi Romani est propria libertas.