bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: doc: recommend avoiding ngettext() when not formatting the count


From: Bruno Haible
Subject: Re: doc: recommend avoiding ngettext() when not formatting the count
Date: Mon, 10 Feb 2025 08:53:46 +0100

Hello,

Ivan Krylov wrote:
> Currently, the ngettext() documentation suggests the possibility to use
> ngettext() to choose between the singular and the plural form of the
> message [*]:
> 
> >> It is also possible to use this function when the strings don’t
> >> contain a cardinal number:
> >> 
> >> puts (ngettext ("Delete the selected file?",
> >>                 "Delete the selected files?",
> >>                 n));
> >> 
> >> In this case the number n is only used to choose the plural form. 
> 
> As briefly discussed on IRC, such use at best leads to duplication of
> generic plural translations in languages with multiple plural forms and
> at worst may prevent the correct use of singular translations. For
> example, in certain Slavic languages, the n==1 case is included in the
> more generic n%10==1 && n%100!=11 count form, so there is no way to
> differentiate n==1 without rewriting the rest of the *.po file in a
> non-standard manner.
> 
> Attached is a suggestion for how the gettext manual could be edited to
> warn against such use.

Thanks. You are entirely right.

I've applied your patch, with a few wording edits from me.
https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commitdiff;h=26d59b5d16320ba2af07be4e12f5fce5f9ca8fab

Bruno






reply via email to

[Prev in Thread] Current Thread [Next in Thread]