Lines Matching refs:literals_
629 if("zh_TW"==goog.LOCALE||"zh-TW"==goog.LOCALE)goog.i18n.pluralRules.select=goog.i18n.pluralRules.defaultSelect_;"zu"==goog.LOCALE&&(goog.i18n.pluralRules.select=goog.i18n.pluralRules.hiSelect_);goog.i18n.MessageFormat=function(a){this.literals_=[];this.parsedPattern_=[];this.numberFormatter_=new goog.i18n.NumberFormat(goog.i18n.NumberFormat.Format.DECIMAL);this.parsePattern_(a)};goog.i18n.MessageFormat.LITERAL_PLACEHOLDER_="\ufddf_";goog.i18n.MessageFormat.Element_={STRING:0,BLOCK:1};goog.i18n.MessageFormat.BlockType_={PLURAL:0,ORDINAL:1,SELECT:2,SIMPLE:3,STRING:4,UNKNOWN:5};goog.i18n.MessageFormat.OTHER_="other";goog.i18n.MessageFormat.REGEX_LITERAL_=/'([{}#].*?)'/g;
630 goog.i18n.MessageFormat.REGEX_DOUBLE_APOSTROPHE_=/''/g;goog.i18n.MessageFormat.prototype.format=function(a){return this.format_(a,!1)};goog.i18n.MessageFormat.prototype.format_=function(a,b){if(0==this.parsedPattern_.length)return"";var c=[];this.formatBlock_(this.parsedPattern_,a,b,c);c=c.join("");for(b||goog.asserts.assert(-1==c.search("#"),"Not all # were replaced.");0<this.literals_.length;)c=c.replace(this.buildPlaceholder_(this.literals_),this.literals_.pop());return c};
632 c,d);break;case goog.i18n.MessageFormat.BlockType_.ORDINAL:f=a[e].value;this.formatPluralOrdinalBlock_(f,b,goog.i18n.ordinalRules.select,c,d);break;default:goog.asserts.fail("Unrecognized block type: "+a[e].type)}};goog.i18n.MessageFormat.prototype.formatSimplePlaceholder_=function(a,b,c){b=b[a];goog.isDef(b)?(this.literals_.push(b),c.push(this.buildPlaceholder_(this.literals_))):c.push("Undefined parameter - "+a)};
636 goog.i18n.MessageFormat.prototype.insertPlaceholders_=function(a){var b=this.literals_,c=goog.bind(this.buildPlaceholder_,this);a=a.replace(goog.i18n.MessageFormat.REGEX_DOUBLE_APOSTROPHE_,function(){b.push("'");return c(b)});return a=a.replace(goog.i18n.MessageFormat.REGEX_LITERAL_,function(a,e){b.push(e);return c(b)})};