Skip to content

sternelee/translator-worker

Repository files navigation

translator-worker

前端实现页面翻译,从 Traduzir-paginas-web 插件 提取而来

使用

import translator from '@sternelee/translator-worker'

window.onload = async function () {
  // 翻译全文
  translator.translatePage("zh");

  // 翻译文本
  const txt = await translator.translateText("google", "zh", "I Love Code");

  // 恢复
  setTimeout(() => {
    translator.restorePage()
  }, 5000)
}

About

从Traduzir-paginas-web转变而来的ts前端翻译库

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages