![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
google-translate-api
Advanced tools
Readme
A free and unlimited API for Google Translate :dollar::no_entry_sign:
npm install --save google-translate-api
const translate = require('google-translate-api');
translate('Ik spreek Engels', {from: 'auto', to: 'en'}).then(res => {
console.log(res.text);
//=> I speak English
console.log(res.from.language.iso);
//=> nl
});
Returns an object with:
text
(string) – The translated text.from
(object)
language
(object)
didYouMean
(boolean) - Will be true if the API suggest a correction in the source languageiso
(string) - The code of the language that the API has recognized in the text
text
(object)
autoCorrected
(boolean) – Will be true if the API has auto corrected the text
value
(string) – The auto corrected text
or the text
with suggested correctionsdidYouMean
(booelan) – Will be true if the API has suggested corrections to the text
Note that res.from.text
will only be returned if from.text.autoCorrected
or from.text.didYouMean
equals to true
. In this case, it will have the corrections delimited with brackets ([ ]
):
translate('I spea Dutch').then(res => {
console.log(res.from.text.value);
//=> I [speak] Dutch
});
Otherwise, it will be an empty string
(''
).
Type: string
The text to be translated
Type: object
Type: string
Default: 'auto'
The text
language. Must be 'auto'
, ''
(same effect of 'auto'
) or one of the codes contained in languages.js.
Type: string
The language in which the text should be translated. Must be one of the codes contained in languages.js.
vertaler
– CLI for this moduleMIT © Matheus Fernandes
FAQs
A free and unlimited API for Google Translate
The npm package google-translate-api receives a total of 2,251 weekly downloads. As such, google-translate-api popularity was classified as popular.
We found that google-translate-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.