feat(i18n): implement language switching and localization support
- Remove i18next configuration and dependencies - Add language switcher component - Integrate language change functionality with cookies - Update translations for English and Persian - Modify layout and page components to support dynamic language rendering - Refactor Tailwind CSS configuration for custom colors
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
'use client';
|
||||
import { changeLanguage, TLocales } from '@/locales/translates';
|
||||
import Button from '../Button';
|
||||
|
||||
export default function ChangeLangButton() {
|
||||
const changeLang = (lang: TLocales) => {
|
||||
changeLanguage(lang);
|
||||
window.location.reload(); // Reload to get new SSR content
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Button onClick={() => changeLang('en')}>English</Button>
|
||||
<Button onClick={() => changeLang('fa')}>فارسی</Button>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user