MCPcopy Index your code
hub / github.com/angular/angular / _addMessage

Method _addMessage

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

Source from the content-addressed store, hash-verified

417
418 // add a translatable message
419 private _addMessage(ast: html.Node[], msgMeta?: string): i18n.Message | null {
420 if (
421 ast.length == 0 ||
422 this._isEmptyAttributeValue(ast) ||
423 this._isPlaceholderOnlyAttributeValue(ast) ||
424 this._isPlaceholderOnlyMessage(ast)
425 ) {
426 // Do not create empty messages
427 return null;
428 }
429
430 const {meaning, description, id} = _parseMessageMeta(msgMeta);
431 const message = this._createI18nMessage(ast, meaning, description, id);
432 this._messages.push(message);
433 return message;
434 }
435
436 // Check for cases like `<div i18n-title title="">`.
437 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