mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2024-11-25 09:21:04 +00:00
fix
This commit is contained in:
parent
73ebb96171
commit
b97134ac07
1 changed files with 6 additions and 6 deletions
|
@ -324,12 +324,12 @@ document.addEventListener('DOMContentLoaded', function(){
|
|||
let translateFileRequest = new XMLHttpRequest();
|
||||
|
||||
translateFileRequest.open("POST", BaseUrl + "/translate_file", true);
|
||||
translateFileRequest.setRequestHeader("Content-type", "multipart/form-data");
|
||||
|
||||
let formdata = new FormData();
|
||||
formdata.append("file", this.inputFile);
|
||||
formdata.append("source", this.sourceLang);
|
||||
formdata.append("target", this.targetLang);
|
||||
let data = new FormData();
|
||||
data.append("file", this.inputFile);
|
||||
data.append("source", this.sourceLang);
|
||||
data.append("target", this.targetLang);
|
||||
data.append("api_key", localStorage.getItem("api_key") || "");
|
||||
|
||||
this.loadingFileTranslation = true
|
||||
|
||||
|
@ -339,7 +339,7 @@ document.addEventListener('DOMContentLoaded', function(){
|
|||
}
|
||||
}
|
||||
|
||||
translateFileRequest.send(formdata);
|
||||
translateFileRequest.send(data);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue