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

Method toI18nMessage

packages/compiler/src/i18n/i18n_parser.ts:72–98  ·  view source on GitHub ↗
(
    nodes: html.Node[],
    meaning = '',
    description = '',
    customId = '',
    visitNodeFn: VisitNodeFn | undefined,
  )

Source from the content-addressed store, hash-verified

70 ) {}
71
72 public toI18nMessage(
73 nodes: html.Node[],
74 meaning = '',
75 description = '',
76 customId = '',
77 visitNodeFn: VisitNodeFn | undefined,
78 ): i18n.Message {
79 const context: I18nMessageVisitorContext = {
80 isIcu: nodes.length == 1 && nodes[0] instanceof html.Expansion,
81 icuDepth: 0,
82 placeholderRegistry: new PlaceholderRegistry(),
83 placeholderToContent: {},
84 placeholderToMessage: {},
85 visitNodeFn: visitNodeFn || noopVisitNodeFn,
86 };
87
88 const i18nodes: i18n.Node[] = html.visitAll(this, nodes, context);
89
90 return new i18n.Message(
91 i18nodes,
92 context.placeholderToContent,
93 context.placeholderToMessage,
94 meaning,
95 description,
96 customId,
97 );
98 }
99
100 visitElement(el: html.Element, context: I18nMessageVisitorContext): i18n.Node {
101 return this._visitElementLike(el, context);

Callers 2

createI18nMessageFactoryFunction · 0.95
visitExpansionMethod · 0.95

Calls 1

visitAllMethod · 0.45

Tested by

no test coverage detected