public inbox for [email protected]  
help / color / mirror / Atom feed
From: Peter Eisentraut <[email protected]>
To: Nathan Bossart <[email protected]>
To: Gilles Darold <[email protected]>
Cc: Zsolt Parragi <[email protected]>
Cc: Japin Li <[email protected]>
Cc: Yuefei Shi <[email protected]>
Cc: songjinzhou <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: Andrew Dunstan <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: liu xiaohui <[email protected]>
Cc: Steven Niu <[email protected]>
Subject: Re: Pasword expiration warning
Date: Wed, 4 Feb 2026 15:44:05 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <aYIUMbyDWobSi94m@nathan>
References: <[email protected]>
	<CAN4CZFMBj-mZq_o8BtQz_TgqDTALbn31kc-SFtWE4FR1N-4RBw@mail.gmail.com>
	<MEAPR01MB3031CF12043573A245D931AAB69EA@MEAPR01MB3031.ausprd01.prod.outlook.com>
	<CAN4CZFP4AGeO-AynwE3e62XOKqaYnXtcGT1qfj=6nw2t5FOXwA@mail.gmail.com>
	<aXuehKtwtUXWVFYp@nathan>
	<[email protected]>
	<aYDZA3r3lG2oKc5D@nathan>
	<[email protected]>
	<aYDlAhyYkjaEoEm7@nathan>
	<aYEJhk83XAqk76dP@nathan>
	<aYIUMbyDWobSi94m@nathan>

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.








view thread (27+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Pasword expiration warning
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox