Add translations

This commit is contained in:
Nicola Benaglia 2025-05-21 20:58:51 +02:00
parent 4240cec2e1
commit 22f6952e5a
5 changed files with 51 additions and 14 deletions

View File

@ -118,7 +118,10 @@ export const NotAuthenticated = ({
window.sendMessage('setCustomNodes', copyPrev).catch((error) => {
console.error(
'Failed to set custom nodes:',
error.message || 'An error occurred'
error.message ||
t('core:message.error.generic', {
postProcess: 'capitalizeFirstChar',
})
);
});
return copyPrev;
@ -175,7 +178,10 @@ export const NotAuthenticated = ({
.catch((error) => {
console.error(
'Failed to get custom nodes from storage:',
error.message || 'An error occurred'
error.message ||
t('core:message.error.generic', {
postProcess: 'capitalizeFirstChar',
})
);
});
}, []);
@ -238,7 +244,11 @@ export const NotAuthenticated = ({
const stillHasLocal = await checkIfUserHasLocalNode();
if (isLocalKey && !stillHasLocal && !fromStartUp) {
throw new Error('Please turn on your local node');
throw new Error(
t('auth:message.generic.turn_local_node', {
postProcess: 'capitalizeFirstChar',
})
);
}
//check custom nodes
// !gateways.some(gateway => apiKey?.url?.includes(gateway))
@ -297,7 +307,10 @@ export const NotAuthenticated = ({
.catch((error) => {
console.error(
'Failed to set custom nodes:',
error.message || 'An error occurred'
error.message ||
t('core:message.error.generic', {
postProcess: 'capitalizeFirstChar',
})
);
});
return copyPrev;
@ -348,7 +361,9 @@ export const NotAuthenticated = ({
console.error(
'Failed to set API key:',
error.message ||
t('core:error', { postProcess: 'capitalizeFirstChar' })
t('core:message.error.generic', {
postProcess: 'capitalizeFirstChar',
})
);
});
} else {
@ -383,7 +398,7 @@ export const NotAuthenticated = ({
console.error(
'Failed to set API key:',
error.message ||
t('core:error', {
t('core:message.error.generic', {
postProcess: 'capitalizeFirstChar',
})
);
@ -451,7 +466,10 @@ export const NotAuthenticated = ({
.catch((error) => {
console.error(
'Failed to set custom nodes:',
error.message || 'An error occurred'
error.message ||
t('core:message.error.generic', {
postProcess: 'capitalizeFirstChar',
})
);
});
};
@ -547,7 +565,9 @@ export const NotAuthenticated = ({
postProcess: 'capitalizeFirstChar',
})}
</Typography>
<Spacer height="10px" />
<Typography
color="inherit"
sx={{
@ -624,9 +644,9 @@ export const NotAuthenticated = ({
</Typography>
<Box
sx={{
alignItems: 'center',
display: 'flex',
gap: '10px',
alignItems: 'center',
justifyContent: 'center',
width: '100%',
}}
@ -659,7 +679,10 @@ export const NotAuthenticated = ({
.catch((error) => {
console.error(
'Failed to set API key:',
error.message || 'An error occurred'
error.message ||
t('core:message.error.generic', {
postProcess: 'capitalizeFirstChar',
})
);
});
}
@ -808,7 +831,10 @@ export const NotAuthenticated = ({
.catch((error) => {
console.error(
'Failed to set API key:',
error.message || 'An error occurred'
error.message ||
t('core:message.error.generic', {
postProcess: 'capitalizeFirstChar',
})
);
});
}}
@ -869,7 +895,10 @@ export const NotAuthenticated = ({
.catch((error) => {
console.error(
'Failed to set API key:',
error.message || 'An error occurred'
error.message ||
t('core:message.error.generic', {
postProcess: 'capitalizeFirstChar',
})
);
});
}}
@ -1066,7 +1095,10 @@ export const NotAuthenticated = ({
.catch((error) => {
console.error(
'Failed to set custom nodes:',
error.message || 'An error occurred'
error.message ||
t('core:message.error.generic', {
postProcess: 'capitalizeFirstChar',
})
);
});
return copyPrev;

View File

@ -69,7 +69,11 @@ export const useHandlePrivateApps = () => {
);
}
throw new Error('Unable to fetch app');
throw new Error(
t('core:message.error.unable_fetch_app', {
postProcess: 'capitalizeFirstChar',
})
);
}
data = await responseData.text();

View File

@ -30,7 +30,6 @@ function fetchFromLocalStorage(key) {
}
const getPublishRecord = async (myName) => {
// const validApi = await findUsableApi();
const url = `${getBaseApiReact()}${getArbitraryEndpointReact()}?mode=ALL&service=DOCUMENT_PRIVATE&identifier=ext_saved_settings&exactmatchnames=true&limit=1&prefix=true&name=${myName}`;
const response = await fetch(url);
if (!response.ok) {

View File

@ -79,6 +79,7 @@
"keep_secure": "keep your account file secure",
"publishing_key": "reminder: After publishing the key, it will take a couple of minutes for it to appear. Please just wait.",
"seedphrase_notice": "a <seed>SEEDPHRASE</seed> has been randomly generated in the background.",
"turn_local_node": "please turn on your local node",
"type_seed": "type or paste in your seed-phrase",
"your_accounts": "your saved accounts"
},

View File

@ -198,6 +198,7 @@
"unable_decrypt_app": "unable to decrypt private app'",
"unable_encrypt_app": "unable to encrypt app. App not published'",
"unable_fetch_app": "unable to fetch app",
"unable_fetch_publish": "unable to fetch publish",
"unable_publish_app": "unable to publish app",
"unable_publish_image": "unable to publish image",
"unable_rate": "unable to rate",