diff --git a/public/locales/en.json b/public/locales/en.json index a78e17f..0a06068 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -79,7 +79,17 @@ } }, "auth": { - "logout": "Logout" + "logout": "Logout", + "settings": { + "title": "Account Settings", + "language": { + "label": "Preferred language", + "list": { + "en": "English", + "fr": "French" + } + } + } }, "boats": { "list": { @@ -305,5 +315,8 @@ } } } + }, + "core": { + "settings": "Settings" } } diff --git a/public/locales/fr.json b/public/locales/fr.json index 46ce36a..b18a8ba 100644 --- a/public/locales/fr.json +++ b/public/locales/fr.json @@ -79,7 +79,17 @@ } }, "auth": { - "logout": "Déconnexion" + "logout": "Déconnexion", + "settings": { + "title": "Paramètres du compte", + "language": { + "label": "Langue préférée", + "list": { + "en": "Anglais", + "fr": "Français" + } + } + } }, "boats": { "list": { @@ -305,5 +315,8 @@ } } } + }, + "core": { + "settings": "Paramètres" } } diff --git a/src/auth/components/change-language.tsx b/src/auth/components/change-language.tsx new file mode 100644 index 0000000..6f455a2 --- /dev/null +++ b/src/auth/components/change-language.tsx @@ -0,0 +1,40 @@ +import { useTranslation } from '@refinedev/core'; +import { Form, Select } from 'antd'; + +import { useUpdateIdentity } from '../hooks/use-update-identity'; + +const ChangeLanguage = () => { + const { getLocale, changeLocale, translate } = useTranslation(); + const { identity, update } = useUpdateIdentity(); + + console.log('Rendering ChangeLanguage with identity:', identity); + + const handleChange = (value: string) => { + changeLocale(value); + update({ language: value }); + }; + + return ( + +