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

Function i18nSerialize

packages/compiler-cli/src/transformers/i18n.ts:50–73  ·  view source on GitHub ↗
(
  bundle: MessageBundle,
  formatName: string,
  options: CompilerOptions,
)

Source from the content-addressed store, hash-verified

48}
49
50export function i18nSerialize(
51 bundle: MessageBundle,
52 formatName: string,
53 options: CompilerOptions,
54): string {
55 const format = formatName.toLowerCase();
56 let serializer: Serializer;
57
58 switch (format) {
59 case 'xmb':
60 serializer = new Xmb();
61 break;
62 case 'xliff2':
63 case 'xlf2':
64 serializer = new Xliff2();
65 break;
66 case 'xlf':
67 case 'xliff':
68 default:
69 serializer = new Xliff();
70 }
71
72 return bundle.write(serializer, getPathNormalizer(options.basePath));
73}
74
75function getPathNormalizer(basePath?: string) {
76 // normalize source paths by removing the base path and always using "/" as a separator

Callers 1

i18nExtractFunction · 0.85

Calls 2

getPathNormalizerFunction · 0.85
writeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…