
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
translate-google
Advanced tools
A free and unlimited for Google Translate, Multi-translation support object input
free google translate
npm install --save translate-google
Perfect support object:
const translate = require('translate-google')
const tranObj = {
a: 1,
b: '1',
c: "How are you?\nI'm nice.",
d: [true, 'true', 'hi', { a: 'hello', b: ['world']}],
}
translate(tranObj, {to: 'zh-cn', except:['a']}).then(res => {
console.log(res)
}).catch(err => {
console.error(err)
})
// => { a: 1, b: '1', c: "你好吗?\n我很好。", d: [true, 'true', '嗨', { a: 'hello', b: ['世界']}] }
From automatic language detection to English:
const translate = require('translate-google')
translate('I speak Chinese', {to: 'zh-cn'}).then(res => {
console.log(res)
}).catch(err => {
console.error(err)
})
From English to Dutch with a typo:
translate('I speak Chinese!', {from: 'en', to: 'zh-cn'}).then(res => {
console.log(res)
}).catch(err => {
console.error(err)
})
translate for array or object:
translate({a: 'I speak Chinese!', b: ['hello', 'world']}, {from: 'en', to: 'zh-cn'}).then(res => {
console.log(res)
}).catch(err => {
console.error(err)
})
Type: string, object, array
The text to be translated
Type: object
Type: string Default: auto
The text language. Must be auto or one of the codes/names (not case sensitive) contained in languages.js
Type: string Default: en
The language in which the text should be translated. Must be one of the codes/names (not case sensitive) contained in languages.js.
Type: array Default:[]
Attributes in excluded objects do not participate in translation
object:text (string, object, array) – The translated text.translate(['I speak Chinese\nHello world', 'hello'], {from: 'en', to: 'nl'}).then(res => {
console.log(res);
//=> ["我说中文\n你好世界","你好"]
}).catch(err => {
console.error(err);
});
MIT © Shikar
FAQs
A free and unlimited for Google Translate, Multi-translation support object input
The npm package translate-google receives a total of 4,208 weekly downloads. As such, translate-google popularity was classified as popular.
We found that translate-google 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.