@jsverse/transloco-keys-manager
Version:
Extract translatable keys from projects that uses Transloco
24 lines (23 loc) • 966 B
TypeScript
import { Config, Scopes } from '../types';
export declare function pathUnixFormat(path: string): string;
export declare function buildPath(obj: Record<string, any>): string[];
interface Options extends Pick<Config, 'fileFormat' | 'translationsPath'> {
filePath: string;
}
/**
* /Users/username/www/folderName/src/assets/i18n/admin/es.json => { scope: admin, lang: es }
* /Users/username/www/folderName/src/assets/i18n/es.json => { scope: undefined, lang: es }
*/
export declare function getScopeAndLangFromPath({ filePath, translationsPath, fileFormat, }: Options): {
scope: string | undefined;
lang: string;
};
export declare function resolveConfigPaths(config: Config): void;
type ScopeFiles = {
path: string;
scope: string;
}[];
export declare function buildScopeFilePaths({ aliasToScope, output, langs, fileFormat, }: Pick<Config, 'output' | 'langs' | 'fileFormat'> & {
aliasToScope: Scopes['aliasToScope'];
}): ScopeFiles;
export {};