diff --git a/i18n.js b/i18n.js index 631d33a..ddda868 100644 --- a/i18n.js +++ b/i18n.js @@ -14,7 +14,7 @@ const isDev = process.env.NODE_ENV === 'development'; const capitalize = { type: 'postProcessor', name: 'capitalize', - process: (value, key, options, translator) => { + process: (value) => { return value.charAt(0).toUpperCase() + value.slice(1); }, }; diff --git a/public/locales/en/auth.json b/public/locales/en/auth.json index 02c348d..36d2329 100644 --- a/public/locales/en/auth.json +++ b/public/locales/en/auth.json @@ -10,15 +10,23 @@ "key": "API key", "select_valid": "select a valid apikey" }, + "authenticate": "authenticate", "build_version": "build version", "create_account": "create account", - "return_to_list": "return to list", + "download_account": "download account", + "keep_secure": "Keep your account file secure", "node": { "choose": "choose custom node", "custom_many": "custom nodes", "use_custom": "use custom node", "use_local": "use local node", - "using": "using node" + "using": "using node", + "using_public": "using public node" }, + "password": "password", + "password_confirmation": "confirm password", + "return_to_list": "return to list", + "wallet_password_confirmation": "confirm wallet password", + "wallet_password": "wallet password", "welcome": "welcome to" } diff --git a/public/locales/en/core.json b/public/locales/en/core.json index 0674642..1f7bbab 100644 --- a/public/locales/en/core.json +++ b/public/locales/en/core.json @@ -1,17 +1,27 @@ { "add": "add", + "backup_wallet": "backup wallet", "cancel": "cancel", "choose": "choose", "close": "close", + "continue": "continue", "description": "description", "edit": "edit", "error": "an error occurred", "last_height": "last height", "loading": "loading...", + "logout": "logout", + "minting_status": "minting status", + "payment_notification": "payment notification", "price": "price", + "q_mail": "q-mail", "save": "save", + "settings": "settings", "supply": "supply", "title": "title", + "tutorial": "tutorial", + "your_account": "your account", + "user_lookup": "user lookup", "wallet": "wallet", "wallet_other": "wallets", "welcome": "welcome" diff --git a/public/locales/it/auth.json b/public/locales/it/auth.json index 306bd0f..6b820c7 100644 --- a/public/locales/it/auth.json +++ b/public/locales/it/auth.json @@ -10,15 +10,22 @@ "key": "chiave API", "select_valid": "selezione una chiave API valida" }, + "authenticate": "autenticazione", + "build_version": "versione build", + "download_account": "scarica account", + "keep_secure": "metti al sicuro il file del tuo account", "node": { "choose": "scegli un nodo custom", "custom_many": "nodi custom", "use_custom": "use nodo custom", "use_local": "usa nodo locale", - "using": "nodo in uso" + "using": "nodo in uso", + "using_public": "utilizzo nodo pubblico" }, - "build_version": "versione build", - "create_account": "crea un account", + "password": "password", + "password_confirmation": "confirma la password", + "wallet_password_confirmation": "conferma la password del wallet", "return_to_list": "ritorna alla lista", + "wallet_password": "password del wallet", "welcome": "benvenuto in" } diff --git a/public/locales/it/core.json b/public/locales/it/core.json index 6376e0a..bc6dd31 100644 --- a/public/locales/it/core.json +++ b/public/locales/it/core.json @@ -1,17 +1,27 @@ { "add": "aggiungi", + "backup_wallet": "backup wallet", "cancel": "cancella", "choose": "scegli", "close": "chiudi", + "continue": "continua", "description": "descrizione", "edit": "modifica", "error": "si รจ verificato un errore", "last_height": "ultimo blocco", "loading": "caricamento...", + "logout": "disconnetti", + "minting_status": "stato minting", + "payment_notification": "notifiche pagamenti", "price": "prezzo", + "q_mail": "q-mail", "save": "salva", + "settings": "impostazioni", "supply": "offerta", "title": "titolo", + "tutorial": "tutorial", + "your_account": "il tuo account", + "user_lookup": "ricerca utente", "wallet": "wallet", "wallet_other": "wallet", "welcome": "benvenuto" diff --git a/public/locales/it/tutorial.json b/public/locales/it/tutorial.json new file mode 100644 index 0000000..08fb1df --- /dev/null +++ b/public/locales/it/tutorial.json @@ -0,0 +1,21 @@ +{ + "1_getting_started": "1. Come iniziare", + "2_overview": "2. Overview", + "3_groups": "3. I gruppi in Qortal", + "4_obtain_qort": "4. Ottenere Qort", + "account_creation": "creazione account", + "important_info": "important information!", + "apps": { + "dashboard": "1. Dashboard delle app", + "navigation": "2. Navigation tra le app" + }, + "initial": { + "6_qort": "Avere almeno 6 QORT nel proprio wallet", + "explore": "esplora", + "general_chat": "chat generaleat", + "getting_started": "Come iniziare", + "register_name": "registra un nome", + "see_apps": "vedi le apps", + "trade_qort": "scambia i QORT" + } +} diff --git a/src/App.tsx b/src/App.tsx index 7d3a7c7..420e36f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -136,6 +136,7 @@ import { QortPayment } from './components/QortPayment'; import { GeneralNotifications } from './components/GeneralNotifications'; import { PdfViewer } from './common/PdfViewer'; import ThemeSelector from './components/Theme/ThemeSelector.tsx'; +import { useTranslation } from 'react-i18next'; type extStates = | 'not-authenticated' @@ -316,6 +317,8 @@ function App() { const [sendqortState, setSendqortState] = useState(null); const [isLoading, setIsLoading] = useState(false); const [isLoadingSendCoin, setIsLoadingSendCoin] = useState(false); + + const { t } = useTranslation(['auth', 'core']); const theme = useTheme(); const [ @@ -1550,9 +1553,10 @@ function App() { style={{ fontSize: '14px', fontWeight: 700, + textTransform: 'uppercase', }} > - LOGOUT + {t('core:logout')} } placement="left" @@ -1589,9 +1593,10 @@ function App() { style={{ fontSize: '14px', fontWeight: 700, + textTransform: 'uppercase', }} > - SETTINGS + {t('core:settings')} } placement="left" @@ -1628,9 +1633,10 @@ function App() { style={{ fontSize: '14px', fontWeight: 700, + textTransform: 'uppercase', }} > - USER LOOKUP + {t('core:user_lookup')} } placement="left" @@ -1667,9 +1673,10 @@ function App() { style={{ fontSize: '14px', fontWeight: 700, + textTransform: 'uppercase', }} > - WALLETS + {t('core:wallet_other')} } placement="left" @@ -1703,9 +1710,10 @@ function App() { style={{ fontSize: '14px', fontWeight: 700, + textTransform: 'uppercase', }} > - YOUR ACCOUNT + {t('core:your_account')} } placement="left" @@ -1813,9 +1821,10 @@ function App() { style={{ fontSize: '14px', fontWeight: 700, + textTransform: 'uppercase', }} > - MINTING STATUS + {t('core:minting_status')} } placement="left" @@ -1857,9 +1866,10 @@ function App() { style={{ fontSize: '14px', fontWeight: 700, + textTransform: 'uppercase', }} > - TUTORIAL + {t('core:tutorial')} } placement="left" @@ -1894,8 +1904,14 @@ function App() { > - BACKUP WALLET + + {t('core:backup_wallet')} } placement="left" @@ -2083,6 +2099,7 @@ function App() { {messageQortalRequest?.text1} + {messageQortalRequest?.text2 && ( <> @@ -2124,6 +2141,7 @@ function App() { > {messageQortalRequest?.text3} + @@ -2158,11 +2176,11 @@ function App() { {messageQortalRequest?.highlightedText} @@ -2379,17 +2397,7 @@ function App() { > {sendqortState?.amount} QORT - {/* - - Confirm Wallet Password - - - setPaymentPassword(e.target.value)} - /> */} - Create account + {t('auth:create_account', { postProcess: 'capitalize' })} )} @@ -2624,7 +2632,7 @@ function App() { fontWeight: 600, }} > - Authenticate + {t('auth:authenticate', { postProcess: 'capitalize' })} @@ -2632,7 +2640,7 @@ function App() { <> - Wallet Password + {t('auth:wallet_password', { postProcess: 'capitalize' })} @@ -2656,7 +2664,8 @@ function App() { fontSize: '12px', }} > - {'Using node: '} {currentNode?.url} + {t('auth:node.using', { postProcess: 'capitalize' })}:{' '} + {currentNode?.url} ) : ( @@ -2667,7 +2676,7 @@ function App() { fontSize: '12px', }} > - {'Using public node'} + {t('auth:node.using_public', { postProcess: 'capitalize' })} )} @@ -2675,7 +2684,7 @@ function App() { - Authenticate + {t('auth:authenticate', { postProcess: 'capitalize' })} {walletToBeDecryptedError} @@ -2703,7 +2712,9 @@ function App() { onClick={returnToMain} /> + +
- Download Account + {t('auth:download_account', { postProcess: 'capitalize' })} @@ -2740,9 +2751,13 @@ function App() { {!walletToBeDownloaded && ( <> - Confirm Wallet Password + {t('auth:wallet_password_confirmation', { + postProcess: 'capitalize', + })} + + + + - Confirm password + {t('auth:password_confirmation', { + postProcess: 'capitalize', + })} {walletToBeDownloadedError} @@ -2764,11 +2783,15 @@ function App() { onClick={async () => { await saveFileToDiskFunc(); await showInfo({ - message: `Keep your account file secure.`, + message: t('auth:keep_secure', { + postProcess: 'capitalize', + }), }); }} > - Download account + {t('auth:download_account', { + postProcess: 'capitalize', + })} )} @@ -3024,7 +3047,7 @@ function App() { - Create Account + {t('auth:create_account', { postProcess: 'capitalize' })} {walletToBeDownloadedError} diff --git a/src/components/GeneralNotifications.tsx b/src/components/GeneralNotifications.tsx index 97c498b..6335dbf 100644 --- a/src/components/GeneralNotifications.tsx +++ b/src/components/GeneralNotifications.tsx @@ -14,6 +14,7 @@ import AccountBalanceWalletIcon from '@mui/icons-material/AccountBalanceWallet'; import { formatDate } from '../utils/time'; import { useHandlePaymentNotification } from '../hooks/useHandlePaymentNotification'; import { executeEvent } from '../utils/events'; +import { useTranslation } from 'react-i18next'; export const GeneralNotifications = ({ address }) => { const [anchorEl, setAnchorEl] = useState(null); @@ -31,6 +32,7 @@ export const GeneralNotifications = ({ address }) => { setAnchorEl(event.currentTarget); }; + const { t } = useTranslation(['core']); const theme = useTheme(); return ( @@ -48,9 +50,10 @@ export const GeneralNotifications = ({ address }) => { color: theme.palette.text.primary, fontSize: '14px', fontWeight: 700, + textTransform: 'uppercase', }} > - PAYMENT NOTIFICATION + {t('core:payment_notification')} } placement="left" diff --git a/src/components/QMailStatus.tsx b/src/components/QMailStatus.tsx index c760751..dd6f9be 100644 --- a/src/components/QMailStatus.tsx +++ b/src/components/QMailStatus.tsx @@ -1,13 +1,14 @@ import { useMemo } from 'react'; -import EmailIcon from '@mui/icons-material/Email'; import { useRecoilState } from 'recoil'; import { mailsAtom, qMailLastEnteredTimestampAtom } from '../atoms/global'; import { isLessThanOneWeekOld } from './Group/QMailMessages'; import { ButtonBase, Tooltip, useTheme } from '@mui/material'; import { executeEvent } from '../utils/events'; import { Mail } from '@mui/icons-material'; +import { useTranslation } from 'react-i18next'; export const QMailStatus = () => { + const { t } = useTranslation(['core']); const theme = useTheme(); const [lastEnteredTimestamp, setLastEnteredTimestamp] = useRecoilState( @@ -63,7 +64,9 @@ export const QMailStatus = () => { fontWeight: 700, }} > - Q-MAIL + {t('core:q_mail', { + postProcess: 'capitalize', + })} } placement="left"