diff --git a/src/components/Apps/AppRating.tsx b/src/components/Apps/AppRating.tsx index d7b75f5..17d2cf0 100644 --- a/src/components/Apps/AppRating.tsx +++ b/src/components/Apps/AppRating.tsx @@ -208,7 +208,7 @@ export const AppRating = ({ app, myName, ratingCountPosition = 'right' }) => { type: 'error', message: error?.message || - t('core:message.error.unable_rate', { + t('core:message.error.rate', { postProcess: 'capitalizeFirstChar', }), }); diff --git a/src/components/Apps/AppsPrivate.tsx b/src/components/Apps/AppsPrivate.tsx index 832da7d..604a8f5 100644 --- a/src/components/Apps/AppsPrivate.tsx +++ b/src/components/Apps/AppsPrivate.tsx @@ -183,7 +183,7 @@ export const AppsPrivate = ({ myName }) => { if (decryptedData?.error) { throw new Error( decryptedData?.error || - t('core:message.error.unable_encrypt_app', { + t('core:message.error.encrypt_app', { postProcess: 'capitalizeFirstChar', }) ); @@ -238,7 +238,7 @@ export const AppsPrivate = ({ myName }) => { type: 'error', message: error?.message || - t('core:message.error.unable_publish_app', { + t('core:message.error.publish_app', { postProcess: 'capitalizeFirstChar', }), }); diff --git a/src/components/Chat/ChatGroup.tsx b/src/components/Chat/ChatGroup.tsx index 4538773..3cddd4d 100644 --- a/src/components/Chat/ChatGroup.tsx +++ b/src/components/Chat/ChatGroup.tsx @@ -890,7 +890,7 @@ export const ChatGroup = ({ ); if (res !== true) throw new Error( - t('core:message.error.unable_publish_image', { + t('core:message.error.publish_image', { postProcess: 'capitalizeFirstChar', }) ); diff --git a/src/components/Embeds/Embed.tsx b/src/components/Embeds/Embed.tsx index fd9a581..6be25f7 100644 --- a/src/components/Embeds/Embed.tsx +++ b/src/components/Embeds/Embed.tsx @@ -238,7 +238,7 @@ export const Embed = ({ embedLink }) => { return imageFinalUrl; } else { setErrorMsg( - t('core:message.error.unable_download_image', { + t('core:message.error.download_image', { postProcess: 'capitalizeFirstChar', }) ); diff --git a/src/components/Embeds/PollEmbed.tsx b/src/components/Embeds/PollEmbed.tsx index 8a1d44c..cffe724 100644 --- a/src/components/Embeds/PollEmbed.tsx +++ b/src/components/Embeds/PollEmbed.tsx @@ -69,7 +69,7 @@ export const PollCard = ({ type: 'error', message: response?.error || - t('core:message.error.unable_vote', { + t('core:message.error.vote', { postProcess: 'capitalizeFirstChar', }), }); @@ -91,7 +91,7 @@ export const PollCard = ({ type: 'error', message: error?.message || - t('core:message.error.unable_vote', { + t('core:message.error.vote', { postProcess: 'capitalizeFirstChar', }), }); diff --git a/src/hooks/useHandlePrivateApps.tsx b/src/hooks/useHandlePrivateApps.tsx index 74be902..fdeee79 100644 --- a/src/hooks/useHandlePrivateApps.tsx +++ b/src/hooks/useHandlePrivateApps.tsx @@ -70,7 +70,7 @@ export const useHandlePrivateApps = () => { } throw new Error( - t('core:message.error.unable_fetch_app', { + t('core:message.error.fetch_app', { postProcess: 'capitalizeFirstChar', }) ); @@ -249,7 +249,7 @@ export const useHandlePrivateApps = () => { setLoadingStatePrivateApp( `Error! ${ error?.message || - t('core:message.error.unable_build_app', { + t('core:message.error.build_app', { postProcess: 'capitalizeFirstChar', }) }` @@ -262,7 +262,7 @@ export const useHandlePrivateApps = () => { type: 'error', message: error?.message || - t('core:message.error.unable_fetch_app', { + t('core:message.error.fetch_app', { postProcess: 'capitalizeFirstChar', }), }); diff --git a/src/i18n/locales/en/core.json b/src/i18n/locales/en/core.json index dae4257..d88bc92 100644 --- a/src/i18n/locales/en/core.json +++ b/src/i18n/locales/en/core.json @@ -174,12 +174,19 @@ "error": { "address_not_found": "your address was not found", "app_need_name": "your app needs a name", + "build_app": "unable to build private app", + "decrypt_app": "unable to decrypt private app'", + "download_image": "unable to download IMAGE. Please try again later by clicking the refresh button", + "download_private_app": "unable to download private app", + "encrypt_app": "unable to encrypt app. App not published'", + "fetch_app": "unable to fetch app", + "fetch_publish": "unable to fetch publish", "file_too_large": "file {{ filename }} is too large. Max size allowed is {{ size }} MB.", "generic": "an error occurred", "invalid_base64": "invalid base64 data", "invalid_embed_link": "invalid embed link", - "invalid_poll_embed_link_name": "invalid poll embed link. Missing name.", "invalid_image_embed_link_name": "invalid image embed link. Missing param.", + "invalid_poll_embed_link_name": "invalid poll embed link. Missing name.", "invalid_signature": "invalid signature", "invalid_theme_format": "invalid theme format", "invalid_zip": "invalid zip", @@ -193,21 +200,13 @@ "password_not_matching": "password fields do not match!", "password_wrong": "unable to authenticate. Wrong password", "publish_app": "unable to publish app", + "publish_image": "unable to publish image", + "rate": "unable to rate", "rating_option": "cannot find rating option", "save_qdn": "unable to save to QDN", "send_failed": "failed to send", - "unable_build_app": "unable to build private app", - "unable_download_image": "unable to download IMAGE. Please try again later by clicking the refresh button", - "unable_download_private_app": "unable to download private app", - "unable_decrypt_app": "unable to decrypt private app'", - "unable_encrypt_app": "unable to encrypt app. App not published'", - "unable_fetch_app": "unable to fetch app", - "unable_fetch_publish": "unable to fetch publish", - "unable_publish_app": "unable to publish app", - "unable_publish_image": "unable to publish image", - "unable_rate": "unable to rate", - "unable_vote": "unable to vote", - "update_failed": "failed to update" + "update_failed": "failed to update", + "vote": "unable to vote" }, "generic": { "already_voted": "you've already voted.", diff --git a/src/i18n/locales/en/group.json b/src/i18n/locales/en/group.json index 2bd0552..ef3ed41 100644 --- a/src/i18n/locales/en/group.json +++ b/src/i18n/locales/en/group.json @@ -112,6 +112,7 @@ "descrypt_wallet": "error decrypting wallet {{ :errorMessage }}", "description_required": "please provide a description", "group_info": "cannot access group information", + "group_join": "failed to join the group", "group_promotion": "error publishing the promotion. Please try again", "group_secret_key": "cannot get group secret key", "name_required": "please provide a name", diff --git a/src/qortalRequests/get.ts b/src/qortalRequests/get.ts index b56f921..ab18d2d 100644 --- a/src/qortalRequests/get.ts +++ b/src/qortalRequests/get.ts @@ -2191,7 +2191,12 @@ export const joinGroup = async (data, isFromExtension) => { const resJoinGroup = await joinGroupFunc({ groupId }); return resJoinGroup; } catch (error) { - throw new Error(error?.message || 'Failed to join the group.'); + throw new Error( + error?.message || + i18n.t('group:message.error.group_join', { + postProcess: 'capitalizeFirstChar', + }) + ); } } else { throw new Error('User declined to join group'); // TODO translate @@ -2304,7 +2309,12 @@ export const deployAt = async (data, isFromExtension) => { ); return resDeployAt; } catch (error) { - throw new Error(error?.message || 'Failed to join the group.'); + throw new Error( + error?.message || + i18n.t('group:message.error.group_join', { + postProcess: 'capitalizeFirstChar', + }) + ); } };