From b0f0ec57a98a11b3492c18bdecf0d1157931d520 Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Thu, 24 Apr 2025 21:33:04 +0200 Subject: [PATCH] Add translations to App --- public/locales/en/core.json | 7 ++-- src/App.tsx | 65 ++++++++++++++++--------------------- 2 files changed, 33 insertions(+), 39 deletions(-) diff --git a/public/locales/en/core.json b/public/locales/en/core.json index f2191be..bb56264 100644 --- a/public/locales/en/core.json +++ b/public/locales/en/core.json @@ -2,6 +2,8 @@ "action": { "add": "add", "accept": "accept", + "backup_account": "backup account", + "backup_wallet": "backup wallet", "cancel": "cancel", "change": "change", "choose": "choose", @@ -55,8 +57,10 @@ }, "success": { "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", - "request_read": "I have read this request" + "request_read": "I have read this request", + "transfer": "the transfer was succesful!" } }, "question": { @@ -88,7 +92,6 @@ "tutorial": "tutorial", "user_lookup": "user lookup", "wallet": { - "backup_wallet": "backup wallet", "wallet": "wallet", "wallet_other": "wallets" }, diff --git a/src/App.tsx b/src/App.tsx index e74f168..38b8337 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -257,14 +257,7 @@ export const getBaseApiReact = (customApi?: string) => { return groupApi; } }; -// export const getArbitraryEndpointReact = () => { -// if (globalApiKey) { -// return `/arbitrary/resources/search`; -// } else { -// return `/arbitrary/resources/searchsimple`; -// } -// }; export const getArbitraryEndpointReact = () => { if (globalApiKey) { return `/arbitrary/resources/searchsimple`; @@ -538,7 +531,7 @@ function App() { console.error( 'Failed to get API key:', error?.message || 'An error occurred' - ); + ); // TODO translate }) .finally(() => { window @@ -593,26 +586,6 @@ function App() { isFocusedRef.current = 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(() => { if (!rawWallet?.address0) return ''; return rawWallet.address0; @@ -1050,7 +1023,7 @@ function App() { await showUnsavedChanges({ 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.', - }); + }); // TODO translate } else if (extState === 'authenticated') { await showUnsavedChanges({ message: 'Are you sure you would like to logout?', @@ -1354,19 +1327,24 @@ function App() { )} + {authenticatedMode === 'ltc' ? ( <> + + {rawWallet?.ltcAddress?.slice(0, 6)}... {rawWallet?.ltcAddress?.slice(-4)} + + {ltcBalanceLoading && ( )} @@ -1388,6 +1366,7 @@ function App() { > {ltcBalance} LTC + + + {userInfo?.name} + + {rawWallet?.address0?.slice(0, 6)}... @@ -1912,7 +1895,7 @@ function App() { textTransform: 'uppercase', }} > - {t('core:backup_wallet')} + {t('core:action.backup_wallet')} } placement="left" @@ -3090,7 +3073,9 @@ function App() { }); }} > - Backup Account + {t('core:action.backup_account', { + postProcess: 'capitalize', + })} )} @@ -3118,7 +3103,9 @@ function App() { lineHeight: '15px', }} > - The transfer was succesful! + {t('core:result.success.transfer', { + postProcess: 'capitalize', + })} - Continue + {t('core:action.continue', { postProcess: 'capitalize' })} )} @@ -3141,7 +3128,9 @@ function App() { lineHeight: '15px', }} > - The transfer was succesful! + {t('core:result.success.transfer', { + postProcess: 'capitalize', + })} - Continue + {t('core:action.continue', { postProcess: 'capitalize' })} )} @@ -3164,7 +3153,9 @@ function App() { lineHeight: '15px', }} > - Your buy order was submitted + {t('core:result.success.order_submitted', { + postProcess: 'capitalize', + })} - Close + {t('core:action.close', { postProcess: 'capitalize' })} // TODO translate )}