qwik-speak
Version:
Internationalization (i18n) library to translate texts, dates and numbers in Qwik apps
79 lines (74 loc) • 1.97 kB
TypeScript
/**
* Deep merge missing translations in place
*/
export declare function deepMergeMissing(target: Translation, source: Translation): void;
/**
* Extract translations from source files
*/
export declare function qwikSpeakExtract(options: QwikSpeakExtractOptions): Promise<void>;
/**
* Qwik Speak Extract Options
*/
export declare interface QwikSpeakExtractOptions {
/**
* The base path. Default to './'
*/
basePath?: string;
/**
* Paths to files to search for translations. Default to 'src'
*/
sourceFilesPaths?: string[];
/**
* Paths to exclude
*/
excludedPaths?: string[];
/**
* Path to translation files: [basePath]/[assetsPath]/[lang]/*.json. Default to 'i18n'
*/
assetsPath?: string;
/**
* The format of the translation files. Default to 'json'
*/
format?: 'json';
/**
* Filename for not scoped translations. Default is 'app'
*/
filename?: string;
/**
* Supported langs. Required
*/
supportedLangs: string[];
/**
* Optional function to implement a fallback strategy
*/
fallback?: (translation: Translation) => Translation;
/**
* Separator of nested keys. Default is '.'
*/
keySeparator?: string;
/**
* Key-value separator. Default is '@@'
*/
keyValueSeparator?: string;
/**
* Automatically handle keys for each string. Default is false.
* Make sure to set autoKeys: true in the vite plugin options for qwik inline
*/
autoKeys?: boolean;
/**
* Automatically remove unused keys from assets,
* except in runtime assets
*/
unusedKeys?: boolean;
/**
* Comma-separated list of runtime assets to preserve
*/
runtimeAssets?: string[];
}
/**
* Translation data
*/
export declare type Translation = {
[key: string]: any;
};
export { }