domtranslator
v0.0.1
Published
Translate DOM nodes. Package under construction, subscribe on [github page of project](https://github.com/translate-tools/domtranslator).
Downloads
19
Readme
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);