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

Method _translateMessage

packages/compiler/src/i18n/extractor_merger.ts:452–467  ·  view source on GitHub ↗
(el: html.Node, message: i18n.Message)

Source from the content-addressed store, hash-verified

450 // This is used for translating elements / blocks - see `_translateAttributes` for attributes
451 // no-op when called in extraction mode (returns [])
452 private _translateMessage(el: html.Node, message: i18n.Message): html.Node[] {
453 if (message && this._mode === _VisitorMode.Merge) {
454 const nodes = this._translations.get(message);
455
456 if (nodes) {
457 return nodes;
458 }
459
460 this._reportError(
461 el,
462 `Translation unavailable for message id="${this._translations.digest(message)}"`,
463 );
464 }
465
466 return [];
467 }
468
469 // translate the attributes of an element and remove i18n specific attributes
470 private _translateAttributes(node: html.Element): html.Attribute[] {

Callers 2

visitCommentMethod · 0.95
_visitElementLikeMethod · 0.95

Calls 3

_reportErrorMethod · 0.95
getMethod · 0.65
digestMethod · 0.45

Tested by

no test coverage detected