Hi,

The use case is worth a closer look. Today, a translator who'd prefer "Keine
ungelesenen Nachrichten" over "0 ungelesene Nachrichten" can't express that
unless the original developer anticipated it at the application level, and for
applications with a lot of "no items" UI text, that adds up.

That said, I don't think this "zero-form" fits cleanly into the language's 
plural
forms. If a translator leaves it unfilled, falling back to the regular plural 
form is
perfectly acceptable (e.g., "0 ungelesene Nachrichten"). This isn't the case for
any of the other CLDR plural forms, where falling back from an unfilled form to
another form would produce grammatically wrong output. 
More specifically, Arabic has a genuine grammatical zero form, where falling 
back
to the plural would actually be wrong. But in English, if the new "zero-form"
is unfilled, it's perfectly fine to fall back to the plural form.

The way I see it, the right granularity for opting into a zero form is the
message level, not the language level. The same translator who'd write
"Keine ungelesenen Nachrichten" for one string would still want "0 Bytes"
for another. So the choice seems to be per message, rather than per
language. Keeping this at the message level also preserves the CLDR
alignment.

An idea might be to provide a new translation function (or extend the current 
ones)
that handles user-specific rules for plurals before consulting CLDR. This can be
done, for instance, by using ICU MessageFormat, or something similar:

  {count, plural, =0 {No messages} one {# message} other {# messages}}

It would also cover cases where the count selects the form but isn't itself
part of the message, e.g.:

  {count, plural, one {Attachment} other {Attachments}}

Development mailing list
[email protected]
https://lists.qt-project.org/listinfo/development

-- 
Development mailing list
[email protected]
https://lists.qt-project.org/listinfo/development

Reply via email to