Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kentonishi/iframe-translator
Translate text for free in the browser with iframe shenanigans
https://github.com/kentonishi/iframe-translator
Last synced: 19 days ago
JSON representation
Translate text for free in the browser with iframe shenanigans
- Host: GitHub
- URL: https://github.com/kentonishi/iframe-translator
- Owner: KentoNishi
- License: mit
- Created: 2022-01-13T21:58:49.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-10-10T21:01:48.000Z (about 1 month ago)
- Last Synced: 2024-10-12T04:28:30.211Z (about 1 month ago)
- Language: TypeScript
- Homepage:
- Size: 108 KB
- Stars: 8
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# iframe-translator
Translate text for free in the browser with iframe shenanigans
![Status: Normal](https://img.shields.io/badge/Status-Normal-green)
[![View on npm](https://img.shields.io/npm/v/iframe-translator)](https://www.npmjs.com/package/iframe-translator)
[![Publish Package](https://github.com/KentoNishi/iframe-translator/actions/workflows/package.yaml/badge.svg)](https://github.com/KentoNishi/iframe-translator/actions/workflows/package.yaml)
[![Deploy Frontend](https://github.com/KentoNishi/iframe-translator/actions/workflows/pages.yaml/badge.svg)](https://github.com/KentoNishi/iframe-translator/actions/workflows/pages.yaml)[View on npm](https://www.npmjs.com/package/iframe-translator)
## Installation
```shell
npm i iframe-translator
```## Usage
### General Usage
```ts
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
```ts
import type { AvailableLanguageCodes, IframeTranslatorClient } from 'iframe-translator';
```