Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-azure-translate

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-azure-translate

streaming translation tool using azure's congnitive services

  • 0.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Gulp Azure Translate

Streaming Translation tool using Azure's Cognitive Services

Installation

You know the drill...

$ npm i gulp-azure-translate

Setup

To use this tool, you'll first need to create an instance of Microsoft Azure's Cognitive Services in your Azure account.

This plugin calls the v3 translate api.

Api

translateAzure(config)

The config is an object consisting of:

  • apiKey - required string - the api key from your azure congnitive services instance
  • region - required string - the region from your azure congnitive services instance
  • toLangs - required string[] - array of locale codes to translate the source content to
  • fromLang - optional string - the locale code that will be used as the source language (default: determined)
  • slowMode - optional boolean - requests all translations in series. (default: false)
  • showErrors - optional boolean - displays network errors when encountered. (default false)

Note: apiKey and region are values from the Congnitive Services instance you create in your Azure account. Once created, Check the "Keys and Endpoint" tab to get these values.

A list of supported languages can be found here.

Example Gulp Usage

Gulpfile
// gulpfile.js
const { task } = require('gulp');
const translateAzure = require('gulp-azure-translate');

task('translate', () => {
  return src(['src/en.json'])
    .pipe(translateAzure({
      apiKey: '00000000-00000000-00000000-00000000-0000000000',
      region: 'eastus',
      fromLang: 'en',
      toLangs: ['es', 'ja']
    }))
    .pipe(dest(`./src/translations`))
})
Source Language File
// src/en.json
{
  "org": "Organization",
  "currOrg": "Current Organization",
  "account": "Account"
}
Language Ouptut File(s)
// src/translations/es.json
{
  "org": "Organización",
  "currOrg": "Organización actual",
  "account": "Cuenta"
}
// src/translations/ja.json
{
  "org": "組織",
  "currOrg": "現在の組織",
  "account": "アカウント"
}

Keywords

FAQs

Package last updated on 19 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc