mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 22:27:16 +01:00
feat: ✨ customize theme and locale based on query params
This commit is contained in:
parent
0f976be5d8
commit
ec7bc92497
2 changed files with 18 additions and 0 deletions
|
|
@ -48,5 +48,14 @@ export default function useLocale() {
|
|||
}
|
||||
}, [locale]);
|
||||
|
||||
useEffect(() => {
|
||||
const url = new URL(window.location.href);
|
||||
const locale = url.searchParams.get('locale');
|
||||
|
||||
if (locale) {
|
||||
saveLocale(locale);
|
||||
}
|
||||
}, []);
|
||||
|
||||
return { locale, saveLocale, messages, dir, dateLocale };
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue