correctly set document language based on the selected locale, fixes #723

This commit is contained in:
Aine 2025-07-28 19:07:57 +01:00
parent 3611ee5973
commit 51a8eb2250
No known key found for this signature in database
GPG Key ID: 34969C908CCA2804
2 changed files with 8 additions and 0 deletions

View File

@ -117,6 +117,7 @@ The following changes are already implemented:
* 🔧 [Improve user account status toggles](https://github.com/etkecc/synapse-admin/pull/608) * 🔧 [Improve user account status toggles](https://github.com/etkecc/synapse-admin/pull/608)
* 🛡️ [Validate that password is entered upon reactivation of account](https://github.com/etkecc/synapse-admin/pull/609) * 🛡️ [Validate that password is entered upon reactivation of account](https://github.com/etkecc/synapse-admin/pull/609)
* 🌏 [Add Japanese localization](https://github.com/etkecc/synapse-admin/pull/631) * 🌏 [Add Japanese localization](https://github.com/etkecc/synapse-admin/pull/631)
* 🗣️ [Correctly set document language based on the selected locale](https://github.com/etkecc/synapse-admin/issues/723)
#### exclusive for [etke.cc](https://etke.cc) customers #### exclusive for [etke.cc](https://etke.cc) customers

View File

@ -13,6 +13,7 @@ import {
useLogout, useLogout,
UserMenu, UserMenu,
useStore, useStore,
useLocaleState,
} from "react-admin"; } from "react-admin";
import Footer from "./Footer"; import Footer from "./Footer";
@ -146,6 +147,12 @@ const AdminMenu = props => {
}; };
export const AdminLayout = ({ children }) => { export const AdminLayout = ({ children }) => {
// Set the document language based on the selected locale
const [locale, _setLocale] = useLocaleState();
useEffect(() => {
document.documentElement.lang = locale;
}, [locale]);
return ( return (
<> <>
<Layout <Layout