Javascript String localize()

Description

Javascript String localize()


String.prototype.localize = function () {
    var s = localization[this];
    if (!s) return (  "!" + this + "!"  );
    for (var i = 0; i < arguments.length; i++) {
        s = s.replace("{" + i + "}", arguments[i]);
    }/*from  ww  w .j  av  a 2 s . c om*/
    return s;
}



PreviousNext

Related