User:RainbowSpike/global.js

function getNumEnding(iNumber, aEndings) { var sEnding, i; iNumber = iNumber % 100; if (iNumber >= 11 && iNumber <= 19) { sEnding=aEndings[2]; } else { i = iNumber % 10; switch (i) { case (1): sEnding = aEndings[0]; break; case (2): case (3): case (4): sEnding = aEndings[1]; break; default: sEnding = aEndings[2]; } } return sEnding; }

var value = document.getElementsByClassName("wds-community-header__counter-value")[0].innerHTML * 1, label = document.getElementsByClassName("wds-community-header__counter-label")[0],lin = label.innerHTML, line = ['Cтраница','Cтраницы','Cтраниц'], nword = getNumEnding(value,line); label.innerHTML = lin.replace(lin,nword);