spacedrive/interface/hooks/useLocale.ts
Utku a94832c1ee
[ENG-1502] I18n (#1897)
* you know, you could just work on first try

* fix extension

* configure plugin and fix few translation issues

* more

* more keys

* and more

* more keys and sort

* commit msg

* we like keys here

* end my suffering

* jk i just love keys

* key fix

* add turkish

* add german

* Entendido

* Demnächst

* Mettre une étoile sur GitHub

* 成功

* pnpm-lock

* vite plugin

* remove i18next backends

---------

Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2024-01-08 20:26:46 +00:00

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
};
};