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',