iframe-translator
v0.3.7
Published
Translate text for free in the browser with iframe shenanigans
Downloads
169
Readme
iframe-translator
Translate text for free in the browser with iframe shenanigans
Installation
npm i iframe-translator
Usage
General Usage
import { getClient, AvailableLanguages } from 'iframe-translator';
async function main() {
const client = await getClient();
console.log(AvailableLanguages); // { 'af': 'Afrikaans', ... }
console.log(await client.translate('こんにちは')); // hello
console.log(await client.translate('こんにちは', 'ko')); // 안녕하세요
client.destroy();
}
Type Definitions
import type { AvailableLanguageCodes, IframeTranslatorClient } from 'iframe-translator';