On Wed, May 11, 2022 at 7:24 AM Temuri Doghonadze
<temuri.doghonadze(a)gmail.com> wrote:
Hello,
Just finished translation of oVirt to Georgian and noticed something weird.
On landing page of admin interface, after logging in, there is
"Clusters" link, showing number of clusters in DC. But in Zanata it's
not translated as "%1 Clusters", but just "Clusters", which makes
whole thing look silly when translated to Georgian.
Yes. This actually can be incorrect in all (most?) languages - the
label is always (one kind of) plural regardless of the number.
However you will find many more cases like this - especially in Web
Admin which is GWT-based. In general Ovirt is not 100% i18n ready.
Quote from wiki:
"The plural suffix is not used when the noun is preceded by a
quantifier of some kind, such as a cardinal number."
(
https://en.wikipedia.org/wiki/Georgian_grammar#Pluralisation )
With technical terms, see here.
https://docs.translatehouse.org/projects/localization-guide/en/latest/l10...
Georgian: "nplurals=1; plural=0;"
Details:
oVirt version: master,
zanata module name: ovirt-engine-ui-extensions
file ID: extra/messages/src/messages.json
Can this be fixed?
IIUC the label should always stay singular, right? Then the easiest
workaround is to translate it as such.
Label 'dashboard.statusCardClusterTitle' as the name suggests is used
only in that one place so this is safe.
The proper solution for all languages would be to make the translation
layer aware of the items count. Here (and only here) it's doable:
dashboard is part of the UI Extensions project that uses a modern
translation library which covers all kinds of border cases including
different plurals. We use this syntax [1] i.e. for
'cluster.upgrade.HostsLabel' [2]. Your message would look like
'{count, plural, one {Cluster} other {Cluster}}'. Small changes in the
code would also be required to pass the number. We could also include
the number as you suggested ( "%1 Clusters") but then we lose the
current CSS styling which relies on splitting number and text.
best regards,
radek
[1]
https://formatjs.io/docs/intl-messageformat/#common-usage-example
[2]
https://github.com/oVirt/ovirt-engine-ui-extensions/blob/c2d7e2832a0223ec...