From 30ab1bada4573d3e42f8ab8f6b769ca8bdfd2c96 Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Sat, 26 Apr 2025 16:23:34 +0200 Subject: [PATCH] Translate group page --- public/locales/en/core.json | 5 +-- public/locales/en/group.json | 12 ++++++-- src/App.tsx | 8 ++--- src/components/CoreSyncStatus.tsx | 10 +++--- src/components/Group/AddGroup.tsx | 12 ++++---- src/components/Group/AddGroupList.tsx | 6 ++-- src/components/Group/Forum/GroupMail.tsx | 2 +- src/components/Group/Forum/NewThread.tsx | 4 +-- src/components/Group/Group.tsx | 39 ++++++++++++++++-------- src/components/Save/Save.tsx | 6 ++-- 10 files changed, 63 insertions(+), 41 deletions(-) diff --git a/public/locales/en/core.json b/public/locales/en/core.json index 5338962..407571c 100644 --- a/public/locales/en/core.json +++ b/public/locales/en/core.json @@ -16,7 +16,8 @@ "export": "export", "import": "import", "join": "join", - "logout": "logout" + "logout": "logout", + "notify": "notify" }, "core": { "block_height": "block height", @@ -49,7 +50,7 @@ "payment_notification": "payment notification", "price": "price", "q_mail": "q-mail", - "result": { + "message": { "error": { "generic": "an error occurred", "incorrect_password": "incorrect password", diff --git a/public/locales/en/group.json b/public/locales/en/group.json index f86f7ee..220aa9f 100644 --- a/public/locales/en/group.json +++ b/public/locales/en/group.json @@ -26,12 +26,20 @@ "join_group": "would you like to perform an JOIN_GROUP transaction?", "provide_thread": "please provide a thread title" }, - "result": { + "message": { + "generic": { + "encryption_key": "the group's first common encryption key is in the process of creation. Please wait a few minutes for it to be retrieved by the network. Checking every 2 minutes...", + "no_selection": "no group selected", + "not_part_group": "you are not part of the encrypted group of members. Wait until an admin re-encrypts the keys.", + "only_encrypted": "only unencrypted messages will be displayed.", + "setting_group": "setting up group... please wait." + }, "error": { "access_name": "cannot send a message without a access to your name", "description_required": "please provide a description", "group_info": "cannot access group information", - "name_required": "please provide a name" + "name_required": "please provide a name", + "notify_admins": "try notifying an admin from the list of admins below:" }, "success": { "group_creation": "successfully created group. It may take a couple of minutes for the changes to propagate", diff --git a/src/App.tsx b/src/App.tsx index 605900f..b3d11d0 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2961,7 +2961,7 @@ function App() { lineHeight: '15px', }} > - {t('core:result.success.transfer', { + {t('core:message.success.transfer', { postProcess: 'capitalize', })} @@ -2986,7 +2986,7 @@ function App() { lineHeight: '15px', }} > - {t('core:result.success.transfer', { + {t('core:message.success.transfer', { postProcess: 'capitalize', })} @@ -3011,7 +3011,7 @@ function App() { lineHeight: '15px', }} > - {t('core:result.success.order_submitted', { + {t('core:message.success.order_submitted', { postProcess: 'capitalize', })} @@ -3446,7 +3446,7 @@ function App() { label={ - {t('core:result.success.request_read', { + {t('core:message.success.request_read', { postProcess: 'capitalize', })} diff --git a/src/components/CoreSyncStatus.tsx b/src/components/CoreSyncStatus.tsx index f77580c..cf39375 100644 --- a/src/components/CoreSyncStatus.tsx +++ b/src/components/CoreSyncStatus.tsx @@ -79,21 +79,21 @@ export const CoreSyncStatus = () => { if (isMintingPossible && !isUsingGateway) { imagePath = syncedMintingImg; - message = `${t(`core:result.status.${isSynchronizing ? 'synchronizing' : 'synchronized'}`, { postProcess: 'capitalize' })} ${t('core:result.status.minting')}`; + message = `${t(`core:message.status.${isSynchronizing ? 'synchronizing' : 'synchronized'}`, { postProcess: 'capitalize' })} ${t('core:message.status.minting')}`; } else if (isSynchronizing === true && syncPercent === 99) { imagePath = syncingImg; } else if (isSynchronizing && !isMintingPossible && syncPercent === 100) { imagePath = syncingImg; - message = `${t('core:result.status.synchronizing', { postProcess: 'capitalize' })} ${!isUsingGateway ? t('core:result.status.not_minting') : ''}`; + message = `${t('core:message.status.synchronizing', { postProcess: 'capitalize' })} ${!isUsingGateway ? t('core:message.status.not_minting') : ''}`; } else if (!isSynchronizing && !isMintingPossible && syncPercent === 100) { imagePath = syncedImg; - message = `${t('core:result.status.synchronized', { postProcess: 'capitalize' })} ${!isUsingGateway ? t('core:result.status.not_minting') : ''}`; + message = `${t('core:message.status.synchronized', { postProcess: 'capitalize' })} ${!isUsingGateway ? t('core:message.status.not_minting') : ''}`; } else if (isSynchronizing && isMintingPossible && syncPercent === 100) { imagePath = syncingImg; - message = `${t('core:result.status.synchronizing', { postProcess: 'capitalize' })} ${!isUsingGateway ? t('core:result.status.minting') : ''}`; + message = `${t('core:message.status.synchronizing', { postProcess: 'capitalize' })} ${!isUsingGateway ? t('core:message.status.minting') : ''}`; } else if (!isSynchronizing && isMintingPossible && syncPercent === 100) { imagePath = syncedMintingImg; - message = `${t('core:result.status.synchronized', { postProcess: 'capitalize' })} ${!isUsingGateway ? t('core:result.status.minting') : ''}`; + message = `${t('core:message.status.synchronized', { postProcess: 'capitalize' })} ${!isUsingGateway ? t('core:message.status.minting') : ''}`; } return ( diff --git a/src/components/Group/AddGroup.tsx b/src/components/Group/AddGroup.tsx index 2bdf81a..66e3880 100644 --- a/src/components/Group/AddGroup.tsx +++ b/src/components/Group/AddGroup.tsx @@ -100,13 +100,13 @@ export const AddGroup = ({ address, open, setOpen }) => { try { if (!name) throw new Error( - t('group:result.error.name_required', { + t('group:message.error.name_required', { postProcess: 'capitalize', }) ); if (!description) throw new Error( - t('group:result.error.description_required', { + t('group:message.error.description_required', { postProcess: 'capitalize', }) ); @@ -134,7 +134,7 @@ export const AddGroup = ({ address, open, setOpen }) => { if (!response?.error) { setInfoSnack({ type: 'success', - message: t('group:result.success.group_creation', { + message: t('group:message.success.group_creation', { postProcess: 'capitalize', }), }); @@ -143,11 +143,11 @@ export const AddGroup = ({ address, open, setOpen }) => { { ...response, type: 'created-group', - label: t('group:result.success.group_creation_name', { + label: t('group:message.success.group_creation_name', { group_name: name, postProcess: 'capitalize', }), - labelDone: t('group:result.success.group_creation_label', { + labelDone: t('group:message.success.group_creation_label', { group_name: name, postProcess: 'capitalize', }), @@ -164,7 +164,7 @@ export const AddGroup = ({ address, open, setOpen }) => { rej({ message: error.message || - t('core:result.error.generic', { postProcess: 'capitalize' }), + t('core:message.error.generic', { postProcess: 'capitalize' }), }); }); }); diff --git a/src/components/Group/AddGroupList.tsx b/src/components/Group/AddGroupList.tsx index 9b6f65f..efc7dbf 100644 --- a/src/components/Group/AddGroupList.tsx +++ b/src/components/Group/AddGroupList.tsx @@ -122,7 +122,7 @@ export const AddGroupList = ({ setInfoSnack, setOpenSnack }) => { if (!response?.error) { setInfoSnack({ type: 'success', - message: t('group:result.success.join_group', { + message: t('group:message.success.join_group', { postProcess: 'capitalize', }), }); @@ -132,11 +132,11 @@ export const AddGroupList = ({ setInfoSnack, setOpenSnack }) => { { ...response, type: 'joined-group', - label: t('group:result.success.group_join_label', { + label: t('group:message.success.group_join_label', { group_name: group?.groupName, postProcess: 'capitalize', }), - labelDone: t('group:result.success.group_join_label', { + labelDone: t('group:message.success.group_join_label', { group_name: group?.groupName, postProcess: 'capitalize', }), diff --git a/src/components/Group/Forum/GroupMail.tsx b/src/components/Group/Forum/GroupMail.tsx index 985644e..7ad7814 100644 --- a/src/components/Group/Forum/GroupMail.tsx +++ b/src/components/Group/Forum/GroupMail.tsx @@ -834,7 +834,7 @@ export const GroupMail = ({ - No group selected - {' '} - // TODO translate + {t('group:message.generic.no_selection', { + postProcess: 'capitalize', + })} + )} @@ -2315,9 +2316,9 @@ export const Group = ({ > {' '} - The group's first common encryption key is in the process - of creation. Please wait a few minutes for it to be - retrieved by the network. Checking every 2 minutes... + {t('group:message.generic.encryption_key', { + postProcess: 'capitalize', + })} )} @@ -2341,18 +2342,23 @@ export const Group = ({ > {' '} - You are not part of the encrypted group of members. Wait - until an admin re-encrypts the keys. + {t('group:message.generic.not_part_group', { + postProcess: 'capitalize', + })} - Only unencrypted messages will be displayed. + {t('group:message.generic.only_encrypted', { + postProcess: 'capitalize', + })} - Try notifying an admin from the list of admins below: + {t('group:message.generic.notify_admins', { + postProcess: 'capitalize', + })} {adminsWithNames.map((admin) => { @@ -2372,7 +2378,9 @@ export const Group = ({ variant="contained" onClick={() => notifyAdmin(admin)} > - Notify + {t('core:action.notify', { + postProcess: 'capitalize', + })} ); @@ -2592,14 +2600,19 @@ export const Group = ({ open={isLoadingGroup} info={{ message: - isLoadingGroupMessage || 'Setting up group... please wait.', + isLoadingGroupMessage || + t('group:message.generic.setting_group', { + postProcess: 'capitalize', + }), }} /> diff --git a/src/components/Save/Save.tsx b/src/components/Save/Save.tsx index 3835c3e..af81863 100644 --- a/src/components/Save/Save.tsx +++ b/src/components/Save/Save.tsx @@ -169,7 +169,7 @@ export const Save = ({ isDesktop, disableWidth, myName }) => { .catch((error) => { rej( error.message || - t('core:result.error.generic', { postProcess: 'capitalize' }) + t('core:message.error.generic', { postProcess: 'capitalize' }) ); }); }); @@ -178,7 +178,7 @@ export const Save = ({ isDesktop, disableWidth, myName }) => { setSettingsQdnLastUpdated(Date.now()); setInfoSnack({ type: 'success', - message: t('core:result.success.publish_qdn', { + message: t('core:message.success.publish_qdn', { postProcess: 'capitalize', }), }); @@ -191,7 +191,7 @@ export const Save = ({ isDesktop, disableWidth, myName }) => { type: 'error', message: error?.message || - t('core:result.error.save_qdn', { + t('core:message.error.save_qdn', { postProcess: 'capitalize', }), });