json-autotranslate
Version:
Translate a folder of JSON files containing translations into multiple languages.
20 lines (19 loc) • 600 B
TypeScript
import { Matcher } from '../matchers';
export interface TranslationResult {
key: string;
value: string;
translated: string;
}
export interface TString {
key: string;
value: string;
}
export interface TranslationService {
name: string;
initialize: (config?: string, interpolationMatcher?: Matcher, decodeEscapes?: boolean) => Promise<void>;
supportsLanguage: (language: string) => boolean;
translateStrings: (strings: TString[], from: string, to: string) => Promise<TranslationResult[]>;
}
export declare const serviceMap: {
[k: string]: TranslationService;
};