How to use linguist - 1 common examples

To help you get started, we’ve selected a few linguist examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ava-ia / core / ava / translators / View on Github external
return new Promise((resolve, reject) => {
    if (state.language.iso === LANGUAGE) return resolve(state);

    const time = new Date();
    Linguist.translate(state.rawSentence, state.language.iso || LANGUAGE, LANGUAGE, (response) => {
      state.language = {
        engine: 'yandex',
        ms: (new Date() - time),
        iso: response.lang,
      state.sentence = response.text[0];


Translate strings or whole JSON files

Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis

Popular linguist functions