Re: [PATCH v2 2/7] strbuf: split out logic to humanise byte values
- From
Jiang Xin <worldhello.net@gmail.com>
- Date
- Dec 16, 2025, 02:26 UTC
- Message-ID
- <CANYiYbE3Tx6B5L5rEoDue7hTYzFGxw_qA-MRpC9RSxQ7HRczaw@mail.gmail.com>
- In-Reply-To
- <20251212223644.3090879-3-jltobler@gmail.com>
On Sat, Dec 13, 2025 at 6:37 AM Justin Tobler <jltobler@gmail.com> wrote:
Show 5 quoted lines
> + return humanise_rate ?
> + /* TRANSLATORS: IEC 80000-13:2008 byte/second */
> + xstrfmt(Q_("byte/s", "bytes/s", bytes)) :
> + /* TRANSLATORS: IEC 80000-13:2008 byte */
> + xstrfmt(Q_("byte", "bytes", bytes));We have already defined "byte" as a 10n string without plural forms in the file "t/helper/test-simple-ipc.c" via commit 36a7eb6876 (t0052: add simple-ipc tests and t/helper/test-simple-ipc tool, 2021-03-22 10:29:48 +0000).
OPT_STRING(0, "byte", &bytevalue, N_("byte"), N_("ballast character")),The newly introduced usage of "byte" is now marked as having a plural form (via Q_("byte", "bytes", bytes)), which causes a conflict. This results in make pot failing with the following error:
msgcat: msgid 'byte' is used without plural and with plural.
This happens because gettext requires that a given msgid be treated consistently—either exclusively as a singular string or as part of a plural construct—but not both.
To resolve this conflict, we can unmark the singular "byte" in t/helper/test-simple-ipc.c, allowing it to reuse the translation from the plural-form definition of "byte".
-- Jiang Xin