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

Method visitExpansion

packages/compiler/src/i18n/extractor_merger.ts:161–189  ·  view source on GitHub ↗
(icu: html.Expansion, context: any)

Source from the content-addressed store, hash-verified

159 }
160
161 visitExpansion(icu: html.Expansion, context: any): html.Expansion {
162 this._mayBeAddBlockChildren(icu);
163
164 const wasInIcu = this._inIcu;
165
166 if (!this._inIcu) {
167 // nested ICU messages should not be extracted but top-level translated as a whole
168 if (this._isInTranslatableSection) {
169 this._addMessage([icu]);
170 }
171 this._inIcu = true;
172 }
173
174 const cases = html.visitAll(this, icu.cases, context);
175
176 if (this._mode === _VisitorMode.Merge) {
177 icu = new html.Expansion(
178 icu.switchValue,
179 icu.type,
180 cases,
181 icu.sourceSpan,
182 icu.switchValueSourceSpan,
183 );
184 }
185
186 this._inIcu = wasInIcu;
187
188 return icu;
189 }
190
191 visitComment(comment: html.Comment, context: any): any {
192 const isOpening = _isOpeningComment(comment);

Callers

nothing calls this directly

Calls 3

_addMessageMethod · 0.95
visitAllMethod · 0.45

Tested by

no test coverage detected