Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 456 Bytes

README.md

File metadata and controls

16 lines (11 loc) · 456 Bytes

Translate DOM nodes. Package under construction, subscribe on github page of project.

Usage

Install with npm install domtranslator

import { NodesTranslator } from 'domtranslator';

// Dummy translator
const translator = async (text) => '[translated] ' + text;
const domTranslator = new NodesTranslator(translator);

// Translate document
domTranslator.observe(document.documentElement);