From 09b08a49d30dc0c53b05e25742a084eeee986f69 Mon Sep 17 00:00:00 2001 From: blackmesataiwan <20988581+blackmesataiwan@users.noreply.github.com> Date: Fri, 19 Jul 2024 19:30:23 +0800 Subject: [PATCH] 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). --- src/endpoints/translate.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/endpoints/translate.js b/src/endpoints/translate.js index 9541fc331..fb2b9039b 100644 --- a/src/endpoints/translate.js +++ b/src/endpoints/translate.js @@ -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;