Hi,

On Wed, May 11, 2022 at 3:15 PM Radoslaw Szwajkowski <rszwajko@redhat.com> wrote:
On Wed, May 11, 2022 at 7:24 AM Temuri Doghonadze
<temuri.doghonadze@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/l10n/pluralforms.html?id=l10n/pluralform
>
> 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.

This solution of no distinction between the singular and plural forms is currently used by RHV for other locales as well (e.g. Japanese, Korean) and AFAIK we didn't hear any complaints about that, so I guess that using the singular label is the correct solution to use here for Georgian as well.

 

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.

And also it won't be compatible with other GWT-based places where we won't be able to easily fix so it can be done only if required.

Anyway, adding @Terry Chuang for his input on this.

 

best regards,
radek

[1] https://formatjs.io/docs/intl-messageformat/#common-usage-example
[2] https://github.com/oVirt/ovirt-engine-ui-extensions/blob/c2d7e2832a0223ece0b90c35a7521d613fcd36ab/src/intl/messages.js#L651
_______________________________________________
Devel mailing list -- devel@ovirt.org
To unsubscribe send an email to devel-leave@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/
List Archives: https://lists.ovirt.org/archives/list/devel@ovirt.org/message/EFSDZCU4EKV42JVS4JIDHJTN37WHN3G6/