From 75ecf699118b2d71f67f5583f44de7368e2a27a6 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 3 Jun 2026 10:48:57 +0800 Subject: [PATCH] fix: respect layout.locale setting to hide language switcher (#11836) Co-authored-by: Claude Opus 4.7 Co-authored-by: Claude Opus 4.8 (1M context) --- src/app.tsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/app.tsx b/src/app.tsx index de16ba25..d7dfbd30 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -88,11 +88,17 @@ export const layout: RunTimeLayoutConfig = ({ } return dom; }, - actionsRender: () => [ - , - , - , - ], + actionsRender: () => { + // `locale: false` opts out of the language switcher. ProLayout's own + // `locale` prop is a locale string, so narrow to the boolean toggle here. + const localeEnabled = + (initialState?.settings as { locale?: boolean })?.locale !== false; + return [ + , + , + localeEnabled && , + ].filter(Boolean); + }, avatarProps: { src: initialState?.currentUser?.avatar, title: 'ProUser',