C++ Logo

std-proposals

Advanced search

Re: [std-proposals] New draft proposal: Add "%s" (two-digit truncated-integer seconds) as a std::format conversion specifier for std::chrono time types.

From: Thiago Macieira <thiago_at_[hidden]>
Date: Wed, 03 May 2023 21:08:44 -0700
On Wednesday, 3 May 2023 16:16:34 PDT Jason McKesson via Std-Proposals wrote:
> format` is supposed to be able to be used for strings that are
> non-local. Exactly why they're there isn't really the point. The point
> is that the string gets to have a lot of control over the formatting.
> You can remap the position of the arguments relative to the format.
> You can apply different formatting controls. Etc.
>
> If it's OK for one string to have hours/minutes and one string to have
> hours/minutes/seconds, then one should also be able to control the
> precision of those seconds. That's just what formats *do*. One format
> can have floating-point values with 3 digits of significance, another
> can use 5. You don't have to modify the *value* to get that.

I understand the theory (more or less).

I'm asking about practice: does this occur? When a localisable string
containing a date or time format is translated, do translators really suppress
fields or change precision? Translators I know don't usually know this level of
detail o the application: if the application asked to print fractional
seconds, they won't doubt the need. This also goes for seconds: I don't know
translators that see a time with hour, minutes and seconds and then suppress
the seconds in their translations.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DCAI Cloud Engineering

Received on 2023-05-04 04:08:46