Translate group page

This commit is contained in:
Nicola Benaglia 2025-04-26 16:23:34 +02:00
parent 9ec1762481
commit 30ab1bada4
10 changed files with 63 additions and 41 deletions

View File

@ -16,7 +16,8 @@
"export": "export", "export": "export",
"import": "import", "import": "import",
"join": "join", "join": "join",
"logout": "logout" "logout": "logout",
"notify": "notify"
}, },
"core": { "core": {
"block_height": "block height", "block_height": "block height",
@ -49,7 +50,7 @@
"payment_notification": "payment notification", "payment_notification": "payment notification",
"price": "price", "price": "price",
"q_mail": "q-mail", "q_mail": "q-mail",
"result": { "message": {
"error": { "error": {
"generic": "an error occurred", "generic": "an error occurred",
"incorrect_password": "incorrect password", "incorrect_password": "incorrect password",

View File

@ -26,12 +26,20 @@
"join_group": "would you like to perform an JOIN_GROUP transaction?", "join_group": "would you like to perform an JOIN_GROUP transaction?",
"provide_thread": "please provide a thread title" "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": { "error": {
"access_name": "cannot send a message without a access to your name", "access_name": "cannot send a message without a access to your name",
"description_required": "please provide a description", "description_required": "please provide a description",
"group_info": "cannot access group information", "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": { "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",

View File

@ -2961,7 +2961,7 @@ function App() {
lineHeight: '15px', lineHeight: '15px',
}} }}
> >
{t('core:result.success.transfer', { {t('core:message.success.transfer', {
postProcess: 'capitalize', postProcess: 'capitalize',
})} })}
</TextP> </TextP>
@ -2986,7 +2986,7 @@ function App() {
lineHeight: '15px', lineHeight: '15px',
}} }}
> >
{t('core:result.success.transfer', { {t('core:message.success.transfer', {
postProcess: 'capitalize', postProcess: 'capitalize',
})} })}
</TextP> </TextP>
@ -3011,7 +3011,7 @@ function App() {
lineHeight: '15px', lineHeight: '15px',
}} }}
> >
{t('core:result.success.order_submitted', { {t('core:message.success.order_submitted', {
postProcess: 'capitalize', postProcess: 'capitalize',
})} })}
</TextP> </TextP>
@ -3446,7 +3446,7 @@ function App() {
label={ label={
<Box sx={{ display: 'flex', alignItems: 'center' }}> <Box sx={{ display: 'flex', alignItems: 'center' }}>
<Typography sx={{ fontSize: '14px' }}> <Typography sx={{ fontSize: '14px' }}>
{t('core:result.success.request_read', { {t('core:message.success.request_read', {
postProcess: 'capitalize', postProcess: 'capitalize',
})} })}
</Typography> </Typography>

View File

@ -79,21 +79,21 @@ export const CoreSyncStatus = () => {
if (isMintingPossible && !isUsingGateway) { if (isMintingPossible && !isUsingGateway) {
imagePath = syncedMintingImg; 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) { } else if (isSynchronizing === true && syncPercent === 99) {
imagePath = syncingImg; imagePath = syncingImg;
} else if (isSynchronizing && !isMintingPossible && syncPercent === 100) { } else if (isSynchronizing && !isMintingPossible && syncPercent === 100) {
imagePath = syncingImg; 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) { } else if (!isSynchronizing && !isMintingPossible && syncPercent === 100) {
imagePath = syncedImg; 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) { } else if (isSynchronizing && isMintingPossible && syncPercent === 100) {
imagePath = syncingImg; 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) { } else if (!isSynchronizing && isMintingPossible && syncPercent === 100) {
imagePath = syncedMintingImg; 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 ( return (

View File

@ -100,13 +100,13 @@ export const AddGroup = ({ address, open, setOpen }) => {
try { try {
if (!name) if (!name)
throw new Error( throw new Error(
t('group:result.error.name_required', { t('group:message.error.name_required', {
postProcess: 'capitalize', postProcess: 'capitalize',
}) })
); );
if (!description) if (!description)
throw new Error( throw new Error(
t('group:result.error.description_required', { t('group:message.error.description_required', {
postProcess: 'capitalize', postProcess: 'capitalize',
}) })
); );
@ -134,7 +134,7 @@ export const AddGroup = ({ address, open, setOpen }) => {
if (!response?.error) { if (!response?.error) {
setInfoSnack({ setInfoSnack({
type: 'success', type: 'success',
message: t('group:result.success.group_creation', { message: t('group:message.success.group_creation', {
postProcess: 'capitalize', postProcess: 'capitalize',
}), }),
}); });
@ -143,11 +143,11 @@ export const AddGroup = ({ address, open, setOpen }) => {
{ {
...response, ...response,
type: 'created-group', type: 'created-group',
label: t('group:result.success.group_creation_name', { label: t('group:message.success.group_creation_name', {
group_name: name, group_name: name,
postProcess: 'capitalize', postProcess: 'capitalize',
}), }),
labelDone: t('group:result.success.group_creation_label', { labelDone: t('group:message.success.group_creation_label', {
group_name: name, group_name: name,
postProcess: 'capitalize', postProcess: 'capitalize',
}), }),
@ -164,7 +164,7 @@ export const AddGroup = ({ address, open, setOpen }) => {
rej({ rej({
message: message:
error.message || error.message ||
t('core:result.error.generic', { postProcess: 'capitalize' }), t('core:message.error.generic', { postProcess: 'capitalize' }),
}); });
}); });
}); });

View File

@ -122,7 +122,7 @@ export const AddGroupList = ({ setInfoSnack, setOpenSnack }) => {
if (!response?.error) { if (!response?.error) {
setInfoSnack({ setInfoSnack({
type: 'success', type: 'success',
message: t('group:result.success.join_group', { message: t('group:message.success.join_group', {
postProcess: 'capitalize', postProcess: 'capitalize',
}), }),
}); });
@ -132,11 +132,11 @@ export const AddGroupList = ({ setInfoSnack, setOpenSnack }) => {
{ {
...response, ...response,
type: 'joined-group', type: 'joined-group',
label: t('group:result.success.group_join_label', { label: t('group:message.success.group_join_label', {
group_name: group?.groupName, group_name: group?.groupName,
postProcess: 'capitalize', postProcess: 'capitalize',
}), }),
labelDone: t('group:result.success.group_join_label', { labelDone: t('group:message.success.group_join_label', {
group_name: group?.groupName, group_name: group?.groupName,
postProcess: 'capitalize', postProcess: 'capitalize',
}), }),

View File

@ -834,7 +834,7 @@ export const GroupMail = ({
<LoadingSnackbar <LoadingSnackbar
open={isLoading} open={isLoading}
info={{ info={{
message: t('group:result.success.loading_threads', { message: t('group:message.success.loading_threads', {
postProcess: 'capitalize', postProcess: 'capitalize',
}), }),
}} }}

View File

@ -189,13 +189,13 @@ export const NewThread = ({
} }
if (!name) { if (!name) {
errorMsg = t('group:result.error.access_name', { errorMsg = t('group:message.error.access_name', {
postProcess: 'capitalize', postProcess: 'capitalize',
}); });
} }
if (!groupInfo) { if (!groupInfo) {
errorMsg = t('group:result.error.group_info', { errorMsg = t('group:message.error.group_info', {
postProcess: 'capitalize', postProcess: 'capitalize',
}); });
} }

View File

@ -2217,9 +2217,10 @@ export const Group = ({
color: theme.palette.text.primary, color: theme.palette.text.primary,
}} }}
> >
No group selected {t('group:message.generic.no_selection', {
</Typography>{' '} postProcess: 'capitalize',
// TODO translate })}
</Typography>
</Box> </Box>
)} )}
@ -2315,9 +2316,9 @@ export const Group = ({
> >
{' '} {' '}
<Typography> <Typography>
The group's first common encryption key is in the process {t('group:message.generic.encryption_key', {
of creation. Please wait a few minutes for it to be postProcess: 'capitalize',
retrieved by the network. Checking every 2 minutes... })}
</Typography> </Typography>
</div> </div>
)} )}
@ -2341,18 +2342,23 @@ export const Group = ({
> >
{' '} {' '}
<Typography> <Typography>
You are not part of the encrypted group of members. Wait {t('group:message.generic.not_part_group', {
until an admin re-encrypts the keys. postProcess: 'capitalize',
})}
</Typography> </Typography>
<Spacer height="25px" /> <Spacer height="25px" />
<Typography> <Typography>
<strong> <strong>
Only unencrypted messages will be displayed. {t('group:message.generic.only_encrypted', {
postProcess: 'capitalize',
})}
</strong> </strong>
</Typography> </Typography>
<Spacer height="25px" /> <Spacer height="25px" />
<Typography> <Typography>
Try notifying an admin from the list of admins below: {t('group:message.generic.notify_admins', {
postProcess: 'capitalize',
})}
</Typography> </Typography>
<Spacer height="25px" /> <Spacer height="25px" />
{adminsWithNames.map((admin) => { {adminsWithNames.map((admin) => {
@ -2372,7 +2378,9 @@ export const Group = ({
variant="contained" variant="contained"
onClick={() => notifyAdmin(admin)} onClick={() => notifyAdmin(admin)}
> >
Notify {t('core:action.notify', {
postProcess: 'capitalize',
})}
</LoadingButton> </LoadingButton>
</Box> </Box>
); );
@ -2592,14 +2600,19 @@ export const Group = ({
open={isLoadingGroup} open={isLoadingGroup}
info={{ info={{
message: message:
isLoadingGroupMessage || 'Setting up group... please wait.', isLoadingGroupMessage ||
t('group:message.generic.setting_group', {
postProcess: 'capitalize',
}),
}} }}
/> />
<LoadingSnackbar <LoadingSnackbar
open={isLoadingGroups} open={isLoadingGroups}
info={{ info={{
message: 'Setting up groups... please wait.', message: t('group:message.generic.setting_group', {
postProcess: 'capitalize',
}),
}} }}
/> />
<WalletsAppWrapper /> <WalletsAppWrapper />

View File

@ -169,7 +169,7 @@ export const Save = ({ isDesktop, disableWidth, myName }) => {
.catch((error) => { .catch((error) => {
rej( rej(
error.message || 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()); setSettingsQdnLastUpdated(Date.now());
setInfoSnack({ setInfoSnack({
type: 'success', type: 'success',
message: t('core:result.success.publish_qdn', { message: t('core:message.success.publish_qdn', {
postProcess: 'capitalize', postProcess: 'capitalize',
}), }),
}); });
@ -191,7 +191,7 @@ export const Save = ({ isDesktop, disableWidth, myName }) => {
type: 'error', type: 'error',
message: message:
error?.message || error?.message ||
t('core:result.error.save_qdn', { t('core:message.error.save_qdn', {
postProcess: 'capitalize', postProcess: 'capitalize',
}), }),
}); });