Skip Menu |

This queue is for tickets about the Date-Manip CPAN distribution.

Report information
The Basics
Id: 133751
Status: open
Priority: 0/
Queue: Date-Manip

People
Owner: Nobody in particular
Requestors: leo.cacciari [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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.
I would welcome any patch to fix Italian. If you want, you could just modify the Date/Manip/Lang/Italian.pm file and add the modified version to this problem. It's a challenge for me to keep the languages up-to-date since I don't speak Italian. On Mon Nov 16 06:20:34 2020, leo.cacciari@gmail.com wrote: Show quoted text
> 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 > >
Subject: Re: [rt.cpan.org #133751] Problem with Italian I18N
Date: Thu, 3 Dec 2020 10:49:38 +0100
To: bug-Date-Manip [...] rt.cpan.org
From: Leo Cacciari <leo.cacciari [...] gmail.com>
Hi, one of the advantages of open software is that people speaking different languages can help getting localization right :) I've been working on the git repository, so if you like, I could just do a pull request there. I have just some cleanup to do in the test script and in the git commits that are at the present way too atomic, all of wich should be done by saturday or sunday depending on next days workload. LC On Mon, Nov 30, 2020 at 7:28 PM Sullivan Beck via RT <bug-Date-Manip@rt.cpan.org> wrote: Show quoted text
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=133751 > > > I would welcome any patch to fix Italian. If you want, you could just modify the Date/Manip/Lang/Italian.pm file and add the modified version to this problem. > > It's a challenge for me to keep the languages up-to-date since I don't speak Italian. > > > On Mon Nov 16 06:20:34 2020, leo.cacciari@gmail.com wrote:
> > 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.
Perfect. Any help you give will be much appreciated.
Subject: Re: [rt.cpan.org #133751] Problem with Italian I18N
Date: Wed, 9 Dec 2020 10:06:24 -0500
To: bug-Date-Manip [...] rt.cpan.org
From: "Sullivan Beck (CPAN)" <sullybeck [...] gmail.com>
Thanks for the patch.  I reviewed it and merged it in.  It will be in the next release. On 12/3/20 4:49 AM, Leo Cacciari via RT wrote: Show quoted text
> Queue: Date-Manip > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=133751 > > > Hi, > one of the advantages of open software is that people speaking > different languages can help getting localization right :) > I've been working on the git repository, so if you like, I could just > do a pull request there. I have just some cleanup to do > in the test script and in the git commits that are at the present way > too atomic, all of wich should be done by saturday or sunday > depending on next days workload. > > LC > > On Mon, Nov 30, 2020 at 7:28 PM Sullivan Beck via RT > <bug-Date-Manip@rt.cpan.org> wrote:
>> <URL: https://rt.cpan.org/Ticket/Display.html?id=133751 > >> >> I would welcome any patch to fix Italian. If you want, you could just modify the Date/Manip/Lang/Italian.pm file and add the modified version to this problem. >> >> It's a challenge for me to keep the languages up-to-date since I don't speak Italian. >> >> >> On Mon Nov 16 06:20:34 2020, leo.cacciari@gmail.com wrote:
>>> 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 >>> >>>
>> >>
>