Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Oauth2_proxy | 5,034 | 4 years ago | 4 | January 23, 2019 | 245 | mit | Go | |||
A reverse proxy that provides authentication with Google, Github or other provider | ||||||||||
Nekox | 3,777 | 5 days ago | 188 | gpl-3.0 | Java | |||||
A third-party Telegram android app. | ||||||||||
Ngx_http_google_filter_module | 3,195 | 4 years ago | 34 | other | C | |||||
Nginx Module for Google Mirror | ||||||||||
Zmirror | 2,066 | 4 years ago | 38 | mit | Python | |||||
The next-gen reverse proxy for full site mirroring | ||||||||||
Flokk | 1,239 | 5 months ago | 30 | bsd-2-clause | Dart | |||||
A fresh and modern Google Contacts manager that integrates with GitHub and Twitter. | ||||||||||
Siteproxy | 754 | 9 months ago | 30 | mit | JavaScript | |||||
reverse proxy, 反向代理,免翻墙访问Youtube/twitter/Google, 支持telegram web登录。请勿将本项目用于非法用途,否则后果自负。 | ||||||||||
Go Dork | 677 | 6 months ago | 4 | April 03, 2021 | 4 | mit | Go | |||
The fastest dork scanner written in Go. | ||||||||||
Cloudbrute | 631 | 2 months ago | 9 | December 24, 2021 | mit | Go | ||||
Awesome cloud enumerator | ||||||||||
Google Play Crawler | 482 | 4 years ago | 58 | other | Java | |||||
Play with Google Play API :) | ||||||||||
Safebrowsing | 337 | 29 | 16 | 2 years ago | May 27, 2021 | 12 | apache-2.0 | Go | ||
Safe Browsing API Go Client |
A free and unlimited API for Google Translate(support single text and Multi-segment text) 💵🚫
npm install --save google-translate-open-api
when I have the following sentence. ( from How Are Function Components Different from Classes?)
Maybe you’ve heard one of them is better for performance. Which one? Many of such benchmarks are flawed so I’d be careful drawing conclusions from them.
I don't want to translate all the text first and I'd like to translate segment by segment. Especially in an article, the whole translation may not work well.
In the existing library, if I want to translate multi-segment text, I have to request multiple times.(like google-translate-api)
So I have to use the new api to implement, so the google-translate-open-api
is born.
Single segment
import translate from 'google-translate-open-api';
const result = await translate(`I'm fine.`, {
tld: "cn",
to: "zh-CN",
});
const data = result.data[0];
// 我很好。
Multi-segment text
import translate from 'google-translate-open-api';
const result = await translate([`I'm fine.`, `I'm ok.`], {
tld: "cn",
to: "zh-CN",
});
const data = result.data[0];
// [[[["我很好。"]],null,"en"],[[["我可以。"]],null,"en"]]
Note: Multi-segment text result is different from single sentence. You need extra attention.
Multi-segment text contains mylti-sentence.
import translate, { parseMultiple } from 'google-translate-open-api';
const result = await translate([`I'm fine. And you?`,`I'm ok.`], {
tld: "cn",
to: "zh-CN",
});
// [[[[["<i>I'm fine.</i> <b>我很好。</b> <i>And you?</i> <b>你呢?</b>"]],null,"en"],[[["我可以。"]],null,"en"]]]
// use parseMultiple
const data = result.data[0];
const parseData = parseMultiple(data);
// ["我很好。你呢?","我可以。"]
Proxy
proxy-config axios/axios
const result = await translate([`I'm fine. And you?`,`I'm ok.`], {
tld: "cn",
to: "zh-CN",
proxy: {
host: '127.0.0.1',
port: 9000,
auth: {
username: 'mikeymike',
password: 'rapunz3l'
}
}
});
Browers
const result = await translate([`I'm fine. And you?`,`I'm ok.`], {
tld: "cn",
to: "zh-CN",
browers: true
});
const data = result.data[0];
// 我很好。
For commonJS
const translate = require('google-translate-open-api').default;
hua1995116/google-translate-open-api-demo
Type: string
The text to be translated
Type: object
from?
Type: string
Default: auto
The text language. Must be auto or one of the codes/names (not case sensitive) contained in src/languages.ts
to
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 src/languages.ts.
tld
Type: string
'com' | 'cn' <Default 'com'>
cn
is for China, com
for others.
proxy
Type: AxiosProxyConfig
proxy for request.
config
Type: object
config for axios
browers
Type: boolean
support browers via cors-anywhere (This is a public service, not necessarily stable)
browersUrl
Type: string
custom browers proxy url
format
Type: string
<text|html>
When use single translate, default use text
(but we can set it to html
) and use batch translate, default and only use html
.
Apache License
Copyright (c) 2019 蓝色的秋风