Need to provide access to the count of items for translations to work

Bug #1261798 reported by David Planella
This bug report is a duplicate of:  Bug #1363386: Use plural forms where appropriate. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libusermetrics (Ubuntu)
New
Undecided
Unassigned

Bug Description

Unlike English (and Spanish, Italian and other ones), some languages have multiple plural forms, which the SDK supports using the i18n.tr() call in QML. One example with multiple plural forms is Arabic.

For this to work, we need to access the actual count of items and pass it to the i18n.tr() function, e.g.

format: i18n.tr("%1 song played today", "%1 songs played today", songCount).arg(songCount) (*)

But it seems libusermetrics is not making the count accessible to QML, hence this request to make the count available.

(*) Note: the syntax is slightly redundant right now, but it works. See bug 1184810

David Planella (dpm)
description: updated
Revision history for this message
Victor Thompson (vthompson) wrote :

I don't think it's necessarily desirable to expose the count to the app. It might be best and the most privacy-centric to introduce a "singularFormat" to compliment the current "format" and "emptyFormat". It also is probably easier to implement.

Revision history for this message
David Planella (dpm) wrote :

While that makes sense, then we'd need to make libusermetrics invoke gettext behind the scenes with the right syntax and count, but most importantly, we'd wouldn't be able to extract the "singularFormat" and "format" translatable strings from the QML files in a way that they'd be merged in a plural gettext message. We'd need some sort of script on top of xgettext to detect they are part of libusermetrics and that they together form a plural message.

I think the easiest would be to simply expose the count.

Pete Woods (pete-woods)
no longer affects: libusermetrics
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.