diff --git a/src/app/Providers.tsx b/src/app/Providers.tsx index 3b4e52e7..bbc10a35 100644 --- a/src/app/Providers.tsx +++ b/src/app/Providers.tsx @@ -5,6 +5,7 @@ import { ReactBasicsProvider } from 'react-basics'; import ErrorBoundary from 'components/common/ErrorBoundary'; import { useLocale } from 'components/hooks'; import 'chartjs-adapter-date-fns'; +import { useEffect } from 'react'; const client = new QueryClient({ defaultOptions: { @@ -16,7 +17,13 @@ const client = new QueryClient({ }); function MessagesProvider({ children }) { - const { locale, messages } = useLocale(); + const { locale, messages, dir } = useLocale(); + + useEffect(() => { + document.documentElement.setAttribute('dir', dir); + document.documentElement.setAttribute('lang', locale); + }, [locale, dir]); + return ( null}> {children}