@lingui/cli
Version:
Lingui CLI to extract messages, compile catalogs, and manage translation workflows
21 lines (20 loc) • 888 B
JavaScript
import { globSync } from "node:fs";
import { resolveCatalogPath } from "./resolveCatalogPath.js";
import { Catalog } from "../api/catalog.js";
import { resolveTemplatePath } from "./resolveTemplatePath.js";
export async function getExperimentalCatalogs(linguiConfig, format, extractorConfig) {
const config = extractorConfig;
const entryPoints = globSync(config.entries);
return entryPoints.map((entryPoint) => {
const catalogPath = resolveCatalogPath(config.output, entryPoint, linguiConfig.rootDir, undefined, "");
const templatePath = resolveTemplatePath(entryPoint, config.output, linguiConfig.rootDir, format.getTemplateExtension());
return new Catalog({
name: undefined,
path: catalogPath,
templatePath,
include: [],
exclude: [],
format,
}, linguiConfig);
});
}