Skip to content

translate-tools/domtranslator

Repository files navigation

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