#1584 Chinese language codes Deepl

This commit is contained in:
Cohee 2023-12-23 18:37:30 +02:00
parent db3bf42d63
commit 69509925c4
1 changed files with 5 additions and 1 deletions

View File

@ -106,6 +106,10 @@ router.post('/deepl', jsonParser, async (request, response) => {
return response.sendStatus(400);
}
if (request.body.lang === 'zh-CN' || request.body.lang === 'zh-TW') {
request.body.lang = 'ZH';
}
const text = request.body.text;
const lang = request.body.lang;
const formality = getConfigValue('deepl.formality', 'default');
@ -221,7 +225,7 @@ router.post('/deeplx', jsonParser, async (request, response) => {
const text = request.body.text;
let lang = request.body.lang;
if (request.body.lang === 'zh-CN') {
if (request.body.lang === 'zh-CN' || request.body.lang === 'zh-TW') {
lang = 'ZH';
}