Boost logo

Boost :

Subject: Re: [boost] [locale] Formal review of Boost.Locale library starts tomorrow
From: Fabio Fracassi (f.fracassi_at_[hidden])
Date: 2011-04-17 11:00:17


On 16/4/2011 15:29, Artyom wrote:

>> So I do not expect you to write such a thing, but if someone did I'd
>> expect you to integrate it. By the way, can you "guesstimate" how much
>> work it would take?
>>
>
> I have no idea, for example to handle XLIFF format
> it is required to have... an XML parser so I don't know
> what would it take.
>

I understand that it is hard, so let me ask another question, if the
gettext loading support was missing, how much time would someone need to
implement it. Ballpark figure is enough (a day, a week, a month?).

>> Your docs do not say what happens when I do this:
>> locale::format("Today is {1}.") % date(d)
>> I'd expect it to work and give the date in some sensible default formatting.

Can you answer the question above?

>>
>> I'd hate if we had to do something like this:
>>
>> boost::format("Sensor Value (at %1%): %2$.2%") %
>> (locale::format("{1,date_time}") % date) % value
>>
>
> You can just do boost::locale::format("Sensor Value (at {1,dt}): {2,p=2}")

Thats great, so it should be easy to integrate locale::format and
boost::format, shouldn't it?

>> Minimally I'd expect
>>
>> boost::date_time dt = ...;
>> locale::format("Today is {1,date}.") % dt
>> to work.
>>
>
> There are several problems:
>
> 1. boost::date_time has its own formatter facets and they can't
> be overridden
> 2. The use of locale facets in Boost.DateTime is quite incorrect.
>

Ok I'd settle for this:

boost::date_time dt = ...;
boost::locale::date_time ldt = dt;
locale::format("Today is {1,date}.") % ldt

or
locale::format("Today is {1,date}.") % locale::date_time(dt)

> It is not that simple.
>
> I think it can be worked out together with cooperation
> of Boost.DateTime author/maintainer.
>

Yes, that was kind of the Idea.

Regards

Fabio


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk