plural i18n.tr doesn't work as per documentation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu UI Toolkit |
New
|
Medium
|
Tim Peeters |
Bug Description
http://
The doc states:
=======
string i18n::tr(string singular, string plural, int n)
Translate the given input string singular or plural (depending on the number of items n) using gettext. Should be called like this: > tr("%n file", "%n files", count)
But the following snippet:
=======
import QtQuick 2.0
import Ubuntu.Components 0.1
Text {
text: i18n.tr("singular: %n", "plural: %n", 1) + "<br>" + i18n.tr("singular: %n", "plural: %n", 2)
}
Displays:
---------
singular: %n
plural: %n
A simple workaround:
=======
import QtQuick 2.0
import Ubuntu.Components 0.1
Text {
text: i18n.tr("singular: %1", "plural: %1", 1).arg(1) + "<br>" + i18n.tr("singular: %1", "plural: %1", 2).arg(2)
}
Displays, correctly:
-------
singular: 1
plural: 2
description: | updated |
Changed in ubuntu-ui-toolkit: | |
assignee: | nobody → Tim Peeters (tpeeters) |
importance: | Undecided → Medium |