mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-10-03 12:06:38 +00:00
i18n: localize runtime notification delivery
This commit is contained in:
@@ -202,12 +202,19 @@ const AI_PROVIDERS = [
|
||||
|
||||
const NOTIFICATION_LANGUAGES = [
|
||||
{ value: "en", label: "English" },
|
||||
{ value: "de", label: "Deutsch" },
|
||||
{ value: "es", label: "Español" },
|
||||
{ value: "fr", label: "Français" },
|
||||
{ value: "it", label: "Italiano" },
|
||||
{ value: "pt", label: "Português" },
|
||||
{ value: "sk", label: "Slovenčina" },
|
||||
{ value: "sv", label: "Svenska" },
|
||||
]
|
||||
|
||||
function normalizeNotificationLanguage(notificationLanguage?: string, legacyAiLanguage?: string): string {
|
||||
if (notificationLanguage === "en" || notificationLanguage === "sk") return notificationLanguage
|
||||
if (legacyAiLanguage === "en" || legacyAiLanguage === "sk") return legacyAiLanguage
|
||||
const runtimeLanguages = new Set(NOTIFICATION_LANGUAGES.map(language => language.value))
|
||||
if (notificationLanguage && runtimeLanguages.has(notificationLanguage)) return notificationLanguage
|
||||
if (legacyAiLanguage && runtimeLanguages.has(legacyAiLanguage)) return legacyAiLanguage
|
||||
return "en"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user