Make a fork of the google-translate-api package using fetch for credentials omit
This commit is contained in:
parent
33bf4d05c9
commit
caf14b616b
3 changed files with 10 additions and 3 deletions
|
@ -4,7 +4,7 @@
|
|||
"description": "Flashlang is a small browser extension to help you learn languages",
|
||||
"main": "webpack.config.js",
|
||||
"dependencies": {
|
||||
"@asmagin/google-translate-api": "^8.0.2",
|
||||
"@asmagin/google-translate-api": "git+https://github.com/MaeIsBad/google-translate-api.git",
|
||||
"@sveltejs/svelte-virtual-list": "^3.0.1",
|
||||
"svelte-feather-icons": "^4.0.0",
|
||||
"svelte-select": "^4.4.7",
|
||||
|
|
|
@ -18,10 +18,10 @@ export class GTranslate extends Translator {
|
|||
toTranslate: string,
|
||||
langs: LanguagePair
|
||||
): Promise<Translation> {
|
||||
const resp = await translate(toTranslate, {
|
||||
const resp = await (translate as any)(toTranslate, {
|
||||
from: langs.srcLang.code,
|
||||
to: langs.dstLang.code,
|
||||
});
|
||||
}, {credentials: "omit"});
|
||||
return {
|
||||
src: resp.from.text.value,
|
||||
languages: langs,
|
||||
|
|
|
@ -10,6 +10,13 @@
|
|||
axios "^0.21.1"
|
||||
querystring "^0.2.1"
|
||||
|
||||
"@asmagin/google-translate-api@git+https://github.com/MaeIsBad/google-translate-api.git":
|
||||
version "8.0.2"
|
||||
resolved "git+https://github.com/MaeIsBad/google-translate-api.git#3cd4d4dabcde8a4bddab6c7dd074e92444408c1a"
|
||||
dependencies:
|
||||
axios "^0.21.1"
|
||||
querystring "^0.2.1"
|
||||
|
||||
"@babel/code-frame@^7.0.0":
|
||||
version "7.16.7"
|
||||
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789"
|
||||
|
|
Loading…
Reference in a new issue