i18n-pro
Version:
An out-of-the-box, lightweight JavaScript i18n auto-translation solution
28 lines (27 loc) • 930 B
TypeScript
import * as GoogleXTranslate from 'google-translate-api-x';
import { type googleTranslateApi } from 'google-translate-api-x';
import { BasicGooglexConfig } from '../../type';
export declare const proxyGoogleXTranslate: typeof GoogleXTranslate;
declare const config: BasicGooglexConfig;
/**
* 设置翻译配置
* @param configProp
*/
export declare function setGooglexConfig(configProp: typeof config): void;
export declare function translateImpl(props: Pick<typeof config, 'from' | 'proxy'> & {
texts: string[];
to: string;
}): Promise<googleTranslateApi.TranslationResponse[]>;
/**
* 翻译多个文本到单个语言的具体实现
*/
export declare function translateByGooglex(props: {
texts: string[];
from: string;
to: string;
}): Promise<{
success: Record<string, string>;
error: Record<string, string>;
textErrorMsg: Record<string, string[]>;
}>;
export {};