json-autotranslate
Version:
Translate a folder of JSON files containing translations into multiple languages.
26 lines (25 loc) • 901 B
TypeScript
import { TranslationService, TranslationResult } from '.';
import { Matcher } from '../matchers';
export declare class DeepLFree implements TranslationService {
name: string;
private apiKey;
/**
* Number to tokens to translate at once
*/
private batchSize;
private supportedLanguages;
private interpolationMatcher;
private decodeEscapes;
private formality;
initialize(config?: string, interpolationMatcher?: Matcher, decodeEscapes?: boolean): Promise<void>;
fetchLanguages(): Promise<Set<string>>;
supportsLanguage(language: string): boolean;
translateStrings(strings: {
key: string;
value: string;
}[], from: string, to: string): Promise<TranslationResult[]>;
runTranslation(strings: {
key: string;
value: string;
}[], from: string, to: string, triesLeft?: number): Promise<TranslationResult[]>;
}