[Zope3-dev] Locale and Object Formatting (numbers and datetimes)

Shane Hathaway shane@zope.com
Sat, 23 Nov 2002 19:59:21 -0500


Stephan Richter wrote:

> Hi everyone,
>
> after I published the interfaces for a possible LocaleService earlier 
> today, I
> now added two prototype implementations of the NumberFormat and
> DateTimeFormat class to the Wiki. They both work fundamentally and I 
> think
> they are a nice demonstration of rule-based formatting (especially the
> DateTimeFormat class)
>
> This code and the interfaces might be a good start for someone working 
> on this
> at a sprint.

Stephan,

Okay, so let's say your interfaces describe the "locale" service.  There 
still needs to be some kind of service that lets applications be 
ignorant of all date and currency formatting, unicode encoding, etc. 
You service doesn't quite reach that goal.  For example, your service 
includes a method getDateTimeFormat(), and the application is expected 
to include all the logic of formatting a datetime accordingly.  But 
applications should not have to work so hard.  Some service needs a 
formatDateTime() method, which does all the work and already knows what 
locale to use.

Since you're claiming the name "locale", I don't know what the other 
service would be called.  I suggest that your service might better be 
called the "i18n" service, since its job is global rather than local.

Shane