Feat: support for alternative translations

This commit is contained in:
Piero Toffanin 2024-06-03 12:42:32 -04:00
parent f7a35db05b
commit ba8b8d97a1
5 changed files with 66 additions and 31 deletions

View file

@ -134,6 +134,7 @@ document.addEventListener('DOMContentLoaded', function(){
' source: ' + this.$options.filters.escape(this.sourceLang) + ',',
' target: ' + this.$options.filters.escape(this.targetLang) + ',',
' format: "' + (this.isHtml ? "html" : "text") + '",',
' alternatives: 3,',
' api_key: "' + (localStorage.getItem("api_key") || "") + '"',
' }),',
' headers: { "Content-Type": "application/json" }',
@ -241,6 +242,7 @@ document.addEventListener('DOMContentLoaded', function(){
data.append("source", self.sourceLang);
data.append("target", self.targetLang);
data.append("format", self.isHtml ? "html" : "text");
data.append("alternatives", 3);
data.append("api_key", localStorage.getItem("api_key") || "");
if (self.apiSecret) data.append("secret", self.apiSecret);