Add translations

This commit is contained in:
Nicola Benaglia 2025-04-21 14:47:23 +02:00
parent 3917aef452
commit 01b76c9817
5 changed files with 99 additions and 41 deletions

View File

@ -2,12 +2,23 @@
"account_many": "accounts", "account_many": "accounts",
"account_one": "account", "account_one": "account",
"advanced_users": "for advanced users", "advanced_users": "for advanced users",
"apikey": {
"alternative": "alternative: File select",
"change": "change APIkey",
"enter": "enter APIkey",
"import": "import APIkey",
"key": "API key",
"select_valid": "select a valid apikey"
},
"build_version": "build version", "build_version": "build version",
"change_apikey": "change APIkey",
"choose_custom_node": "choose custom node",
"create_account": "create account", "create_account": "create account",
"import_key": "import APIkey", "return_to_list": "return to list",
"use_local_node": "use local node", "node": {
"using_node": "using node", "choose": "choose custom node",
"custom_many": "custom nodes",
"use_custom": "use custom node",
"use_local": "use local node",
"using": "using node"
},
"welcome": "welcome to" "welcome": "welcome to"
} }

View File

@ -1,7 +1,11 @@
{ {
"add": "add",
"cancel": "cancel", "cancel": "cancel",
"choose": "choose", "choose": "choose",
"close": "close",
"description": "description", "description": "description",
"edit": "edit",
"error": "an error occurred",
"save": "save", "save": "save",
"title": "title" "title": "title"
} }

View File

@ -2,12 +2,23 @@
"account_many": "account", "account_many": "account",
"account_one": "account", "account_one": "account",
"advanced_users": "per utenti avanzati", "advanced_users": "per utenti avanzati",
"apikey": {
"alternative": "alternativa: seleziona un file",
"change": "cambia la chiave API",
"enter": "inserisci la chiave API",
"import": "importa chiave API",
"key": "chiave API",
"select_valid": "selezione una chiave API valida"
},
"node": {
"choose": "scegli un nodo custom",
"custom_many": "nodi custom",
"use_custom": "use nodo custom",
"use_local": "usa nodo locale",
"using": "nodo in uso"
},
"build_version": "versione build", "build_version": "versione build",
"change_apikey": "cambia la chiave API",
"choose_custom_node": "scegli un nodo custom",
"create_account": "crea un account", "create_account": "crea un account",
"import_key": "importa chiave API", "return_to_list": "ritorna alla lista",
"use_local_node": "usa nodo locale",
"using_node": "nodo in uso",
"welcome": "benvenuto in" "welcome": "benvenuto in"
} }

View File

@ -1,7 +1,11 @@
{ {
"add": "aggiungi",
"cancel": "cancella", "cancel": "cancella",
"choose": "scegli", "choose": "scegli",
"close": "chiudi",
"description": "descrizione", "description": "descrizione",
"edit": "modifica",
"error": "si è verificato un errore",
"save": "salva", "save": "salva",
"title": "titolo" "title": "titolo"
} }

View File

@ -40,8 +40,8 @@ export const HtmlTooltip = styled(({ className, ...props }: TooltipProps) => (
<Tooltip {...props} classes={{ popper: className }} /> <Tooltip {...props} classes={{ popper: className }} />
))(({ theme }) => ({ ))(({ theme }) => ({
[`& .${tooltipClasses.tooltip}`]: { [`& .${tooltipClasses.tooltip}`]: {
backgroundColor: '#232428', backgroundColor: theme.palette.background.paper,
color: 'white', color: theme.palette.text.primary,
maxWidth: 320, maxWidth: 320,
padding: '20px', padding: '20px',
fontSize: theme.typography.pxToRem(12), fontSize: theme.typography.pxToRem(12),
@ -350,7 +350,7 @@ export const NotAuthenticated = ({
.catch((error) => { .catch((error) => {
console.error( console.error(
'Failed to set API key:', 'Failed to set API key:',
error.message || 'An error occurred' error.message || t('core:error', { postProcess: 'capitalize' })
); );
}); });
} else { } else {
@ -359,7 +359,9 @@ export const NotAuthenticated = ({
if (!fromStartUp) { if (!fromStartUp) {
setInfoSnack({ setInfoSnack({
type: 'error', type: 'error',
message: 'Select a valid apikey', message: t('auth:apikey.select_valid', {
postProcess: 'capitalize',
}),
}); });
setOpenSnack(true); setOpenSnack(true);
} }
@ -382,7 +384,10 @@ export const NotAuthenticated = ({
.catch((error) => { .catch((error) => {
console.error( console.error(
'Failed to set API key:', 'Failed to set API key:',
error.message || 'An error occurred' error.message ||
t('core:error', {
postProcess: 'capitalize',
})
); );
}); });
return; return;
@ -390,7 +395,11 @@ export const NotAuthenticated = ({
if (!fromStartUp) { if (!fromStartUp) {
setInfoSnack({ setInfoSnack({
type: 'error', type: 'error',
message: error?.message || 'Select a valid apikey', message:
error?.message ||
t('auth:apikey.select_valid', {
postProcess: 'capitalize',
}),
}); });
setOpenSnack(true); setOpenSnack(true);
} }
@ -507,7 +516,8 @@ export const NotAuthenticated = ({
transaction you make is linked to your ID, and this is where you transaction you make is linked to your ID, and this is where you
manage all your QORT and other tradeable cryptocurrencies on manage all your QORT and other tradeable cryptocurrencies on
Qortal. Qortal.
</Typography> </Typography>{' '}
// TODO translate
</React.Fragment> </React.Fragment>
} }
> >
@ -538,7 +548,8 @@ export const NotAuthenticated = ({
}} }}
> >
New users start here! New users start here!
</Typography> </Typography>{' '}
// TODO translate
<Spacer height="10px" /> <Spacer height="10px" />
<Typography <Typography
color="inherit" color="inherit"
@ -550,7 +561,8 @@ export const NotAuthenticated = ({
to start using Qortal. Once you have made your account, you can to start using Qortal. Once you have made your account, you can
start doing things like obtaining some QORT, buying a name and start doing things like obtaining some QORT, buying a name and
avatar, publishing videos and blogs, and much more. avatar, publishing videos and blogs, and much more.
</Typography> </Typography>{' '}
// TODO translate
</React.Fragment> </React.Fragment>
} }
> >
@ -582,7 +594,7 @@ export const NotAuthenticated = ({
visibility: !useLocalNode && 'hidden', visibility: !useLocalNode && 'hidden',
}} }}
> >
{t('auth:using_node', { postProcess: 'capitalize' })}:{' '} {t('auth:node.using', { postProcess: 'capitalize' })}:{' '}
{currentNode?.url} {currentNode?.url}
</Typography> </Typography>
@ -635,7 +647,7 @@ export const NotAuthenticated = ({
}, },
'& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track': '& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track':
{ {
backgroundColor: 'white', // Change track color when checked backgroundColor: theme.palette.background.default,
}, },
}} }}
checked={useLocalNode} checked={useLocalNode}
@ -666,7 +678,11 @@ export const NotAuthenticated = ({
disabled={false} disabled={false}
/> />
} }
label={`Use ${isLocal ? 'Local' : 'Custom'} Node`} label={
isLocal
? t('auth:node.use_local', { postProcess: 'capitalize' })
: t('auth:node.use_custom', { postProcess: 'capitalize' })
}
/> />
</Box> </Box>
{currentNode?.url === 'http://127.0.0.1:12391' && ( {currentNode?.url === 'http://127.0.0.1:12391' && (
@ -677,14 +693,19 @@ export const NotAuthenticated = ({
variant="contained" variant="contained"
component="label" component="label"
> >
{apiKey ? 'Change ' : 'Import '} apikey {apiKey
? t('auth:node.use_local', { postProcess: 'capitalize' })
: t('auth:apikey.import', { postProcess: 'capitalize' })}
</Button> </Button>
<Typography <Typography
sx={{ sx={{
fontSize: '12px', fontSize: '12px',
visibility: importedApiKey ? 'visible' : 'hidden', visibility: importedApiKey ? 'visible' : 'hidden',
}} }}
>{`api key : ${importedApiKey}`}</Typography> >
{t('auth:apikey.key', { postProcess: 'capitalize' })}: $
{importedApiKey}
</Typography>
</> </>
)} )}
<Button <Button
@ -695,12 +716,12 @@ export const NotAuthenticated = ({
variant="contained" variant="contained"
component="label" component="label"
> >
{t('auth:choose_custom_node', { postProcess: 'capitalize' })} {t('auth:node.choose', { postProcess: 'capitalize' })}
</Button> </Button>
</> </>
<Typography <Typography
sx={{ sx={{
color: 'white', color: theme.palette.text.primary,
fontSize: '12px', fontSize: '12px',
}} }}
> >
@ -709,6 +730,7 @@ export const NotAuthenticated = ({
</Typography> </Typography>
</Box> </Box>
</> </>
<CustomizedSnackbars <CustomizedSnackbars
open={openSnack} open={openSnack}
setOpen={setOpenSnack} setOpen={setOpenSnack}
@ -722,7 +744,10 @@ export const NotAuthenticated = ({
aria-describedby="alert-dialog-description" aria-describedby="alert-dialog-description"
fullWidth fullWidth
> >
<DialogTitle id="alert-dialog-title">{'Custom nodes'}</DialogTitle> <DialogTitle id="alert-dialog-title">
{' '}
{t('auth:node.custom_many', { postProcess: 'capitalize' })}:
</DialogTitle>
<DialogContent> <DialogContent>
<Box <Box
sx={{ sx={{
@ -750,7 +775,7 @@ export const NotAuthenticated = ({
> >
<Typography <Typography
sx={{ sx={{
color: 'white', color: theme.palette.text.primary,
fontSize: '14px', fontSize: '14px',
}} }}
> >
@ -807,7 +832,7 @@ export const NotAuthenticated = ({
> >
<Typography <Typography
sx={{ sx={{
color: 'white', color: theme.palette.text.primary,
fontSize: '14px', fontSize: '14px',
}} }}
> >
@ -850,8 +875,9 @@ export const NotAuthenticated = ({
}} }}
variant="contained" variant="contained"
> >
Choose {t('core:choose', { postProcess: 'capitalize' })}
</Button> </Button>
<Button <Button
size="small" size="small"
onClick={() => { onClick={() => {
@ -862,20 +888,20 @@ export const NotAuthenticated = ({
}} }}
variant="contained" variant="contained"
> >
Edit {t('core:edit', { postProcess: 'capitalize' })}
</Button> </Button>
<Button <Button
size="small" size="small"
onClick={() => { onClick={() => {
const nodesToSave = [ const nodesToSave = [
...(customNodes || []), ...(customNodes || []),
].filter((item) => item?.url !== node?.url); ].filter((item) => item?.url !== node?.url);
saveCustomNodes(nodesToSave, true); saveCustomNodes(nodesToSave, true);
}} }}
variant="contained" variant="contained"
> >
Remove {t('core:remove', { postProcess: 'capitalize' })}
</Button> </Button>
</Box> </Box>
</Box> </Box>
@ -920,13 +946,13 @@ export const NotAuthenticated = ({
}} }}
autoFocus autoFocus
> >
Close {t('core:close', { postProcess: 'capitalize' })}
</Button> </Button>
</> </>
)} )}
{mode === 'list' && ( {mode === 'list' && (
<Button variant="contained" onClick={addCustomNode}> <Button variant="contained" onClick={addCustomNode}>
Add {t('core:add', { postProcess: 'capitalize' })}
</Button> </Button>
)} )}
@ -939,7 +965,7 @@ export const NotAuthenticated = ({
setCustomNodeToSaveIndex(null); setCustomNodeToSaveIndex(null);
}} }}
> >
Return to list {t('auth:return_to_list', { postProcess: 'capitalize' })}
</Button> </Button>
<Button <Button
@ -948,7 +974,7 @@ export const NotAuthenticated = ({
onClick={() => saveCustomNodes(customNodes)} onClick={() => saveCustomNodes(customNodes)}
autoFocus autoFocus
> >
Save {t('core:save', { postProcess: 'capitalize' })}
</Button> </Button>
</> </>
)} )}
@ -962,7 +988,9 @@ export const NotAuthenticated = ({
aria-labelledby="alert-dialog-title" aria-labelledby="alert-dialog-title"
aria-describedby="alert-dialog-description" aria-describedby="alert-dialog-description"
> >
<DialogTitle id="alert-dialog-title">{'Enter apikey'}</DialogTitle> <DialogTitle id="alert-dialog-title">
{t('auth:enter_apikey', { postProcess: 'capitalize' })}
</DialogTitle>
<DialogContent> <DialogContent>
<Box <Box
sx={{ sx={{
@ -980,7 +1008,7 @@ export const NotAuthenticated = ({
variant="contained" variant="contained"
component="label" component="label"
> >
Alternative: File select {t('auth:apikey_alternative', { postProcess: 'capitalize' })}
<input <input
type="file" type="file"
accept=".txt" accept=".txt"
@ -998,7 +1026,7 @@ export const NotAuthenticated = ({
setShowSelectApiKey(false); setShowSelectApiKey(false);
}} }}
> >
Close {t('core:close', { postProcess: 'capitalize' })}
</Button> </Button>
<Button <Button
@ -1044,7 +1072,7 @@ export const NotAuthenticated = ({
}} }}
autoFocus autoFocus
> >
Save {t('core:save', { postProcess: 'capitalize' })}
</Button> </Button>
</DialogActions> </DialogActions>
</Dialog> </Dialog>