Add Italian, Dutch, Polish, Vietnamese, Thai, Ukrainian, Swedish language support
This commit is contained in:
parent
60c3bbcf9f
commit
b70b3e0844
2 changed files with 36 additions and 1 deletions
|
|
@ -26,7 +26,7 @@ export function normalizeLanguageCode(lang) {
|
|||
const normalized = lang.toLowerCase().trim();
|
||||
|
||||
// Direct matches
|
||||
const supported = ["en", "zh", "hi", "es", "fr", "ar", "bn", "ru", "pt", "ur", "id", "de", "ja", "sw", "mr", "te", "tr", "zh-tw", "ko"];
|
||||
const supported = ["en", "zh", "hi", "es", "fr", "ar", "bn", "ru", "pt", "ur", "id", "de", "ja", "sw", "mr", "te", "tr", "zh-tw", "ko", "it", "nl", "pl", "vi", "th", "uk", "sv"];
|
||||
if (supported.includes(normalized)) return normalized;
|
||||
|
||||
// Common aliases and variations
|
||||
|
|
@ -59,6 +59,20 @@ export function normalizeLanguageCode(lang) {
|
|||
"traditional chinese": "zh-tw",
|
||||
"zh_tw": "zh-tw",
|
||||
"korean": "ko",
|
||||
"italian": "it",
|
||||
"italiano": "it",
|
||||
"dutch": "nl",
|
||||
"nederlands": "nl",
|
||||
"polish": "pl",
|
||||
"polski": "pl",
|
||||
"vietnamese": "vi",
|
||||
"tiếng việt": "vi",
|
||||
"thai": "th",
|
||||
"ภาษาไทย": "th",
|
||||
"ukrainian": "uk",
|
||||
"українська": "uk",
|
||||
"swedish": "sv",
|
||||
"svenska": "sv",
|
||||
};
|
||||
|
||||
if (aliases[normalized]) return aliases[normalized];
|
||||
|
|
@ -116,6 +130,13 @@ export async function getSystemMessage() {
|
|||
tr: "Turkish",
|
||||
"zh-tw": "Chinese (Traditional)",
|
||||
ko: "Korean",
|
||||
it: "Italian",
|
||||
nl: "Dutch",
|
||||
pl: "Polish",
|
||||
vi: "Vietnamese",
|
||||
th: "Thai",
|
||||
uk: "Ukrainian",
|
||||
sv: "Swedish",
|
||||
};
|
||||
|
||||
const langName = langNames[userLang] || userLang;
|
||||
|
|
|
|||
|
|
@ -23,6 +23,13 @@ export const SUPPORTED_LANGUAGES = {
|
|||
tr: "Turkish",
|
||||
"zh-tw": "Chinese (Traditional)",
|
||||
ko: "Korean",
|
||||
it: "Italian",
|
||||
nl: "Dutch",
|
||||
pl: "Polish",
|
||||
vi: "Vietnamese",
|
||||
th: "Thai",
|
||||
uk: "Ukrainian",
|
||||
sv: "Swedish",
|
||||
};
|
||||
|
||||
// REMOVED: splitHTMLIntoChunks function - no longer using chunking
|
||||
|
|
@ -48,6 +55,13 @@ export const NATIVE_LANGUAGE_NAMES = {
|
|||
tr: "Türkçe",
|
||||
"zh-tw": "中文(繁體)",
|
||||
ko: "한국어",
|
||||
it: "Italiano",
|
||||
nl: "Nederlands",
|
||||
pl: "Polski",
|
||||
vi: "Tiếng Việt",
|
||||
th: "ภาษาไทย",
|
||||
uk: "Українська",
|
||||
sv: "Svenska",
|
||||
};
|
||||
|
||||
// Send message with custom history (for translation with minimal system prompt)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue