fix(client): use native language names in the settings dropdown too
Export the languageNames map and reuse it in the Settings page so EN/DE/TR turn into English/Deutsch/Türkçe alongside the auth-page selector.
This commit is contained in:
1 parent
319f667028
commit
9d7f4929ad
2 files changed
+3
-2
No files matched your search
@@ -7,7 +7,7 @@ import { useDispatch } from "react-redux";
|
|||||||
import { setLanguage } from "@/Features/UI/uiSlice";
|
import { setLanguage } from "@/Features/UI/uiSlice";
|
||||||
import type { RootState } from "@/Types/state";
|
import type { RootState } from "@/Types/state";
|
||||||
|
|
||||||
const languageNames: Record<string, string> = {
|
export const languageNames: Record<string, string> = {
|
||||||
en: "English",
|
en: "English",
|
||||||
de: "Deutsch",
|
de: "Deutsch",
|
||||||
es: "Español",
|
es: "Español",
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import type { SettingsFormData, SettingsFormInput } from "@/Validation/settings"
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { Controller } from "react-hook-form";
|
import { Controller } from "react-hook-form";
|
||||||
import { TextField, Button, FieldLabel, SliderWithLabel } from "@/Components/inputs";
|
import { TextField, Button, FieldLabel, SliderWithLabel } from "@/Components/inputs";
|
||||||
|
import { languageNames } from "@/Components/inputs/LanguageSelector";
|
||||||
import { Box, Typography } from "@mui/material";
|
import { Box, Typography } from "@mui/material";
|
||||||
import { useDelete } from "@/Hooks/UseApi";
|
import { useDelete } from "@/Hooks/UseApi";
|
||||||
|
|
||||||
@@ -327,7 +328,7 @@ export const SettingsPage = () => {
|
|||||||
key={lang}
|
key={lang}
|
||||||
value={lang}
|
value={lang}
|
||||||
>
|
>
|
||||||
{lang.toUpperCase()}
|
{languageNames[lang] ?? lang}
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
))}
|
))}
|
||||||
</Select>
|
</Select>
|
||||||
|
|||||||
Reference in new issue
Block a user