Update language files and fix UI issues

This commit is contained in:
n4ze3m
2024-03-24 17:07:21 +05:30
parent d9ce1e2d2c
commit 502759fae6
24 changed files with 485 additions and 54 deletions

17
src/hooks/useI18n.tsx Normal file
View File

@@ -0,0 +1,17 @@
import { supportLanguage } from "@/i18n/support-language"
import { useState } from "react"
import { useTranslation } from "react-i18next"
export const useI18n = () => {
const { i18n } = useTranslation()
const [locale, setLocale] = useState<string>(
localStorage.getItem("i18nextLng") || "en"
)
const changeLocale = (lang: string) => {
setLocale(lang)
i18n.changeLanguage(lang)
}
return { locale, changeLocale, supportLanguage }
}