(trunk, web) replace Transmission.formatter.plural() with a slightly less brittle pluralization tool

This commit is contained in:
Jordan Lee
2012-10-07 18:10:26 +00:00
parent 7219f26dae
commit 4dd6e35bd7
4 changed files with 15 additions and 9 deletions

View File

@@ -268,9 +268,15 @@ Transmission.fmt = (function()
return [date, time, period].join(' ');
},
plural: function(i, word)
ngettext: function(msgid, msgid_plural, n)
{
return [ i.toStringWithCommas(), ' ', word, (i==1?'':'s') ].join('');
// TODO(i18n): http://doc.qt.digia.com/4.6/i18n-plural-rules.html
return n === 1 ? msgid : msgid_plural;
},
countString: function(msgid, msgid_plural, n)
{
return [ n.toStringWithCommas(), ngettext(msgid,msgid_plural,n) ].join(' ');
},
peerStatus: function( flagStr )