From 208e01b6dbc84280905947b8c90558ebd7bad3f0 Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Tue, 20 May 2025 08:01:08 +0200 Subject: [PATCH] Rename processor --- docs/i18n_languages.md | 4 +- src/App.tsx | 8 ++-- src/components/Embeds/PollEmbed.tsx | 16 +++---- src/components/Group/AddGroupList.tsx | 2 +- src/components/Group/BlockedUsersModal.tsx | 13 ++++-- src/components/Group/ListOfBans.tsx | 2 +- src/components/Group/WalletsAppWrapper.tsx | 4 +- src/components/MainAvatar.tsx | 2 +- src/components/UserLookup.tsx/UserLookup.tsx | 44 ++++++++++++-------- src/components/WrapperUserAction.tsx | 12 +++--- src/i18n/locales/en/auth.json | 2 + 11 files changed, 64 insertions(+), 45 deletions(-) diff --git a/docs/i18n_languages.md b/docs/i18n_languages.md index 00fe1c8..90330ca 100644 --- a/docs/i18n_languages.md +++ b/docs/i18n_languages.md @@ -25,9 +25,9 @@ Translation in GUI: These are the current namespaces, in which all translations are organized: - `auth`: relative to the authentication (name, addresses, keys, secrets, seedphrase, and so on...) -- `core`: all the core translation (the most part) +- `core`: all the core translation - `group`: all translations concerning group management -- `tutorial`: this is dedicated to the tutorial pages +- `tutorial`: dedicated to the tutorial pages Please avoid duplication of the same translation. In the same page the usage of translations from different namespaces is permissible. diff --git a/src/App.tsx b/src/App.tsx index feb0d66..2c0e0c4 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2335,7 +2335,7 @@ function App() { hostname: requestBuyOrder?.hostname, count: requestBuyOrder?.crosschainAtInfo?.length || 0, }} - tOptions={{ postProcess: ['capitalizeFirst'] }} + tOptions={{ postProcess: ['capitalizeFirstChar'] }} > The Application
{{ hostname }}
@@ -2446,7 +2446,7 @@ function App() { hostname: requestBuyOrder?.hostname, count: requestBuyOrder?.crosschainAtInfo?.length || 0, }} - tOptions={{ postProcess: ['capitalizeFirst'] }} + tOptions={{ postProcess: ['capitalizeFirstChar'] }} > The Application
{{ hostname }}
@@ -2928,7 +2928,7 @@ function App() { /> ), }} - tOptions={{ postProcess: ['capitalizeFirst'] }} + tOptions={{ postProcess: ['capitalizeFirstChar'] }} > A SEEDPHRASE has been randomly generated in the background. @@ -2965,7 +2965,7 @@ function App() { /> ), }} - tOptions={{ postProcess: ['capitalizeFirst'] }} + tOptions={{ postProcess: ['capitalizeFirstChar'] }} > Create your Qortal account by clicking NEXT{' '} below. diff --git a/src/components/Embeds/PollEmbed.tsx b/src/components/Embeds/PollEmbed.tsx index 0765248..8a1d44c 100644 --- a/src/components/Embeds/PollEmbed.tsx +++ b/src/components/Embeds/PollEmbed.tsx @@ -215,7 +215,9 @@ export const PollCard = ({ setIsOpen(true); }} > - {t('core:action.show_poll', { postProcess: 'capitalizeFirst' })} + {t('core:action.show_poll', { + postProcess: 'capitalizeFirstChar', + })} )} @@ -273,7 +275,7 @@ export const PollCard = ({ fontSize: '18px', }} > - {t('core:option_other', { postProcess: 'capitalizeFirst' })} + {t('core:option_other', { postProcess: 'capitalizeFirstChar' })} - {t('core:action.vote', { postProcess: 'capitalizeFirst' })} + {t('core:action.vote', { postProcess: 'capitalizeFirstChar' })} {t('core:message.generic.already_voted', { - postProcess: 'capitalizeFirst', + postProcess: 'capitalizeFirstChar', })} @@ -350,7 +352,7 @@ export const PollCard = ({ }} > {t('core:message.generic.processing_transaction', { - postProcess: 'capitalizeFirst', + postProcess: 'capitalizeFirstChar', })} )} @@ -361,8 +363,8 @@ export const PollCard = ({ }} > {showResults - ? t('core:action.hide', { postProcess: 'capitalizeFirst' }) - : t('core:action.close', { postProcess: 'capitalizeFirst' })} + ? t('core:action.hide', { postProcess: 'capitalizeFirstChar' }) + : t('core:action.close', { postProcess: 'capitalizeFirstChar' })} diff --git a/src/components/Group/AddGroupList.tsx b/src/components/Group/AddGroupList.tsx index cd7bcf4..64c4b3b 100644 --- a/src/components/Group/AddGroupList.tsx +++ b/src/components/Group/AddGroupList.tsx @@ -190,7 +190,7 @@ export const AddGroupList = ({ setInfoSnack, setOpenSnack }) => { message: error.message || t('core:message.error.generic', { - postProcess: 'capitalizeFirst', + postProcess: 'capitalizeFirstChar', }), }); setOpenSnack(true); diff --git a/src/components/Group/BlockedUsersModal.tsx b/src/components/Group/BlockedUsersModal.tsx index aa0ac0a..de9ec80 100644 --- a/src/components/Group/BlockedUsersModal.tsx +++ b/src/components/Group/BlockedUsersModal.tsx @@ -99,7 +99,7 @@ export const BlockedUsersModal = () => { if (!data?.owner) throw new Error( t('auth:message.error.name_not_existing', { - postProcess: 'capitalizeFirst', + postProcess: 'capitalizeFirstChar', }) ); if (data?.owner) { @@ -138,9 +138,12 @@ export const BlockedUsersModal = () => { } catch (error) { setOpenSnackGlobal(true); setInfoSnackCustom({ - //TODO translate type: 'error', - message: error?.message || 'Unable to block user', + message: + error?.message || + t('auth:message.error.unable_block_user', { + postProcess: 'capitalizeFirstChar', + }), }); } }; @@ -168,7 +171,9 @@ export const BlockedUsersModal = () => { aria-labelledby="alert-dialog-title" aria-describedby="alert-dialog-description" > - Blocked Users + + {t('auth:blocked_users', { postProcess: 'capitalizeFirstChar' })} + { message: error.message || t('core:message.error.generic', { - postProcess: 'capitalizeFirst', + postProcess: 'capitalizeFirstChar', }), }); setOpenSnack(true); diff --git a/src/components/Group/WalletsAppWrapper.tsx b/src/components/Group/WalletsAppWrapper.tsx index ef2b66c..ee9885a 100644 --- a/src/components/Group/WalletsAppWrapper.tsx +++ b/src/components/Group/WalletsAppWrapper.tsx @@ -90,7 +90,9 @@ export const WalletsAppWrapper = () => { }} > - {t('core:q_apps.q_wallets', { postProcess: 'capitalizeFirst' })} + {t('core:q_apps.q_wallets', { + postProcess: 'capitalizeFirstChar', + })} diff --git a/src/components/MainAvatar.tsx b/src/components/MainAvatar.tsx index d81c029..be55714 100644 --- a/src/components/MainAvatar.tsx +++ b/src/components/MainAvatar.tsx @@ -106,7 +106,7 @@ export const MainAvatar = ({ myName, balance, setOpenSnack, setInfoSnack }) => { rej( error.message || t('core:message.error.generic', { - postProcess: 'capitalizeFirst', + postProcess: 'capitalizeFirstChar', }) ); }); diff --git a/src/components/UserLookup.tsx/UserLookup.tsx b/src/components/UserLookup.tsx/UserLookup.tsx index f227507..675d661 100644 --- a/src/components/UserLookup.tsx/UserLookup.tsx +++ b/src/components/UserLookup.tsx/UserLookup.tsx @@ -68,7 +68,7 @@ export const UserLookup = ({ isOpenDrawerLookup, setIsOpenDrawerLookup }) => { if (!inputAddressOrName?.trim()) throw new Error( t('auth:action.insert_name_address', { - postProcess: 'capitalizeFirst', + postProcess: 'capitalizeFirstChar', }) ); @@ -76,7 +76,7 @@ export const UserLookup = ({ isOpenDrawerLookup, setIsOpenDrawerLookup }) => { if (!owner) throw new Error( t('auth:message.error.name_not_existing', { - postProcess: 'capitalizeFirst', + postProcess: 'capitalizeFirstChar', }) ); @@ -84,7 +84,7 @@ export const UserLookup = ({ isOpenDrawerLookup, setIsOpenDrawerLookup }) => { if (!addressInfoRes?.publicKey) { throw new Error( t('auth:message.error.address_not_existing', { - postProcess: 'capitalizeFirst', + postProcess: 'capitalizeFirstChar', }) ); } @@ -192,7 +192,7 @@ export const UserLookup = ({ isOpenDrawerLookup, setIsOpenDrawerLookup }) => { autoComplete="off" {...params} label={t('auth:address_name', { - postProcess: 'capitalizeFirst', + postProcess: 'capitalizeFirstChar', })} onKeyDown={(e) => { if (e.key === 'Enter' && nameOrAddress) { @@ -288,7 +288,7 @@ export const UserLookup = ({ isOpenDrawerLookup, setIsOpenDrawerLookup }) => { > {addressInfo?.name ?? t('auth:message.error.name_not_registered', { - postProcess: 'capitalizeFirst', + postProcess: 'capitalizeFirstChar', })} @@ -331,7 +331,7 @@ export const UserLookup = ({ isOpenDrawerLookup, setIsOpenDrawerLookup }) => { textAlign: 'center', }} > - {t('core:level', { postProcess: 'capitalizeFirst' })}{' '} + {t('core:level', { postProcess: 'capitalizeFirstChar' })}{' '} {addressInfo?.level} @@ -362,7 +362,9 @@ export const UserLookup = ({ isOpenDrawerLookup, setIsOpenDrawerLookup }) => { }} > - {t('auth:address', { postProcess: 'capitalizeFirst' })} + {t('auth:address', { + postProcess: 'capitalizeFirstChar', + })} @@ -376,7 +378,7 @@ export const UserLookup = ({ isOpenDrawerLookup, setIsOpenDrawerLookup }) => { }} > {t('auth:action.copy_address', { - postProcess: 'capitalizeFirst', + postProcess: 'capitalizeFirstChar', })} } @@ -422,7 +424,9 @@ export const UserLookup = ({ isOpenDrawerLookup, setIsOpenDrawerLookup }) => { }} > - {t('core:balance', { postProcess: 'capitalizeFirst' })} + {t('core:balance', { + postProcess: 'capitalizeFirstChar', + })} {addressInfo?.balance} @@ -440,7 +444,7 @@ export const UserLookup = ({ isOpenDrawerLookup, setIsOpenDrawerLookup }) => { }} > {t('core:action.send_qort', { - postProcess: 'capitalizeFirst', + postProcess: 'capitalizeFirstChar', })} @@ -478,7 +482,7 @@ export const UserLookup = ({ isOpenDrawerLookup, setIsOpenDrawerLookup }) => { {t('core:message.generic.most_recent_payment', { count: 20, - postProcess: 'capitalizeFirst', + postProcess: 'capitalizeFirstChar', })} @@ -494,7 +498,7 @@ export const UserLookup = ({ isOpenDrawerLookup, setIsOpenDrawerLookup }) => { > {t('core:message.generic.no_payments', { - postProcess: 'capitalizeFirst', + postProcess: 'capitalizeFirstChar', })} @@ -504,16 +508,20 @@ export const UserLookup = ({ isOpenDrawerLookup, setIsOpenDrawerLookup }) => { - {t('core:sender', { postProcess: 'capitalizeFirst' })} + {t('core:sender', { postProcess: 'capitalizeFirstChar' })} - {t('core:receiver', { postProcess: 'capitalizeFirst' })} + {t('core:receiver', { + postProcess: 'capitalizeFirstChar', + })} - {t('core:amount', { postProcess: 'capitalizeFirst' })} + {t('core:amount', { postProcess: 'capitalizeFirstChar' })} - {t('core:time.time', { postProcess: 'capitalizeFirst' })} + {t('core:time.time', { + postProcess: 'capitalizeFirstChar', + })} @@ -532,7 +540,7 @@ export const UserLookup = ({ isOpenDrawerLookup, setIsOpenDrawerLookup }) => { }} > {t('auth:action.copy_address', { - postProcess: 'capitalizeFirst', + postProcess: 'capitalizeFirstChar', })} } @@ -577,7 +585,7 @@ export const UserLookup = ({ isOpenDrawerLookup, setIsOpenDrawerLookup }) => { }} > {t('auth:action.copy_address', { - postProcess: 'capitalizeFirst', + postProcess: 'capitalizeFirstChar', })} } diff --git a/src/components/WrapperUserAction.tsx b/src/components/WrapperUserAction.tsx index afcb686..e046ff1 100644 --- a/src/components/WrapperUserAction.tsx +++ b/src/components/WrapperUserAction.tsx @@ -98,7 +98,7 @@ export const WrapperUserAction = ({ children, address, name, disabled }) => { justifyContent: 'flex-start', }} > - {t('core:message.message', { postProcess: 'capitalizeFirst' })} + {t('core:message.message', { postProcess: 'capitalizeFirstChar' })} {/* Option 2: Send QORT */} @@ -117,7 +117,7 @@ export const WrapperUserAction = ({ children, address, name, disabled }) => { }} > {t('core:action.send_qort', { - postProcess: 'capitalizeFirst', + postProcess: 'capitalizeFirstChar', })} @@ -133,7 +133,7 @@ export const WrapperUserAction = ({ children, address, name, disabled }) => { }} > {t('auth:action.copy_address', { - postProcess: 'capitalizeFirst', + postProcess: 'capitalizeFirstChar', })} @@ -151,7 +151,7 @@ export const WrapperUserAction = ({ children, address, name, disabled }) => { }} > {t('core:user_lookup', { - postProcess: 'capitalizeFirst', + postProcess: 'capitalizeFirstChar', })} @@ -208,8 +208,8 @@ const BlockUser = ({ address, name, handleClose }) => { )} {isAlreadyBlocked && - t('core:action.unblock_name', { postProcess: 'capitalizeFirst' })} - {isAlreadyBlocked === false && t('core:action.block_name', { postProcess: 'capitalizeFirst' })}} + t('core:action.unblock_name', { postProcess: 'capitalizeFirstChar' })} + {isAlreadyBlocked === false && t('core:action.block_name', { postProcess: 'capitalizeFirstChar' })}} ); }; diff --git a/src/i18n/locales/en/auth.json b/src/i18n/locales/en/auth.json index a1dca21..ba017dd 100644 --- a/src/i18n/locales/en/auth.json +++ b/src/i18n/locales/en/auth.json @@ -35,6 +35,7 @@ "key": "API key", "select_valid": "select a valid apikey" }, + "blocked_users": "blocked users", "build_version": "build version", "message": { "error": { @@ -46,6 +47,7 @@ "invalid_secret_key": "secretKey is not valid", "name_not_existing": "name does not exist", "name_not_registered": "name not registered", + "unable_block_user": "unable to block user", "unable_decrypt": "unable to decrypt", "unable_reencrypt_secret_key": "unable to re-encrypt secret key" },