diff --git a/src/locales/en.json b/src/locales/en.json index 986642055..043929e47 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -96,8 +96,7 @@ "timeslider.month.october": "October", "timeslider.month.november": "November", "timeslider.month.december": "December", - "timeslider.unnamedauthor": "{{num}} unnamed author", - "timeslider.unnamedauthors": "{{num}} unnamed authors", + "timeslider.unnamedauthors": "{{num}} unnamed {[plural(num) one: author, other: authors ]}", "pad.savedrevs.marked": "This revision is now marked as a saved revision", "pad.userlist.entername": "Enter your name", "pad.userlist.unnamed": "unnamed", diff --git a/src/static/js/broadcast_slider.js b/src/static/js/broadcast_slider.js index 9427c1914..73f352f86 100644 --- a/src/static/js/broadcast_slider.js +++ b/src/static/js/broadcast_slider.js @@ -198,11 +198,7 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded) }); if (numAnonymous > 0) { - var anonymousAuthorString; - if(numAnonymous == 1) - anonymousAuthorString = html10n.get("timeslider.unnamedauthor", { num: numAnonymous }); - else - anonymousAuthorString = html10n.get("timeslider.unnamedauthors", { num: numAnonymous }); + var anonymousAuthorString = html10n.get("timeslider.unnamedauthors", { num: numAnonymous }); if (numNamed !== 0){ authorsList.append(' + ' + anonymousAuthorString); diff --git a/src/static/js/html10n.js b/src/static/js/html10n.js index 90d51e221..bee1fef38 100644 --- a/src/static/js/html10n.js +++ b/src/static/js/html10n.js @@ -46,7 +46,20 @@ window.html10n = (function(window, document, undefined) { , consoleError = interceptConsole('warn') - // fix Array.prototype.instanceOf in, guess what, IE! <3 + // fix Array#forEach in IE + // taken from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach + if (!Array.prototype.forEach) { + Array.prototype.forEach = function(fn, scope) { + for(var i = 0, len = this.length; i < len; ++i) { + if (i in this) { + fn.call(scope, this[i], i, this); + } + } + }; + } + + // fix Array#indexOf in, guess what, IE! <3 + // taken from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf if (!Array.prototype.indexOf) { Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) { "use strict"; @@ -79,15 +92,6 @@ window.html10n = (function(window, document, undefined) { return -1; } } - - // fix Array.prototype.forEach in IE - if (!('forEach' in Array.prototype)) { - Array.prototype.forEach= function(action, that /*opt*/) { - for (var i= 0, n= this.length; i