[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-i18n-doc
Subject: Re: Parsing localized human-entered date-times
From: Denis Steckelmacher <dsteckel () ulb ! ac ! be>
Date: 2013-05-01 20:23:57
Message-ID: e74dd37ea4911779b5014d03e6763180 () imapproxy ! vub ! ac ! be
[Download RAW message or body]
> I like your idea very much and I'ld like to see it live.
>
> I'm wondering about the languages with
> 1) plurals and
> 2) multiple cases or similar constructions.
>
> Let's adapt two of your examples: 1 day ago, 1 day, 2 days ago, in 2
> days.
> In Polish that's: 1 dzień temu, po 1 dniu, 2 dni temu, po 2 dniach.
> The
> plural form is different, it is not just a matter of adding an 's'
> like in
> English or French.
>
> Cheers,
> Marta
For the plurals, the XML file uses something I call a "period" (or a
unit). Example of units are days, months, years, etc. The XML provides a
regular expression for the name of the periods. For instance, "days?"
matches "day" and "days". For more complex plurals, more complex regular
expressions can be used, for instance "di(?:e|as|estas)" that will match
die, dias and diestas in an invented Latin-like language.
The parsing rules then become "in $number$ $period$", and that will
match "in 3 days", "in one month", and even "in one months" (the user
can do mistakes). Pluralization is a big problem, and I think that
KCalendarSystem doesn't yet provide the month and day names in
pluralized forms. By the way, parsing rules are also regular
expressions, so the "in" word can also be changed to match anything the
user may want to type there, see the "(?:in )?$month$" rule that matches
"in February" and also "March" (without the "in", because this rule can
be used as part of a larger one matching "first week of March").
Handling these plurals is the main reason that oriented me towards an
XML file instead of simpler i18n-based string literals. An alternative
would be not to use XML files, but i18n calls, except that the strings
to be translated would not be nice and simple month names, but regular
expressions. How about translating "decade|decades=year*10" ?
Denis Steckelmacher.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic