Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
fix: installed apps preview language error (#23397)
Wu Tianweib946378b385f
diff --git a/web/app/components/base/chat/chat-with-history/hooks.tsx b/web/app/components/base/chat/chat-with-history/hooks.tsxindex e88d28879b0..0f437c82b7c 100644--- a/web/app/components/base/chat/chat-with-history/hooks.tsx+++ b/web/app/components/base/chat/chat-with-history/hooks.tsx@@ -115,8 +115,11 @@ export const useChatWithHistory = (installedAppInfo?: InstalledApp) => {}, [])useEffect(() => {- if (appData?.site.default_language)- changeLanguage(appData.site.default_language)+ const setLocaleFromProps = async () => {+ if (appData?.site.default_language)+ await changeLanguage(appData.site.default_language)+ }+ setLocaleFromProps()}, [appData])const [sidebarCollapseState, setSidebarCollapseState] = useState<boolean>(false)diff --git a/web/app/components/base/chat/embedded-chatbot/hooks.tsx b/web/app/components/base/chat/embedded-chatbot/hooks.tsxindex 4e86ad50e40..d7983dc5997 100644--- a/web/app/components/base/chat/embedded-chatbot/hooks.tsx+++ b/web/app/components/base/chat/embedded-chatbot/hooks.tsx@@ -101,15 +101,15 @@ export const useEmbeddedChatbot = () => {if (localeParam) {// If locale parameter exists in URL, use it instead of default- changeLanguage(localeParam)+ await changeLanguage(localeParam)}else if (localeFromSysVar) {// If locale is set as a system variable, use that- changeLanguage(localeFromSysVar)+ await changeLanguage(localeFromSysVar)}else if (appInfo?.site.default_language) {// Otherwise use the default from app config- changeLanguage(appInfo.site.default_language)+ await changeLanguage(appInfo.site.default_language)}}diff --git a/web/app/components/share/text-generation/index.tsx b/web/app/components/share/text-generation/index.tsxindex 1f0367dc666..4a6d1c99651 100644--- a/web/app/components/share/text-generation/index.tsx+++ b/web/app/components/share/text-generation/index.tsx@@ -371,7 +371,7 @@ const TextGeneration: FC<IMainProps> = ({setAppId(appId)setSiteInfo(siteInfo as SiteInfo)setCustomConfig(custom_config)- changeLanguage(siteInfo.default_language)+ await changeLanguage(siteInfo.default_language)const { user_input_form, more_like_this, file_upload, text_to_speech }: any = appParamssetVisionConfig({diff --git a/web/i18n-config/i18next-config.ts b/web/i18n-config/i18next-config.tsindex b26d0afdbea..19ac59ebb40 100644--- a/web/i18n-config/i18next-config.ts+++ b/web/i18n-config/i18next-config.ts@@ -87,11 +87,11 @@ if (!i18n.isInitialized) {}export const changeLanguage = async (lng?: string) => {- const resolvedLng = lng ?? 'en-US'- const resource = await loadLangResources(resolvedLng)- if (!i18n.hasResourceBundle(resolvedLng, 'translation'))- i18n.addResourceBundle(resolvedLng, 'translation', resource, true, true)- await i18n.changeLanguage(resolvedLng)+ if (!lng) return+ const resource = await loadLangResources(lng)+ if (!i18n.hasResourceBundle(lng, 'translation'))+ i18n.addResourceBundle(lng, 'translation', resource, true, true)+ await i18n.changeLanguage(lng)}export default i18n