Add translations to App

This commit is contained in:
Nicola Benaglia 2025-04-24 21:33:04 +02:00
parent 02ac187675
commit b0f0ec57a9
2 changed files with 33 additions and 39 deletions

View File

@ -2,6 +2,8 @@
"action": { "action": {
"add": "add", "add": "add",
"accept": "accept", "accept": "accept",
"backup_account": "backup account",
"backup_wallet": "backup wallet",
"cancel": "cancel", "cancel": "cancel",
"change": "change", "change": "change",
"choose": "choose", "choose": "choose",
@ -55,8 +57,10 @@
}, },
"success": { "success": {
"group_creation": "successfully created group. It may take a couple of minutes for the changes to propagate", "group_creation": "successfully created group. It may take a couple of minutes for the changes to propagate",
"order_submitted": "your buy order was submitted",
"publish_qdn": "successfully published to QDN", "publish_qdn": "successfully published to QDN",
"request_read": "I have read this request" "request_read": "I have read this request",
"transfer": "the transfer was succesful!"
} }
}, },
"question": { "question": {
@ -88,7 +92,6 @@
"tutorial": "tutorial", "tutorial": "tutorial",
"user_lookup": "user lookup", "user_lookup": "user lookup",
"wallet": { "wallet": {
"backup_wallet": "backup wallet",
"wallet": "wallet", "wallet": "wallet",
"wallet_other": "wallets" "wallet_other": "wallets"
}, },

View File

@ -257,14 +257,7 @@ export const getBaseApiReact = (customApi?: string) => {
return groupApi; return groupApi;
} }
}; };
// export const getArbitraryEndpointReact = () => {
// if (globalApiKey) {
// return `/arbitrary/resources/search`;
// } else {
// return `/arbitrary/resources/searchsimple`;
// }
// };
export const getArbitraryEndpointReact = () => { export const getArbitraryEndpointReact = () => {
if (globalApiKey) { if (globalApiKey) {
return `/arbitrary/resources/searchsimple`; return `/arbitrary/resources/searchsimple`;
@ -538,7 +531,7 @@ function App() {
console.error( console.error(
'Failed to get API key:', 'Failed to get API key:',
error?.message || 'An error occurred' error?.message || 'An error occurred'
); ); // TODO translate
}) })
.finally(() => { .finally(() => {
window window
@ -593,26 +586,6 @@ function App() {
isFocusedRef.current = isFocused; isFocusedRef.current = isFocused;
}, [isFocused]); }, [isFocused]);
// const checkIfUserHasLocalNode = useCallback(async () => {
// try {
// const url = `http://127.0.0.1:12391/admin/status`;
// const response = await fetch(url, {
// method: "GET",
// headers: {
// "Content-Type": "application/json",
// },
// });
// const data = await response.json();
// if (data?.isSynchronizing === false && data?.syncPercent === 100) {
// setHasLocalNode(true);
// }
// } catch (error) {}
// }, []);
// useEffect(() => {
// checkIfUserHasLocalNode();
// }, [extState]);
const address = useMemo(() => { const address = useMemo(() => {
if (!rawWallet?.address0) return ''; if (!rawWallet?.address0) return '';
return rawWallet.address0; return rawWallet.address0;
@ -1050,7 +1023,7 @@ function App() {
await showUnsavedChanges({ await showUnsavedChanges({
message: message:
'Your settings have changed. If you logout you will lose your changes. Click on the save button in the header to keep your changed settings.', 'Your settings have changed. If you logout you will lose your changes. Click on the save button in the header to keep your changed settings.',
}); }); // TODO translate
} else if (extState === 'authenticated') { } else if (extState === 'authenticated') {
await showUnsavedChanges({ await showUnsavedChanges({
message: 'Are you sure you would like to logout?', message: 'Are you sure you would like to logout?',
@ -1354,19 +1327,24 @@ function App() {
</Tooltip> </Tooltip>
)} )}
</Box> </Box>
<Spacer height="48px" /> <Spacer height="48px" />
{authenticatedMode === 'ltc' ? ( {authenticatedMode === 'ltc' ? (
<> <>
<img src={ltcLogo} /> <img src={ltcLogo} />
<Spacer height="32px" /> <Spacer height="32px" />
<CopyToClipboard text={rawWallet?.ltcAddress}> <CopyToClipboard text={rawWallet?.ltcAddress}>
<AddressBox> <AddressBox>
{rawWallet?.ltcAddress?.slice(0, 6)}... {rawWallet?.ltcAddress?.slice(0, 6)}...
{rawWallet?.ltcAddress?.slice(-4)} <img src={Copy} /> {rawWallet?.ltcAddress?.slice(-4)} <img src={Copy} />
</AddressBox> </AddressBox>
</CopyToClipboard> </CopyToClipboard>
<Spacer height="10px" /> <Spacer height="10px" />
{ltcBalanceLoading && ( {ltcBalanceLoading && (
<CircularProgress color="success" size={16} /> <CircularProgress color="success" size={16} />
)} )}
@ -1388,6 +1366,7 @@ function App() {
> >
{ltcBalance} LTC {ltcBalance} LTC
</TextP> </TextP>
<RefreshIcon <RefreshIcon
onClick={getLtcBalanceFunc} onClick={getLtcBalanceFunc}
sx={{ sx={{
@ -1407,7 +1386,9 @@ function App() {
myName={userInfo?.name} myName={userInfo?.name}
balance={balance} balance={balance}
/> />
<Spacer height="32px" /> <Spacer height="32px" />
<TextP <TextP
sx={{ sx={{
textAlign: 'center', textAlign: 'center',
@ -1417,7 +1398,9 @@ function App() {
> >
{userInfo?.name} {userInfo?.name}
</TextP> </TextP>
<Spacer height="10px" /> <Spacer height="10px" />
<CopyToClipboard text={rawWallet?.address0}> <CopyToClipboard text={rawWallet?.address0}>
<AddressBox> <AddressBox>
{rawWallet?.address0?.slice(0, 6)}... {rawWallet?.address0?.slice(0, 6)}...
@ -1912,7 +1895,7 @@ function App() {
textTransform: 'uppercase', textTransform: 'uppercase',
}} }}
> >
{t('core:backup_wallet')} {t('core:action.backup_wallet')}
</span> </span>
} }
placement="left" placement="left"
@ -3090,7 +3073,9 @@ function App() {
}); });
}} }}
> >
Backup Account {t('core:action.backup_account', {
postProcess: 'capitalize',
})}
</CustomButton> </CustomButton>
</> </>
)} )}
@ -3118,7 +3103,9 @@ function App() {
lineHeight: '15px', lineHeight: '15px',
}} }}
> >
The transfer was succesful! {t('core:result.success.transfer', {
postProcess: 'capitalize',
})}
</TextP> </TextP>
<Spacer height="100px" /> <Spacer height="100px" />
<CustomButton <CustomButton
@ -3126,7 +3113,7 @@ function App() {
returnToMain(); returnToMain();
}} }}
> >
Continue {t('core:action.continue', { postProcess: 'capitalize' })}
</CustomButton> </CustomButton>
</Box> </Box>
)} )}
@ -3141,7 +3128,9 @@ function App() {
lineHeight: '15px', lineHeight: '15px',
}} }}
> >
The transfer was succesful! {t('core:result.success.transfer', {
postProcess: 'capitalize',
})}
</TextP> </TextP>
<Spacer height="100px" /> <Spacer height="100px" />
<CustomButton <CustomButton
@ -3149,7 +3138,7 @@ function App() {
window.close(); window.close();
}} }}
> >
Continue {t('core:action.continue', { postProcess: 'capitalize' })}
</CustomButton> </CustomButton>
</> </>
)} )}
@ -3164,7 +3153,9 @@ function App() {
lineHeight: '15px', lineHeight: '15px',
}} }}
> >
Your buy order was submitted {t('core:result.success.order_submitted', {
postProcess: 'capitalize',
})}
</TextP> </TextP>
<Spacer height="100px" /> <Spacer height="100px" />
<CustomButton <CustomButton
@ -3172,7 +3163,7 @@ function App() {
window.close(); window.close();
}} }}
> >
Close {t('core:action.close', { postProcess: 'capitalize' })}
</CustomButton> </CustomButton>
</> // TODO translate </> // TODO translate
)} )}