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).
| @@ -19,10 +19,14 @@ router.post('/libre', jsonParser, async (request, response) => { | |||
| 19 | return response.sendStatus(400); | 19 | return response.sendStatus(400); |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | if (request.body.lang === 'zh-CN' || request.body.lang === 'zh-TW') { | 22 | if (request.body.lang === 'zh-CN') { |
| 23 | request.body.lang = 'zh'; | 23 | request.body.lang = 'zh'; |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | if (request.body.lang === 'zh-TW') { | ||
| 27 | request.body.lang = 'zt'; | ||
| 28 | } | ||
| 29 | |||
| 26 | const text = request.body.text; | 30 | const text = request.body.text; |
| 27 | const lang = request.body.lang; | 31 | const lang = request.body.lang; |
| 28 | 32 | ||