code: function (text, translate) {
          if (translate !== false) {
            text = this.translate(text);
          }
  
          return (text || '').replace(/[&<>"]/g, function (match) {
            return '&#' + match.charCodeAt(0) + ';';
          });
        }
docs: Encodes the specified string with HTML entities. It will also
  translate the string to different languages.
  
  @method encode
  @param {String/Object/Array} text Text to entity encode.
  @param {Boolean} [translate=true] False if the contents shouldn't be translated.
  @return {String} Encoded and possible traslated string.