fix(settings): language switch not working for llm provider

This commit is contained in:
italic-jinxin
2026-03-26 16:37:17 +08:00
parent b8c3facfcd
commit 9e5d07c222
+14 -3
View File
@@ -35,16 +35,27 @@ function switchLanguage(lang) {
if (I18n.setLanguage(lang)) {
// Update slash commands
updateSlashCommands();
// Update language menu active state
updateLanguageMenu();
// Re-render dynamically built sections that use I18n.t()
if (typeof renderProviders === 'function' && typeof _configLoaded !== 'undefined' && _configLoaded) {
renderProviders();
}
if (typeof loadInferenceSettings === 'function') {
var inferencePanel = document.getElementById('settings-inference');
if (inferencePanel && inferencePanel.classList.contains('active')) {
loadInferenceSettings();
}
}
// Close menu
const menu = document.getElementById('language-menu');
if (menu) {
menu.style.display = 'none';
}
// Show toast notification
showToast(I18n.t('language.switch') + ': ' + (lang === 'zh-CN' ? '简体中文' : 'English'));
}