From c75b3de1cb9d9de8953c3b06e03ce1309bd7b6c3 Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Mon, 21 Apr 2025 20:29:48 +0200 Subject: [PATCH] i18n for thingsToDoInitial --- public/locales/en/tutorial.json | 9 ++++++-- public/locales/it/core.json | 1 + src/components/Group/ThingsToDoInitial.tsx | 25 ++++++++++++++++------ 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/public/locales/en/tutorial.json b/public/locales/en/tutorial.json index 8aeab89..2b632b3 100644 --- a/public/locales/en/tutorial.json +++ b/public/locales/en/tutorial.json @@ -3,10 +3,15 @@ "2_overview": "2. Overview", "3_groups": "3. Qortal Groups", "4_obtain_qort": "4. Obtaining Qort", - "account_creation": "Account Creation", - "important_info": "Important Information!", + "account_creation": "account creation", + "important_info": "important information!", "apps": { "dashboard": "1. Apps Dashboard", "navigation": "2. Apps Navigation" + }, + "initial": { + "6_qort": "Have at least 6 QORT in your wallet", + "getting_started": "getting started", + "register_name": "register a name" } } diff --git a/public/locales/it/core.json b/public/locales/it/core.json index 3bbac5b..673062f 100644 --- a/public/locales/it/core.json +++ b/public/locales/it/core.json @@ -6,6 +6,7 @@ "description": "descrizione", "edit": "modifica", "error": "si รจ verificato un errore", + "loading": "loading...", "save": "salva", "title": "titolo" } diff --git a/src/components/Group/ThingsToDoInitial.tsx b/src/components/Group/ThingsToDoInitial.tsx index 023cfde..6c315cd 100644 --- a/src/components/Group/ThingsToDoInitial.tsx +++ b/src/components/Group/ThingsToDoInitial.tsx @@ -4,10 +4,11 @@ import ListItem from '@mui/material/ListItem'; import ListItemButton from '@mui/material/ListItemButton'; import ListItemIcon from '@mui/material/ListItemIcon'; import ListItemText from '@mui/material/ListItemText'; -import { Box, Typography } from '@mui/material'; +import { Box, Typography, useTheme } from '@mui/material'; import { Spacer } from '../../common/Spacer'; import { QMailMessages } from './QMailMessages'; import { executeEvent } from '../../utils/events'; +import { useTranslation } from 'react-i18next'; export const ThingsToDoInitial = ({ myAddress, @@ -18,6 +19,8 @@ export const ThingsToDoInitial = ({ }) => { const [checked1, setChecked1] = React.useState(false); const [checked2, setChecked2] = React.useState(false); + const { t } = useTranslation(['core', 'tutorial']); + const theme = useTheme(); React.useEffect(() => { if (balance && +balance >= 6) { @@ -72,7 +75,11 @@ export const ThingsToDoInitial = ({ fontWeight: 600, }} > - {!isLoaded ? 'Loading...' : 'Getting Started'} + {!isLoaded + ? t('core:loading', { postProcess: 'capitalize' }) + : t('tutorial:initial.getting_started', { + postProcess: 'capitalize', + })} @@ -80,12 +87,12 @@ export const ThingsToDoInitial = ({ {isLoaded && ( @@ -114,7 +121,9 @@ export const ThingsToDoInitial = ({ fontWeight: 400, }, }} - primary={`Have at least 6 QORT in your wallet`} + primary={t('tutorial:initial.6_qort', { + postProcess: 'capitalize', + })} />