Hi Bear,
See comments in line.
Mike Taylor wrote:
On Aug 21, 2006, at 6:03 PM, Brian Kirsch wrote:
I know Brian was asking about the Chandler specific code, but wanted
to point out some of the changes I was making to parsedatetime that
may fit in.
Hi Darshana,
So to recap it sounds like the date / time portion of the parser is
leveraging ICU and
thus when the locale is set to French can parse "Mardi" and treat it
equivalent to
"Tuesday" if the locale was English.
That's the code I'm working on now in the parsedatetime library.
However, if the locale was English and the parser encountered the
word "Mardi" it
would not recognize it as a day of week token.
Is this correct?
As it stands right now - correct. That's not to say at some later
point I could get fancy and allow for a list of locales to be "active"
- but that's definitely v2.0 stuff and parsedatetime hasn't hit 1.0
yet :)
Yes it would be great to start thinking about this as your multi-lingual
users will certainly
appreciate it.
How do the other natural language strings such as "dinner" get
localized?
Right now they are localized within parsedatetime itself. The current
code has a number of python lists that contain special words and
phrases that are used during different parts of the parsing.
The new localizable code I'm working on moves those lists into a class
that can be defined/overridden to define new locales. I was thinking
of allowing for a "register a word lookup function" to allow the lists
to be initialized by running them thru that function to create the
localized versions.
Might I offer a suggestion that you take a look at the gettext API.
I think it will be much easier for you as the maintainer in the long run
to have the parse tokens defined in a well defined standard such as
the .po format.
An open source on-line repository such as pootle can then be used for
the creation and management of translations from the community via its
web interface.
Chandler of course also uses the .po format so it would be great for
interoperability :)
Is this localization of natural language strings documented anywhere
such as Wiki?
This I don't know - I haven't documented parsedatetime's localize
api's yet but will be generating those api docs when I finish the code.
---
Bear
Build and Release Engineer
Open Source Applications Foundation (OSAF)
[EMAIL PROTECTED]
http://www.osafoundation.org
[EMAIL PROTECTED]
http://code-bear.com
PGP Fingerprint = 9996 719F 973D B11B E111 D770 9331 E822 40B3 CD29
--
Brian Kirsch
Internationalization Architect / Mail Service Engineer
Open Source Applications Foundation
543 Howard Street 5th Floor
San Francisco, CA 94105
http://www.osafoundation.org
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Open Source Applications Foundation "chandler-dev" mailing list
http://lists.osafoundation.org/mailman/listinfo/chandler-dev