|
Last change
on this file since d7deae5 was ba52069, checked in by Stefan-Saveski <stefansaveski19@…>, 7 months ago |
|
Added dark theme.
|
-
Property mode
set to
100644
|
|
File size:
1.0 KB
|
| Line | |
|---|
| 1 | "use client";
|
|---|
| 2 | import { useTranslation } from 'react-i18next';
|
|---|
| 3 |
|
|---|
| 4 | export default function LanguageSwitcher() {
|
|---|
| 5 | const { i18n } = useTranslation();
|
|---|
| 6 |
|
|---|
| 7 | const changeLanguage = (lng: string) => {
|
|---|
| 8 | i18n.changeLanguage(lng);
|
|---|
| 9 | };
|
|---|
| 10 |
|
|---|
| 11 | return (
|
|---|
| 12 | <div className="flex gap-2 items-center">
|
|---|
| 13 | <button
|
|---|
| 14 | onClick={() => changeLanguage('mk')}
|
|---|
| 15 | className={`px-3 py-1 rounded border-2 text-sm font-semibold transition-all duration-150 ${i18n.language === 'mk' ? 'border-primary text-primary bg-accent' : 'border-border text-muted-foreground bg-card hover:border-primary hover:text-primary'}`}
|
|---|
| 16 | aria-label="Macedonian"
|
|---|
| 17 | >
|
|---|
| 18 | MK
|
|---|
| 19 | </button>
|
|---|
| 20 | <button
|
|---|
| 21 | onClick={() => changeLanguage('en')}
|
|---|
| 22 | className={`px-3 py-1 rounded border-2 text-sm font-semibold transition-all duration-150 ${i18n.language === 'en' ? 'border-primary text-primary bg-accent' : 'border-border text-muted-foreground bg-card hover:border-primary hover:text-primary'}`}
|
|---|
| 23 | aria-label="English"
|
|---|
| 24 | >
|
|---|
| 25 | EN
|
|---|
| 26 | </button>
|
|---|
| 27 | </div>
|
|---|
| 28 | );
|
|---|
| 29 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.