Update language code for Chinese translations(zh-TW)

The code changes in `translate.js` update the language code for Chinese translations. The `zh-TW` language code is changed to `zt`. This ensures consistency and compatibility with the translation system(https://libretranslate.com/languages).
This commit is contained in:
blackmesataiwan 2024-07-19 19:30:23 +08:00
parent 3cbbb2fe39
commit 09b08a49d3
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;