mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-14 20:34:05 +00:00
13 lines
293 B
TypeScript
13 lines
293 B
TypeScript
|
import { useTranslation } from 'react-i18next';
|
||
|
|
||
|
export const useLocale = (namespace: Parameters<typeof useTranslation>[0] = 'translation') => {
|
||
|
const { i18n, t } = useTranslation(namespace);
|
||
|
const isLocaleReady = Object.keys(i18n).length > 0;
|
||
|
|
||
|
return {
|
||
|
i18n,
|
||
|
t,
|
||
|
isLocaleReady
|
||
|
};
|
||
|
};
|