@vendure/ngx-translate-extract
Version:
Extract strings from projects using ngx-translate
19 lines (18 loc) • 696 B
JavaScript
import { CompilerType } from './compiler.interface.js';
import { JsonCompiler } from './json.compiler.js';
import { NamespacedJsonCompiler } from './namespaced-json.compiler.js';
import { PoCompiler } from './po.compiler.js';
export class CompilerFactory {
static create(format, options) {
switch (format) {
case CompilerType.Pot:
return new PoCompiler(options);
case CompilerType.Json:
return new JsonCompiler(options);
case CompilerType.NamespacedJson:
return new NamespacedJsonCompiler(options);
default:
throw new Error(`Unknown format: ${format}`);
}
}
}