Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 1.33 KB

README.md

File metadata and controls

36 lines (28 loc) · 1.33 KB

iframe-translator

Translate text for free in the browser with iframe shenanigans

Status: Normal

View on npm Publish Package Deploy Frontend

View on npm

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';