mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-12 10:00:20 +01:00
#1405 Don't add formality for unsupported languages
This commit is contained in:
parent
6be07e5ea5
commit
c98b23ee72
@ -119,7 +119,11 @@ function registerEndpoints(app, jsonParser) {
|
||||
const params = new URLSearchParams();
|
||||
params.append('text', text);
|
||||
params.append('target_lang', lang);
|
||||
params.append('formality', formality);
|
||||
|
||||
if (['de', 'fr', 'it', 'es', 'nl', 'ja', 'ru'].includes(lang)) {
|
||||
// We don't specify a Portuguese variant, so ignore formality for it.
|
||||
params.append('formality', formality);
|
||||
}
|
||||
|
||||
try {
|
||||
const result = await fetch('https://api-free.deepl.com/v2/translate', {
|
||||
|
Loading…
x
Reference in New Issue
Block a user