fitst commit

This commit is contained in:
Samandar Turgunboyev
2026-01-28 18:26:50 +05:00
parent 166a55b1e9
commit 124798419b
196 changed files with 26627 additions and 421 deletions

31
i18n/useLanguage.ts Normal file
View File

@@ -0,0 +1,31 @@
import { useTranslation } from 'react-i18next';
export type Lang = 'uz' | 'ru' | 'en';
export function useLanguage() {
const { i18n, t } = useTranslation();
const changeLanguage = async (lang: Lang) => {
await i18n.changeLanguage(lang);
};
const getLanguageName = () => {
switch (i18n.language) {
case 'uz':
return 'Ozbek';
case 'ru':
return 'Русский';
case 'en':
return 'English';
default:
return '';
}
};
return {
t,
language: i18n.language,
changeLanguage,
getLanguageName,
};
}