New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

detect-translation

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

detect-translation

Trigger code when people translate your website

Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

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

FAQs

Package last updated on 30 Mar 2020

Related posts