]> granicus.if.org Git - transmission/commitdiff
(trunk, web) #5072 "web client doesn't show webseed count" -- pluralization refinemen...
authorJordan Lee <jordan@transmissionbt.com>
Sun, 7 Oct 2012 16:33:55 +0000 (16:33 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Sun, 7 Oct 2012 16:33:55 +0000 (16:33 +0000)
web/javascript/torrent-row.js

index 7ce4a02295cf5cf4572b1b4179ab0ddac32c3bcc..1e761cced4157aabc20f9b25c5b2d08ac0dc9a88 100644 (file)
@@ -148,21 +148,33 @@ TorrentRendererFull.prototype =
 
        getPeerDetails: function(t)
        {
-               var err;
+               var err, webseed_count;
+
                if ((err = t.getErrorMessage()))
                        return err;
 
                if (t.isDownloading())
-                       return [ 'Downloading from',
-                                t.getPeersSendingToUs(),
-                                'of',
-                                t.getPeersConnected(),
-                                'peers',
-                                ' and ',
-                                t.getWebseedsSendingToUs(),
-                                'webseeds',                                     
-                                TorrentRendererHelper.formatDL(t),
-                                TorrentRendererHelper.formatUL(t) ].join(' ');
+               {
+                       webseed_count = t.getWebseedsSendingToUs();
+
+                       if (webseed_count)
+                       {
+                               return [ 'Downloading from',
+                                        t.getPeersSendingToUs(),
+                                        'of',
+                                        t.getPeersConnected(),
+                                        'peers and',
+                                        Transmission.fmt.plural (webseed_count, 'webseed') ].join(' ');
+                       }
+                       else
+                       {
+                               return [ 'Downloading from',
+                                        t.getPeersSendingToUs(),
+                                        'of',
+                                        t.getPeersConnected(),
+                                        'peers' ].join(' ');
+                       }
+               }
 
                if (t.isSeeding())
                        return [ 'Seeding to',