From 50d78815fabed8368f77407a9b9971c7755ca82d Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Sun, 25 May 2025 01:50:00 +0200 Subject: [PATCH] Add default theme translation --- src/components/Theme/ThemeContext.tsx | 6 ++---- src/components/Theme/ThemeManager.tsx | 2 +- src/i18n/locales/it/core.json | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/components/Theme/ThemeContext.tsx b/src/components/Theme/ThemeContext.tsx index c964527..8ce2c6a 100644 --- a/src/components/Theme/ThemeContext.tsx +++ b/src/components/Theme/ThemeContext.tsx @@ -12,13 +12,11 @@ import { } from '@mui/material/styles'; import { lightThemeOptions } from '../../styles/theme-light'; import { darkThemeOptions } from '../../styles/theme-dark'; -import { useTranslation } from 'react-i18next'; - -const { t } = useTranslation(['auth', 'core', 'group', 'question', 'tutorial']); +import i18n from '../../i18n/i18n'; const defaultTheme = { id: 'default', - name: t('core:theme.default', { + name: i18n.t('core:theme.default', { postProcess: 'capitalizeFirstChar', }), light: lightThemeOptions.palette, diff --git a/src/components/Theme/ThemeManager.tsx b/src/components/Theme/ThemeManager.tsx index 98f18d9..1bfee78 100644 --- a/src/components/Theme/ThemeManager.tsx +++ b/src/components/Theme/ThemeManager.tsx @@ -264,7 +264,7 @@ export default function ThemeManager() { {userThemes?.map((theme, index) => (