nunjucks-translation
Version:
Nunjucks Extension and Filter for Translation
21 lines (20 loc) • 696 B
TypeScript
import { Extension, runtime } from 'nunjucks';
import SafeString = runtime.SafeString;
export declare class TranslationExtension implements Extension {
private readonly options;
constructor(options?: TranslationExtensionOptions);
get tags(): string[];
parse(parser: any, nodes: any, lexer: any): any;
trans(...args: any): SafeString;
translateText(textId: string, locale: string, params: object): string;
private escapeRegExp;
private replaceAll;
private translationExistsForLocale;
private selectLocale;
private getPathValue;
}
export interface TranslationExtensionOptions {
translations: object;
locale: string;
fallbackLocale: string;
}