[Development] Alternative plural forms for English (and similar)
Kai Köhne
Kai.Koehne at qt.io
Mon May 4 10:32:14 CEST 2026
Hi Nicolas,
Interesting! I see that, in a lot of UI texts, 0 is indeed a special case. It indeeds feels more natural to say “No files copied” than “0 files copied”.
This is not always the case though. “Distance to target: 0 kilometers” is arguably better than “Distance to target: No kilometers”.
Then there is cases where you might still go for numbers, for instance if it helps keeping things consistent: It’s at least not clear cut that “3 errors, no warnings” is preferred over “3 errors, 0 warnings”.
All in all, I therefore think that the special handling of 0 is a choice that depends on style and context, and not a hard rule defined in the language. As such, I don’t think it would be a good fit for the plural infrastructure we currently have in QTranslator, which is based on objective properties of the languages, as defined e.g. in the CDLR.
Having said that: Do you have ideas how to better support this use case without just changing the plural rules? How would you approach it , keeping in mind that we have to keep backwards compatibility?
Kai
Confidential
From: Development <development-bounces at qt-project.org> on behalf of Nicolas Fella via Development <development at qt-project.org>
Date: Thursday, 30. April 2026 at 20:36
To: development at qt-project.org <development at qt-project.org>
Subject: [Development] Alternative plural forms for English (and similar)
Hi,
it should be pretty well-known that plurals are a complex topic when it
comes to translating. While languages like English and German generally
only distinguish between Singular and Plural, other languages can have
more complex rules. Qt supports all of that, so far so good.
However, even with English or German there are more subtleties involved.
When having zero items of something the plural form is used: "0 unread
messages" is a perfectly grammatical sentence. It often reads nicer to
instead have "No unread messages" instead though. It's possible to
achieve that with Qt by an additional if check and using a different
string, but this doesn't scale with the number of strings to be
translated and might clash with languages with more complex rules.
Instead it would be nice if Qt's translation system supported this
natively. From the translator's point of view this effectively becomes
an additional plural form (n==0). I've had a look at how hard it would
be to extend Qt to support that. It appears that the QtCore side is
flexible enough to handle this and reads the rules from the qm file, so
it's "just" a matter of teaching lupdate/lrelease about the alternative
plural rules. I've successfully hacked those to change the rules for
English-ish languages to achieve this, but it would probably need to be
opt-in in order to not break existing users that don't want this.
Before I spend more time on this, is this something that Qt would be
willing to support/accept? Are there any other considerations that I
should be aware of?
Cheers
Nico
--
Development mailing list
Development at qt-project.org
https://lists.qt-project.org/listinfo/development
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20260504/a0384a0f/attachment-0001.htm>
More information about the Development
mailing list