mirror of
https://github.com/zoriya/v10.git
synced 2026-08-11 00:19:28 +00:00
12 lines
374 B
TypeScript
12 lines
374 B
TypeScript
import type { SandboxLocaleTag } from '@app/shared/i18n/locale-meta';
|
|
import { getInitialLocale, onLocaleChange } from '@app/shared/sandbox-listener';
|
|
import { useEffect, useState } from 'react';
|
|
|
|
export function useLocale(): SandboxLocaleTag {
|
|
const [locale, setLocale] = useState(getInitialLocale);
|
|
|
|
useEffect(() => onLocaleChange(setLocale), []);
|
|
|
|
return locale;
|
|
}
|