Browse Source

fix: update language names and codes for localization improvements

master
sina_sajjadi 3 days ago
parent
commit
2b57950f1f
  1. 84
      src/components/language-switcher.tsx
  2. 39
      src/components/modals/languages-modal.tsx

84
src/components/language-switcher.tsx

@ -10,86 +10,86 @@ import { useRouter } from "next/router";
const data = [ const data = [
{ {
name: "English",
code: "en",
"name": "English",
"code": "en"
}, },
{ {
name: "Spanish",
code: "es",
"name": "Español",
"code": "es"
}, },
{ {
name: "German",
code: "de",
"name": "Deutsch",
"code": "de"
}, },
{ {
name: "Uzbek",
code: "uz",
"name": "Oʻzbek",
"code": "uz"
}, },
{ {
name: "Portuguese",
code: "pt",
"name": "Português",
"code": "pt"
}, },
{ {
name: "Bengali",
code: "bn",
"name": "বাংলা",
"code": "bn"
}, },
{ {
name: "Chinese",
code: "zh",
"name": "中文",
"code": "zh"
}, },
{ {
name: "Azerbaijani",
code: "az",
"name": "Azərbaycan dili",
"code": "az"
}, },
{ {
name: "Urdu",
code: "ur",
"name": "اردو",
"code": "ur"
}, },
{ {
name: "French",
code: "fr",
"name": "Français",
"code": "fr"
}, },
{ {
name: "Turkish",
code: "tr",
"name": "Türkçe",
"code": "tr"
}, },
{ {
name: "Indonesian",
code: "id",
"name": "Bahasa Indonesia",
"code": "id"
}, },
{ {
name: "Swahili",
code: "sw",
"name": "Kiswahili",
"code": "sw"
}, },
{ {
name: "Russian",
code: "ru",
"name": "Русский",
"code": "ru"
}, },
{ {
name: "Arabic",
code: "ar",
"name": "العربية",
"code": "ar"
}, },
{ {
name: "Tajik",
code: "tg",
"name": "Тоҷикӣ",
"code": "tg"
}, },
{ {
name: "Persian",
code: "fa",
"name": "فارسی",
"code": "fa"
}, },
{ {
name: "Gujarati",
code: "gu",
"name": "ગુજરાતી",
"code": "gu"
}, },
{ {
name: "Kashmiri",
code: "ks",
"name": "کٲشُر",
"code": "ks"
}, },
{ {
name: "Hausa",
code: "ha",
},
];
"name": "Hausa",
"code": "ha"
}
]
const LanguageSwitcher: React.FC = () => { const LanguageSwitcher: React.FC = () => {
const { t } = useTranslation("common"); // Initialize translation hook with 'common' namespace const { t } = useTranslation("common"); // Initialize translation hook with 'common' namespace
const [isOpen, setIsOpen] = useState(false); const [isOpen, setIsOpen] = useState(false);

39
src/components/modals/languages-modal.tsx

@ -11,81 +11,81 @@ interface Language {
} }
const data = [
const data =[
{ {
"name": "English", "name": "English",
"code": "en" "code": "en"
}, },
{ {
"name": "Spanish",
"name": "Español",
"code": "es" "code": "es"
}, },
{ {
"name": "German",
"name": "Deutsch",
"code": "de" "code": "de"
}, },
{ {
"name": "Uzbek",
"name": "zbek",
"code": "uz" "code": "uz"
}, },
{ {
"name": "Portuguese",
"name": "Português",
"code": "pt" "code": "pt"
}, },
{ {
"name": "Bengali",
"name": "বাংলা",
"code": "bn" "code": "bn"
}, },
{ {
"name": "Chinese",
"name": "中文",
"code": "zh" "code": "zh"
}, },
{ {
"name": "Azerbaijani",
"name": "Azərbaycan dili",
"code": "az" "code": "az"
}, },
{ {
"name": "Urdu",
"name": "اردو",
"code": "ur" "code": "ur"
}, },
{ {
"name": "French",
"name": "Français",
"code": "fr" "code": "fr"
}, },
{ {
"name": "Turkish",
"name": "Türkçe",
"code": "tr" "code": "tr"
}, },
{ {
"name": "Indonesian",
"name": "Bahasa Indonesia",
"code": "id" "code": "id"
}, },
{ {
"name": "Swahili",
"name": "Kiswahili",
"code": "sw" "code": "sw"
}, },
{ {
"name": "Russian",
"name": "Русский",
"code": "ru" "code": "ru"
}, },
{ {
"name": "Arabic",
"name": "العربية",
"code": "ar" "code": "ar"
}, },
{ {
"name": "Tajik",
"name": "Тоҷикӣ",
"code": "tg" "code": "tg"
}, },
{ {
"name": "Persian",
"name": "فارسی",
"code": "fa" "code": "fa"
}, },
{ {
"name": "Gujarati",
"name": "ગુજરાતી",
"code": "gu" "code": "gu"
}, },
{ {
"name": "Kashmiri",
"name": "کٲشُر",
"code": "ks" "code": "ks"
}, },
{ {
@ -95,6 +95,7 @@ const data = [
] ]
const LanguageModal = () => { const LanguageModal = () => {
const [languages, setLanguages] = useState<Language[]>([]); const [languages, setLanguages] = useState<Language[]>([]);
const [selectedLanguage, setSelectedLanguage] = useState<string>(""); const [selectedLanguage, setSelectedLanguage] = useState<string>("");

Loading…
Cancel
Save