detect-translation
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

detect-translation

This package attempts to detect when a website was translated on the client (using, for example, Google Translate in Chrome) or via a proxy (like using translate.google.com directly).

npm version Build Status

Installation

yarn add detect-translation

You can use npm if you prefer

The package was written in Typescript, so no need to install types separately.


Example Usage

import { observe } from 'detect-translation';
 
observe({
  onClient: (service, lang) => {
    console.log(`Client translation using ${service}, language ${lang}`);
  },
  onProxy: (service, lang) => {
    console.log(`Proxy translation using ${service}, language ${lang}`);
  }
});

detect-translation can currently detect the following services:

lang is the value of the <html> lang attribute - this gets set by the translation service.


MIT @ Claudiu Ceia

/detect-translation/

    Package Sidebar

    Install

    npm i detect-translation

    Weekly Downloads

    7

    Version

    0.0.4

    License

    MIT

    Unpacked Size

    22.2 kB

    Total Files

    28

    Last publish

    Collaborators

    • claudiu.ceia
    • duncanmacweb