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

Method convert

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

Source from the content-addressed store, hash-verified

320 private _errors!: ParseError[];
321
322 convert(message: string, url: string) {
323 const xmlIcu = new XmlParser().parse(message, url, {tokenizeExpansionForms: true});
324 this._errors = xmlIcu.errors;
325
326 const i18nNodes =
327 this._errors.length > 0 || xmlIcu.rootNodes.length == 0
328 ? []
329 : [].concat(...ml.visitAll(this, xmlIcu.rootNodes));
330
331 return {
332 i18nNodes: i18nNodes,
333 errors: this._errors,
334 };
335 }
336
337 visitText(text: ml.Text, context: any) {
338 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