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

Method convert

packages/compiler/src/i18n/serializers/xliff.ts:318–331  ·  view source on GitHub ↗
(message: string, url: string)

Source from the content-addressed store, hash-verified

316 private _errors!: ParseError[];
317
318 convert(message: string, url: string) {
319 const xmlIcu = new XmlParser().parse(message, url, {tokenizeExpansionForms: true});
320 this._errors = xmlIcu.errors;
321
322 const i18nNodes =
323 this._errors.length > 0 || xmlIcu.rootNodes.length == 0
324 ? []
325 : [].concat(...ml.visitAll(this, xmlIcu.rootNodes));
326
327 return {
328 i18nNodes: i18nNodes,
329 errors: this._errors,
330 };
331 }
332
333 visitText(text: ml.Text, context: any) {
334 return new i18n.Text(text.value, text.sourceSpan);

Callers 1

loadMethod · 0.95

Calls 2

parseMethod · 0.65
visitAllMethod · 0.45

Tested by

no test coverage detected