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_one": "account",
"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",
"change_apikey": "change APIkey",
"choose_custom_node": "choose custom node",
"create_account": "create account",
"import_key": "import APIkey",
"use_local_node": "use local node",
"using_node": "using node",
"return_to_list": "return to list",
"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"
}

View File

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

View File

@ -2,12 +2,23 @@
"account_many": "account",
"account_one": "account",
"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",
"change_apikey": "cambia la chiave API",
"choose_custom_node": "scegli un nodo custom",
"create_account": "crea un account",
"import_key": "importa chiave API",
"use_local_node": "usa nodo locale",
"using_node": "nodo in uso",
"return_to_list": "ritorna alla lista",
"welcome": "benvenuto in"
}

View File

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

View File

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