Merge pull request #2534 from blackmesataiwan/staging

Update language code for Chinese Traditional translations(zh-TW) on LibreTranslate endpoint.
This commit is contained in:
Cohee
2024-07-19 18:09:14 +03:00
committed by GitHub

View File

@@ -19,10 +19,14 @@ router.post('/libre', jsonParser, async (request, response) => {
return response.sendStatus(400);
}
if (request.body.lang === 'zh-CN' || request.body.lang === 'zh-TW') {
if (request.body.lang === 'zh-CN') {
request.body.lang = 'zh';
}
if (request.body.lang === 'zh-TW') {
request.body.lang = 'zt';
}
const text = request.body.text;
const lang = request.body.lang;