On 03.02.26 16:28, Nathan Bossart wrote:
+ detail = psprintf(_("The password for role \"%s\" will
expire in "
+ INT64_FORMAT "
day(s), " INT64_FORMAT
+ " hour(s), " INT64_FORMAT
" minute(s)."),
+ role, days, hours,
minutes);
You cannot use INT64_FORMAT inside translatable messages. But you can
use PRId64.
Using the type TimestampTz for what are essentially interval/duration
quantities is a bit weird and confusing. So maybe another placeholder
would be more appropriate.
That said, I find writing plurals with "(s)" kind of lame. It's not a
good look.
It's a bit difficult to do this correctly when you have three separate
values in one string. I would consider for example just showing the
number of days if the value is larger than one day, number hours if it's
larger than one hour, else minutes. I don't think you need
minute-precision when the expiration time is several days out.
Alternatively, just print the actual expiration timestamp.