This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new f2eee4ef464 fix(frontend): prevent LanguagePicker crash when locale is 
missing from LANGUAGES config (#39585)
f2eee4ef464 is described below

commit f2eee4ef464a8d148057d49ade7a647f7291e738
Author: Abdul Rehman <[email protected]>
AuthorDate: Wed May 13 01:22:36 2026 +0500

    fix(frontend): prevent LanguagePicker crash when locale is missing from 
LANGUAGES config (#39585)
    
    Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
---
 superset-frontend/src/features/home/LanguagePicker.tsx | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/superset-frontend/src/features/home/LanguagePicker.tsx 
b/superset-frontend/src/features/home/LanguagePicker.tsx
index 82bf482a0f4..ed214c52ceb 100644
--- a/superset-frontend/src/features/home/LanguagePicker.tsx
+++ b/superset-frontend/src/features/home/LanguagePicker.tsx
@@ -25,9 +25,9 @@ import { Typography } from 
'@superset-ui/core/components/Typography';
 
 export interface Languages {
   [key: string]: {
-    flag: string;
-    url: string;
-    name: string;
+    flag?: string;
+    url?: string;
+    name?: string;
   };
 }
 
@@ -61,9 +61,9 @@ export const useLanguageMenuItems = ({
       key: langKey,
       label: (
         <StyledLabel className="f16">
-          <i className={`flag ${languages[langKey].flag}`} />
-          <Typography.Link href={languages[langKey].url}>
-            {languages[langKey].name}
+          <i className={`flag ${languages[langKey]?.flag ?? 'us'}`} />
+          <Typography.Link href={languages[langKey]?.url}>
+            {languages[langKey]?.name}
           </Typography.Link>
         </StyledLabel>
       ),
@@ -75,7 +75,7 @@ export const useLanguageMenuItems = ({
       type: 'submenu' as const,
       label: (
         <span className="f16" aria-label={t('Languages')}>
-          <i className={`flag ${languages[locale].flag}`} />
+          <i className={`flag ${languages[locale]?.flag ?? 'us'}`} />
         </span>
       ),
       icon: <Icons.CaretDownOutlined iconSize="xs" />,

Reply via email to