feat: first shoot on translation
This commit is contained in:
16
src/hooks/useTranslate.ts
Normal file
16
src/hooks/useTranslate.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export function useTranslate() {
|
||||
const { t, i18n } = useTranslation("common");
|
||||
|
||||
const changeLanguage = (lang: string) => {
|
||||
i18n.changeLanguage(lang);
|
||||
};
|
||||
|
||||
return {
|
||||
t,
|
||||
i18n,
|
||||
changeLanguage,
|
||||
currentLanguage: i18n.language,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user