MCPcopy Create free account
hub / github.com/angular/angular / _addMessage

Method _addMessage

packages/compiler/src/i18n/extractor_merger.ts:390–405  ·  view source on GitHub ↗
(ast: html.Node[], msgMeta?: string)

Source from the content-addressed store, hash-verified

388
389 // add a translatable message
390 private _addMessage(ast: html.Node[], msgMeta?: string): i18n.Message | null {
391 if (
392 ast.length == 0 ||
393 this._isEmptyAttributeValue(ast) ||
394 this._isPlaceholderOnlyAttributeValue(ast) ||
395 this._isPlaceholderOnlyMessage(ast)
396 ) {
397 // Do not create empty messages
398 return null;
399 }
400
401 const {meaning, description, id} = _parseMessageMeta(msgMeta);
402 const message = this._createI18nMessage(ast, meaning, description, id);
403 this._messages.push(message);
404 return message;
405 }
406
407 // Check for cases like `<div i18n-title title="">`.
408 private _isEmptyAttributeValue(ast: html.Node[]): boolean {

Callers 4

visitExpansionMethod · 0.95
visitCommentMethod · 0.95
_visitElementLikeMethod · 0.95
_visitAttributesOfMethod · 0.95

Calls 5

_parseMessageMetaFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected