Translation: Split Portuguese langs

This commit is contained in:
Cohee
2024-12-23 20:28:21 +02:00
parent 71050ef1d2
commit 650853eabb
2 changed files with 3 additions and 3 deletions

View File

@ -106,7 +106,8 @@ const languageCodes = {
'Pashto': 'ps',
'Persian': 'fa',
'Polish': 'pl',
'Portuguese (Portugal, Brazil)': 'pt',
'Portuguese (Portugal)': 'pt-PT',
'Portuguese (Brazil)': 'pt-BR',
'Punjabi': 'pa',
'Romanian': 'ro',
'Russian': 'ru',

View File

@ -248,8 +248,7 @@ router.post('/deepl', jsonParser, async (request, response) => {
params.append('text', text);
params.append('target_lang', lang);
if (['de', 'fr', 'it', 'es', 'nl', 'ja', 'ru'].includes(lang)) {
// We don't specify a Portuguese variant, so ignore formality for it.
if (['de', 'fr', 'it', 'es', 'nl', 'ja', 'ru', 'pt-BR', 'pt-PT'].includes(lang)) {
params.append('formality', formality);
}