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
commit d8809238a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

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;