Browse Source

fix: respect layout.locale setting to hide language switcher (#11836)

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
pull/11855/head
afc163 3 months ago
committed by GitHub
parent
commit
75ecf69911
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 16
      src/app.tsx

16
src/app.tsx

@ -88,11 +88,17 @@ export const layout: RunTimeLayoutConfig = ({
}
return dom;
},
actionsRender: () => [
<DocLink key="doc" />,
<VersionDropdown key="version" />,
<LangDropdown key="lang" />,
],
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 [
<DocLink key="doc" />,
<VersionDropdown key="version" />,
localeEnabled && <LangDropdown key="lang" />,
].filter(Boolean);
},
avatarProps: {
src: initialState?.currentUser?.avatar,
title: 'ProUser',

Loading…
Cancel
Save