[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] "date" malfunctions in the Turkish locale
From: |
Bruno Haible |
Subject: |
Re: [PATCH] "date" malfunctions in the Turkish locale |
Date: |
Sun, 3 Aug 2008 13:38:54 +0200 |
User-agent: |
KMail/1.5.4 |
Hi Jim,
> Here's a proposed patch to solve the problem without changing locale.
> Since tables are all ASCII, we can simply use c_toupper instead
> of toupper. While not necessary, I've gone ahead and changed to
> c_isspace and c_isalpha as well. Any application that relies on getdate
> skipping leading white space characters not in the ASCII set already has
> locale-dependent bugs. In other words, while this change does restrict
> the input grammar slightly, it is for a good cause: making the grammar
> locale-independent.
>
> Barring objections, I'll push this on Monday.
The patch is good (btw it requires an additional dependency in modules/getdate),
because the getdate.y code is not yet internationalized: Only English month
and weekday names are accepted, not localized ones.
In a german locale,
$ date -d Tuesday
Di Aug 5 00:00:00 CEST 2008
$ date -d Dienstag
date: ungültiges Datum „Dienstag“
When the getdate.y code is internationalized, special care must be taken
because there are some Turkish month names that include an 'i'. These are
the abbreviated names from the glibc locale:
abday "Paz";"Pzt";"Sal";"Çrş";"Prş";"Cum";"Cts"
abmon "Oca";"Şub";"Mar";"Nis";"May";"Haz";"Tem";"Ağu";"Eyl";"Eki";"Kas";"Ara"
$ LC_ALL=tr_TR.UTF-8 date -d '01 Dec'
currently succeeds and should continue to succeed.
$ LC_ALL=tr_TR.UTF-8 date -d '01 Ara'
currently complains and should succeed.
$ LC_ALL=tr_TR.UTF-8 date -d '01 Nis'
$ LC_ALL=tr_TR.UTF-8 date -d '01 NİS'
should both succeed.
$ LC_ALL=tr_TR.UTF-8 date -d '01 Nıs'
$ LC_ALL=tr_TR.UTF-8 date -d '01 NIS'
should both fail.
Implementing this will require changes to the lookup_word function...
Bruno