From 23c552a2b3189e7039994e6d57be22c91a5f1c7c Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Thu, 15 May 2025 09:01:01 +0200 Subject: [PATCH 1/9] Add translation --- src/components/Apps/AppInfo.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Apps/AppInfo.tsx b/src/components/Apps/AppInfo.tsx index abca186..adf9c15 100644 --- a/src/components/Apps/AppInfo.tsx +++ b/src/components/Apps/AppInfo.tsx @@ -27,8 +27,8 @@ import { sortablePinnedAppsAtom, } from '../../atoms/global'; import { saveToLocalStorage } from './AppsNavBarDesktop'; - import { useAtom, useSetAtom } from 'jotai'; +import { useTranslation } from 'react-i18next'; export const AppInfo = ({ app, myName }) => { const isInstalled = app?.status?.status === 'READY'; @@ -37,6 +37,7 @@ export const AppInfo = ({ app, myName }) => { ); const theme = useTheme(); + const { t } = useTranslation(['core', 'auth', 'group']); const isSelectedAppPinned = !!sortablePinnedApps?.find( (item) => item?.name === app?.name && item?.service === app?.service From f6dccdfb2d6413f2abfcc91263ca5d00ad4c63c6 Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Thu, 15 May 2025 14:05:22 +0200 Subject: [PATCH 2/9] Add translations to apps --- src/components/Apps/AppInfo.tsx | 41 +++++++++++++++++++++----- src/components/Apps/AppInfoSnippet.tsx | 21 ++++++++++--- src/components/Apps/AppPublish.tsx | 26 +++++----------- src/components/QMailStatus.tsx | 2 +- src/i18n/locales/en/core.json | 17 +++++++++-- 5 files changed, 74 insertions(+), 33 deletions(-) diff --git a/src/components/Apps/AppInfo.tsx b/src/components/Apps/AppInfo.tsx index adf9c15..b36799a 100644 --- a/src/components/Apps/AppInfo.tsx +++ b/src/components/Apps/AppInfo.tsx @@ -172,9 +172,13 @@ export const AppInfo = ({ app, myName }) => { }} > - {isSelectedAppPinned // TODO translate - ? 'Unpin from dashboard' - : 'Pin to dashboard'} + {isSelectedAppPinned + ? t('core:action.unpin_from_dashboard', { + postProcess: 'capitalize', + }) + : t('core:action.pin_from_dashboard', { + postProcess: 'capitalize', + })} @@ -194,7 +198,13 @@ export const AppInfo = ({ app, myName }) => { }} > - {isInstalled ? 'Open' : 'Download'} + {isInstalled + ? t('core:action.open', { + postProcess: 'capitalize', + }) + : t('core:action.download', { + postProcess: 'capitalize', + })} @@ -217,25 +227,40 @@ export const AppInfo = ({ app, myName }) => { - Category: + + {t('core:category', { + postProcess: 'capitalize', + })} + : + - {app?.metadata?.categoryName || 'none'} + {app?.metadata?.categoryName || + t('core:none', { + postProcess: 'capitalize', + })} - About this Q-App + + {t('core:q_apps.about', { + postProcess: 'capitalize', + })} + - {app?.metadata?.description || 'No description'} + {app?.metadata?.description || + t('core:message.generic.no_description', { + postProcess: 'capitalize', + })} diff --git a/src/components/Apps/AppInfoSnippet.tsx b/src/components/Apps/AppInfoSnippet.tsx index ba71164..c027bb0 100644 --- a/src/components/Apps/AppInfoSnippet.tsx +++ b/src/components/Apps/AppInfoSnippet.tsx @@ -23,6 +23,7 @@ import { } from '../../atoms/global'; import { saveToLocalStorage } from './AppsNavBarDesktop'; import { useAtom, useSetAtom } from 'jotai'; +import { useTranslation } from 'react-i18next'; export const AppInfoSnippet = ({ app, @@ -41,6 +42,7 @@ export const AppInfoSnippet = ({ ); const theme = useTheme(); + const { t } = useTranslation(['core', 'auth', 'group']); return ( - {' '} - {isSelectedAppPinned ? 'Unpin' : 'Pin'} + {isSelectedAppPinned + ? t('core:action.unpin', { + postProcess: 'capitalize', + }) + : t('core:action.pin', { + postProcess: 'capitalize', + })} @@ -187,7 +194,13 @@ export const AppInfoSnippet = ({ }} > - {isInstalled ? 'Open' : 'Download'} + {isInstalled + ? t('core:action.open', { + postProcess: 'capitalize', + }) + : t('core:action.download', { + postProcess: 'capitalize', + })} diff --git a/src/components/Apps/AppPublish.tsx b/src/components/Apps/AppPublish.tsx index 8875c0b..5a181cd 100644 --- a/src/components/Apps/AppPublish.tsx +++ b/src/components/Apps/AppPublish.tsx @@ -1,20 +1,8 @@ import React, { useContext, useEffect, useState } from 'react'; import { - AppCircle, - AppCircleContainer, - AppCircleLabel, - AppDownloadButton, - AppDownloadButtonText, - AppInfoAppName, - AppInfoSnippetContainer, - AppInfoSnippetLeft, - AppInfoSnippetMiddle, - AppInfoSnippetRight, - AppInfoUserName, AppLibrarySubTitle, AppPublishTagsContainer, AppsLibraryContainer, - AppsParent, AppsWidthLimiter, PublishQAppCTAButton, PublishQAppChoseFile, @@ -28,10 +16,7 @@ import { useTheme, } from '@mui/material'; import { styled } from '@mui/system'; -import UnfoldMoreRoundedIcon from '@mui/icons-material/UnfoldMoreRounded'; -import { Add } from '@mui/icons-material'; import { MyContext, getBaseApiReact } from '../../App'; -import LogoSelected from '../../assets/svgs/LogoSelected.svg'; import { Spacer } from '../../common/Spacer'; import { executeEvent } from '../../utils/events'; import { useDropzone } from 'react-dropzone'; @@ -39,6 +24,7 @@ import { LoadingSnackbar } from '../Snackbar/LoadingSnackbar'; import { CustomizedSnackbars } from '../Snackbar/Snackbar'; import { getFee } from '../../background'; import { fileToBase64 } from '../../utils/fileReading'; +import { useTranslation } from 'react-i18next'; const CustomSelect = styled(Select)({ border: '0.5px solid var(--50-white, #FFFFFF80)', @@ -81,6 +67,7 @@ export const AppPublish = ({ names, categories }) => { const [file, setFile] = useState(null); const { show } = useContext(MyContext); const theme = useTheme(); + const { t } = useTranslation(['core', 'auth', 'group']); const [tag1, setTag1] = useState(''); const [tag2, setTag2] = useState(''); const [tag3, setTag3] = useState(''); @@ -106,9 +93,11 @@ export const AppPublish = ({ names, categories }) => { errors.forEach((error) => { if (error.code === 'file-too-large') { console.error( - `File ${file.name} is too large. Max size allowed is ${ - maxFileSize / (1024 * 1024) - } MB.` + t('core:message.error.file_too_large', { + filename: file.name, + size: maxFileSize / (1024 * 1024), + postProcess: 'capitalize', + }) ); } }); @@ -142,6 +131,7 @@ export const AppPublish = ({ names, categories }) => { setTag5(myApp?.metadata?.tags[4] || ''); } } catch (error) { + console.log(error); } finally { setIsLoading(''); } diff --git a/src/components/QMailStatus.tsx b/src/components/QMailStatus.tsx index deac6db..f88adbb 100644 --- a/src/components/QMailStatus.tsx +++ b/src/components/QMailStatus.tsx @@ -65,7 +65,7 @@ export const QMailStatus = () => { textTransform: 'uppercase', }} > - {t('core:q_mail', { + {t('core:q_apps.q_mail', { postProcess: 'capitalize', })} diff --git a/src/i18n/locales/en/core.json b/src/i18n/locales/en/core.json index b33a4bf..757350d 100644 --- a/src/i18n/locales/en/core.json +++ b/src/i18n/locales/en/core.json @@ -16,6 +16,7 @@ "choose_name": "choose a name", "decline": "decline", "decrypt": "decrypt", + "download": "download", "edit": "edit", "enter_name": "enter a name", "export": "export", @@ -29,15 +30,21 @@ "thread": "new thread" }, "notify": "notify", + "open": "open", + "pin": "pin", + "pin_from_dashboard": "pin from dashboard", "post": "post", "post_message": "post message", "publish": "publish", "register_name": "register name", "remove": "remove", "save": "save", - "start_minting": "start minting" + "start_minting": "start minting", + "unpin": "unpin", + "unpin_from_dashboard": "unpin from dashboard" }, "admin": "admin", + "category": "category", "core": { "block_height": "block height", "information": "core information", @@ -71,6 +78,7 @@ "message": { "error": { "address_not_found": "your address was not found", + "file_too_large": "file {{ filename }} is too large. Max size allowed is {{ size }} MB.", "generic": "an error occurred", "incorrect_password": "incorrect password", "minting_account_add": "unable to add minting account", @@ -84,6 +92,7 @@ "name_checking": "checking if name already exists", "name_registration": "your balance is {{ balance }} QORT. A name registration requires a {{ fee }} QORT fee", "name_unavailable": "{{ name }} is unavailable", + "no_description": "no description", "publish_data": "publish data to Qortal: anything from apps to videos. Fully decentralized!", "secure_ownership": "secure ownership of data published by your name. You can even sell your name, along with your data to a third party." }, @@ -104,6 +113,7 @@ } }, "minting_status": "minting status", + "none": "none", "page": { "last": "last", "first": "first", @@ -112,7 +122,10 @@ }, "payment_notification": "payment notification", "price": "price", - "q_mail": "q-mail", + "q_apps": { + "about": "about this Q-App", + "q_mail": "q-mail" + }, "save_options": { "no_pinned_changes": "you currently do not have any changes to your pinned apps", "overwrite_changes": "the app was unable to download your existing QDN-saved pinned apps. Would you like to overwrite those changes?", From 3e6d2f5e4b0faaab8a8eb39df560d1d20202ffe7 Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Thu, 15 May 2025 19:02:12 +0200 Subject: [PATCH 3/9] Update translations --- src/components/Apps/AppPublish.tsx | 97 ++++++++++++++++++------ src/components/Group/Forum/NewThread.tsx | 2 +- src/components/MainAvatar.tsx | 1 + src/components/Save/Save.tsx | 6 +- src/i18n/locales/en/core.json | 22 +++++- 5 files changed, 98 insertions(+), 30 deletions(-) diff --git a/src/components/Apps/AppPublish.tsx b/src/components/Apps/AppPublish.tsx index 5a181cd..1425ba6 100644 --- a/src/components/Apps/AppPublish.tsx +++ b/src/components/Apps/AppPublish.tsx @@ -169,17 +169,25 @@ export const AppPublish = ({ names, categories }) => { }); if (missingFields.length > 0) { const missingFieldsString = missingFields.join(', '); - const errorMsg = `Missing fields: ${missingFieldsString}`; + const errorMsg = t('core:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalize', + }); throw new Error(errorMsg); } const fee = await getFee('ARBITRARY'); await show({ - // TODO translate - message: 'Would you like to publish this app?', + message: t('core:save_options.publish_app', { + postProcess: 'capitalize', + }), publishFee: fee.fee + ' QORT', }); - setIsLoading('Publishing... Please wait.'); + setIsLoading( + t('core:message.generic.publishing', { + postProcess: 'capitalize', + }) + ); const fileBase64 = await fileToBase64(file); await new Promise((res, rej) => { window @@ -204,13 +212,17 @@ export const AppPublish = ({ names, categories }) => { rej(response.error); }) .catch((error) => { - rej(error.message || 'An error occurred'); + rej( + error.message || + t('core:message.error.generic', { postProcess: 'capitalize' }) + ); }); }); setInfoSnack({ type: 'success', - message: - 'Successfully published. Please wait a couple minutes for the network to propogate the changes.', + message: t('core:message.success.published', { + postProcess: 'capitalize', + }), }); setOpenSnack(true); const dataObj = { @@ -229,7 +241,11 @@ export const AppPublish = ({ names, categories }) => { } catch (error) { setInfoSnack({ type: 'error', - message: error?.message || 'Unable to publish app', + message: + error?.message || + t('core:message.error.publish_app', { + postProcess: 'capitalize', + }), }); setOpenSnack(true); } finally { @@ -250,18 +266,27 @@ export const AppPublish = ({ names, categories }) => { width: 'auto', }} > - Create Apps! + + {t('core:action.create_apps', { + postProcess: 'capitalize', + })} + ! + - Note: Currently, only one App and Website is allowed per Name. + {t('core:message.generic.one_app_per_name', { + postProcess: 'capitalize', + })} - Name/App + {t('core:name_app', { + postProcess: 'capitalize', + })} { color: theme.palette.text.secondary, }} > - Select Name/App + {t('core:action.select_name_app', { + postProcess: 'capitalize', + })} {/* This is the placeholder item */} @@ -288,7 +315,9 @@ export const AppPublish = ({ names, categories }) => { - App service type + {t('core:app_service_type', { + postProcess: 'capitalize', + })} { color: theme.palette.text.secondary, }} > - Select App Type + {t('core:action.select_app_type', { + postProcess: 'capitalize', + })} - App - Website + + {t('core:app', { + postProcess: 'capitalize', + })} + + + {t('core:website', { + postProcess: 'capitalize', + })} + - Title + {t('core:title', { + postProcess: 'capitalize', + })} { - Description + {t('core:description', { + postProcess: 'capitalize', + })} { - Category + {t('core:category', { + postProcess: 'capitalize', + })} { color: theme.palette.text.secondary, }} > - Select Category + {t('core:action.select_category', { + postProcess: 'capitalize', + })} {categories?.map((category) => { @@ -393,7 +440,9 @@ export const AppPublish = ({ names, categories }) => { - Tags + {t('core:tags', { + postProcess: 'capitalize', + })} @@ -487,7 +536,7 @@ export const AppPublish = ({ names, categories }) => { - Select .zip file containing static content:{' '} + {t('core:message.generic.select_zip', { postProcess: 'capitalize' })} @@ -507,7 +556,7 @@ export const AppPublish = ({ names, categories }) => { {' '} - Choose File + {t('core:action.choose_file', { postProcess: 'capitalize' })} @@ -518,7 +567,7 @@ export const AppPublish = ({ names, categories }) => { }} onClick={publishApp} > - Publish + {t('core:action.publish', { postProcess: 'capitalize' })} diff --git a/src/components/Group/Forum/NewThread.tsx b/src/components/Group/Forum/NewThread.tsx index 1a1e5df..0212702 100644 --- a/src/components/Group/Forum/NewThread.tsx +++ b/src/components/Group/Forum/NewThread.tsx @@ -202,7 +202,7 @@ export const NewThread = ({ // if (!description) missingFields.push('subject') if (missingFields.length > 0) { const missingFieldsString = missingFields.join(', '); - const errMsg = t('group:message.error.missing_field', { + const errMsg = t('core:message.error.missing_fields', { field: missingFieldsString, postProcess: 'capitalize', }); diff --git a/src/components/MainAvatar.tsx b/src/components/MainAvatar.tsx index 10370de..60a32b8 100644 --- a/src/components/MainAvatar.tsx +++ b/src/components/MainAvatar.tsx @@ -65,6 +65,7 @@ export const MainAvatar = ({ myName, balance, setOpenSnack, setInfoSnack }) => { const publishAvatar = async () => { try { + // TODO translate const fee = await getFee('ARBITRARY'); if (+balance < +fee.fee) throw new Error(`Publishing an Avatar requires ${fee.fee}`); diff --git a/src/components/Save/Save.tsx b/src/components/Save/Save.tsx index d67780a..23032ee 100644 --- a/src/components/Save/Save.tsx +++ b/src/components/Save/Save.tsx @@ -155,7 +155,9 @@ export const Save = ({ isDesktop, disableWidth, myName }) => { const fee = await getFee('ARBITRARY'); await show({ - message: t('core:save.publish_qnd', { postProcess: 'capitalize' }), + message: t('core:save_options.publish_qnd', { + postProcess: 'capitalize', + }), publishFee: fee.fee + ' QORT', }); const response = await new Promise((res, rej) => { @@ -184,7 +186,7 @@ export const Save = ({ isDesktop, disableWidth, myName }) => { setSettingsQdnLastUpdated(Date.now()); setInfoSnack({ type: 'success', - message: t('core:message.success.publish_qdn', { + message: t('core:message.success.published_qdn', { postProcess: 'capitalize', }), }); diff --git a/src/i18n/locales/en/core.json b/src/i18n/locales/en/core.json index 757350d..22c1c25 100644 --- a/src/i18n/locales/en/core.json +++ b/src/i18n/locales/en/core.json @@ -12,6 +12,8 @@ "close": "close", "continue": "continue", "continue_logout": "continue to logout", + "create_apps": "create apps", + "create_file": "create file", "create_thread": "create thread", "choose_name": "choose a name", "decline": "decline", @@ -39,11 +41,16 @@ "register_name": "register name", "remove": "remove", "save": "save", + "select_app_type": "select App Type", + "select_category": "select Category", + "select_name_app": "select Name/App", "start_minting": "start minting", "unpin": "unpin", "unpin_from_dashboard": "unpin from dashboard" }, "admin": "admin", + "app": "app", + "app_service_type": "app service type", "category": "category", "core": { "block_height": "block height", @@ -83,7 +90,8 @@ "incorrect_password": "incorrect password", "minting_account_add": "unable to add minting account", "minting_account_remove": "unable to remove minting account", - "missing_field": "missing: {{ field }}", + "missing_fields": "missing: {{ fields }}", + "publish_app": "unable to publish app", "save_qdn": "unable to save to QDN" }, "generic": { @@ -93,8 +101,11 @@ "name_registration": "your balance is {{ balance }} QORT. A name registration requires a {{ fee }} QORT fee", "name_unavailable": "{{ name }} is unavailable", "no_description": "no description", + "one_app_per_name": "note: Currently, only one App and Website is allowed per Name.", "publish_data": "publish data to Qortal: anything from apps to videos. Fully decentralized!", - "secure_ownership": "secure ownership of data published by your name. You can even sell your name, along with your data to a third party." + "publishing": "publishing... Please wait.", + "secure_ownership": "secure ownership of data published by your name. You can even sell your name, along with your data to a third party.", + "select_zip": "select .zip file containing static content:" }, "question": { "new_user": "are you a new user?" @@ -107,12 +118,14 @@ }, "success": { "order_submitted": "your buy order was submitted", - "publish_qdn": "successfully published to QDN", + "published": "successfully published. Please wait a couple minutes for the network to propogate the changes.", + "published_qdn": "successfully published to QDN", "request_read": "I have read this request", "transfer": "the transfer was succesful!" } }, "minting_status": "minting status", + "name_app": "name/App", "none": "none", "page": { "last": "last", @@ -130,6 +143,7 @@ "no_pinned_changes": "you currently do not have any changes to your pinned apps", "overwrite_changes": "the app was unable to download your existing QDN-saved pinned apps. Would you like to overwrite those changes?", "overwrite_qdn": "overwrite to QDN", + "publish_app": "would you like to publish this app?", "publish_qdn": "would you like to publish your settings to QDN (encrypted)?", "qdn": "use QDN saving", "register_name": "you need a registered Qortal name to save your pinned apps to QDN.", @@ -144,6 +158,7 @@ }, "settings": "settings", "supply": "supply", + "tags": "tags", "theme": { "dark": "dark mode", "light": "light mode" @@ -163,5 +178,6 @@ "wallet": "wallet", "wallet_other": "wallets" }, + "website": "website", "welcome": "welcome" } From e94ff9ef09a9b1fd40bd1d72c1921b25f909c581 Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Thu, 15 May 2025 19:26:43 +0200 Subject: [PATCH 4/9] Add translations to appRating --- src/components/Apps/AppRating.tsx | 25 +++++++++++++++---- src/components/Apps/useHandlePrivateApps.tsx | 5 ++-- .../Apps/useQortalMessageListener.tsx | 4 +-- src/components/GeneralNotifications.tsx | 2 +- src/components/Save/Save.tsx | 4 +-- src/i18n/locales/en/core.json | 5 +++- 6 files changed, 31 insertions(+), 14 deletions(-) diff --git a/src/components/Apps/AppRating.tsx b/src/components/Apps/AppRating.tsx index 881cfec..8894f3c 100644 --- a/src/components/Apps/AppRating.tsx +++ b/src/components/Apps/AppRating.tsx @@ -7,6 +7,7 @@ import { StarFilledIcon } from '../../assets/Icons/StarFilled'; import { StarEmptyIcon } from '../../assets/Icons/StarEmpty'; import { AppInfoUserName } from './Apps-styles'; import { Spacer } from '../../common/Spacer'; +import { useTranslation } from 'react-i18next'; export const AppRating = ({ app, myName, ratingCountPosition = 'right' }) => { const [value, setValue] = useState(0); @@ -19,6 +20,7 @@ export const AppRating = ({ app, myName, ratingCountPosition = 'right' }) => { const [openSnack, setOpenSnack] = useState(false); const [infoSnack, setInfoSnack] = useState(null); const hasCalledRef = useRef(false); + const { t } = useTranslation(['core', 'group']); const getRating = useCallback(async (name, service) => { try { @@ -101,26 +103,39 @@ export const AppRating = ({ app, myName, ratingCountPosition = 'right' }) => { const rateFunc = async (event, chosenValue, currentValue) => { try { const newValue = chosenValue || currentValue; - if (!myName) throw new Error('You need a name to rate.'); + if (!myName) + throw new Error( + t('core:message.generic.name_rate', { + postProcess: 'capitalize', + }) + ); if (!app?.name) return; const fee = await getFee('CREATE_POLL'); await show({ - // TODO translate - message: `Would you like to rate this app a rating of ${newValue}?. It will create a POLL tx.`, + message: t('core:message.error.generic', { + rate: newValue, + postProcess: 'capitalize', + }), publishFee: fee.fee + ' QORT', }); if (hasPublishedRating === false) { const pollName = `app-library-${app.service}-rating-${app.name}`; const pollOptions = [`1, 2, 3, 4, 5, initialValue-${newValue}`]; + const pollDescription = t('core:message.error.generic', { + name: app.name, + service: app.service, + postProcess: 'capitalize', + }); + await new Promise((res, rej) => { window .sendMessage( 'createPoll', { pollName: pollName, - pollDescription: `Rating for ${app.service} ${app.name}`, + pollDescription: pollDescription, pollOptions: pollOptions, pollOwnerAddress: myName, }, @@ -137,7 +152,7 @@ export const AppRating = ({ app, myName, ratingCountPosition = 'right' }) => { message: 'Successfully rated. Please wait a couple minutes for the network to propogate the changes.', }); - setOpenSnack(true); + setOpenSnack(true); // TODO translate } }) .catch((error) => { diff --git a/src/components/Apps/useHandlePrivateApps.tsx b/src/components/Apps/useHandlePrivateApps.tsx index 9a324bb..f8dd2a1 100644 --- a/src/components/Apps/useHandlePrivateApps.tsx +++ b/src/components/Apps/useHandlePrivateApps.tsx @@ -1,4 +1,4 @@ -import React, { useContext, useState } from 'react'; +import { useContext, useState } from 'react'; import { executeEvent } from '../../utils/events'; import { getBaseApiReact, MyContext } from '../../App'; import { createEndpoint } from '../../background'; @@ -7,10 +7,9 @@ import { sortablePinnedAppsAtom, } from '../../atoms/global'; import { saveToLocalStorage } from './AppsNavBarDesktop'; -import { base64ToBlobUrl } from '../../utils/fileReading'; import { base64ToUint8Array } from '../../qdn/encryption/group-encryption'; import { uint8ArrayToObject } from '../../backgroundFunctions/encryption'; -import { useAtom, useSetAtom } from 'jotai'; +import { useSetAtom } from 'jotai'; export const useHandlePrivateApps = () => { const [status, setStatus] = useState(''); diff --git a/src/components/Apps/useQortalMessageListener.tsx b/src/components/Apps/useQortalMessageListener.tsx index b1736a2..e2bb3c6 100644 --- a/src/components/Apps/useQortalMessageListener.tsx +++ b/src/components/Apps/useQortalMessageListener.tsx @@ -1,7 +1,7 @@ -import { useCallback, useContext, useEffect, useMemo, useState } from 'react'; +import { useCallback, useContext, useEffect, useState } from 'react'; import { executeEvent } from '../../utils/events'; import { navigationControllerAtom } from '../../atoms/global'; -import { Filesystem, Directory, Encoding } from '@capacitor/filesystem'; +import { Filesystem, Directory } from '@capacitor/filesystem'; import { saveFile } from '../../qortalRequests/get'; import { mimeToExtensionMap } from '../../utils/memeTypes'; import { MyContext } from '../../App'; diff --git a/src/components/GeneralNotifications.tsx b/src/components/GeneralNotifications.tsx index c7a6072..b88000e 100644 --- a/src/components/GeneralNotifications.tsx +++ b/src/components/GeneralNotifications.tsx @@ -111,7 +111,7 @@ export const GeneralNotifications = ({ address }) => { userSelect: 'none', }} > - No new notifications + {t('core:message.generic.no_notifications')} )} {hasNewPayment && ( diff --git a/src/components/Save/Save.tsx b/src/components/Save/Save.tsx index 23032ee..36edbdd 100644 --- a/src/components/Save/Save.tsx +++ b/src/components/Save/Save.tsx @@ -233,7 +233,7 @@ export const Save = ({ isDesktop, disableWidth, myName }) => { {isDesktop ? ( { onClick={saveToQdn} variant="contained" > - {t('core:save_options.save_qdn', { + {t('core:action.save_qdn', { postProcess: 'capitalize', })} diff --git a/src/i18n/locales/en/core.json b/src/i18n/locales/en/core.json index 22c1c25..23c5fce 100644 --- a/src/i18n/locales/en/core.json +++ b/src/i18n/locales/en/core.json @@ -98,12 +98,15 @@ "name_available": "{{ name }} is available", "name_benefits": "benefits of a name", "name_checking": "checking if name already exists", + "name_rate": "you need a name to rate.", "name_registration": "your balance is {{ balance }} QORT. A name registration requires a {{ fee }} QORT fee", "name_unavailable": "{{ name }} is unavailable", "no_description": "no description", + "no_notifications": "no new notifications", "one_app_per_name": "note: Currently, only one App and Website is allowed per Name.", "publish_data": "publish data to Qortal: anything from apps to videos. Fully decentralized!", "publishing": "publishing... Please wait.", + "rating": "rating for {{ service }} {{ name }}", "secure_ownership": "secure ownership of data published by your name. You can even sell your name, along with your data to a third party.", "select_zip": "select .zip file containing static content:" }, @@ -146,13 +149,13 @@ "publish_app": "would you like to publish this app?", "publish_qdn": "would you like to publish your settings to QDN (encrypted)?", "qdn": "use QDN saving", + "rate_app": "would you like to rate this app a rating of {{ rate }}?. It will create a POLL tx.", "register_name": "you need a registered Qortal name to save your pinned apps to QDN.", "reset_pinned": "don't like your current local changes? Would you like to reset to the default pinned apps?", "reset_qdn": "don't like your current local changes? Would you like to reset to your saved QDN pinned apps?", "revert_default": "revert to default", "revert_qdn": "revert to QDN", "save_qdn": "save to QDN", - "save": "save", "settings": "you are using the export/import way of saving settings.", "unsaved_changes": " you have unsaved changes to your pinned apps. Save them to QDN." }, From d93262fc92b3af943de785e3fddeded278b73e82 Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Fri, 16 May 2025 07:46:38 +0200 Subject: [PATCH 5/9] Translation for appRating --- src/components/Apps/AppRating.tsx | 29 +++++++++++++++++++++-------- src/i18n/locales/en/core.json | 5 ++++- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/components/Apps/AppRating.tsx b/src/components/Apps/AppRating.tsx index 8894f3c..7252c1f 100644 --- a/src/components/Apps/AppRating.tsx +++ b/src/components/Apps/AppRating.tsx @@ -149,10 +149,11 @@ export const AppRating = ({ app, myName, ratingCountPosition = 'right' }) => { res(response); setInfoSnack({ type: 'success', - message: - 'Successfully rated. Please wait a couple minutes for the network to propogate the changes.', + message: t('core:message.success.rated_app', { + postProcess: 'capitalize', + }), }); - setOpenSnack(true); // TODO translate + setOpenSnack(true); } }) .catch((error) => { @@ -166,7 +167,11 @@ export const AppRating = ({ app, myName, ratingCountPosition = 'right' }) => { (option) => +option.optionName === +newValue ); if (isNaN(optionIndex) || optionIndex === -1) - throw new Error('Cannot find rating option'); + throw new Error( + t('core:message.error.rating_option', { + postProcess: 'capitalize', + }) + ); await new Promise((res, rej) => { window .sendMessage( @@ -185,8 +190,9 @@ export const AppRating = ({ app, myName, ratingCountPosition = 'right' }) => { res(response); setInfoSnack({ type: 'success', - message: - 'Successfully rated. Please wait a couple minutes for the network to propogate the changes.', + message: t('core:message.success.rated_app', { + postProcess: 'capitalize', + }), }); setOpenSnack(true); } @@ -200,7 +206,11 @@ export const AppRating = ({ app, myName, ratingCountPosition = 'right' }) => { console.log('error', error); setInfoSnack({ type: 'error', - message: error?.message || 'Unable to rate', + message: + error?.message || + t('core:message.error.unable_rate', { + postProcess: 'capitalize', + }), }); setOpenSnack(true); } @@ -210,8 +220,8 @@ export const AppRating = ({ app, myName, ratingCountPosition = 'right' }) => {
@@ -222,8 +232,11 @@ export const AppRating = ({ app, myName, ratingCountPosition = 'right' }) => { (votesInfo?.voteCounts?.length === 6 ? 1 : 0)}{' '} {' RATINGS'} + + {value?.toFixed(1)} + )} diff --git a/src/i18n/locales/en/core.json b/src/i18n/locales/en/core.json index 23c5fce..90f00b6 100644 --- a/src/i18n/locales/en/core.json +++ b/src/i18n/locales/en/core.json @@ -92,7 +92,9 @@ "minting_account_remove": "unable to remove minting account", "missing_fields": "missing: {{ fields }}", "publish_app": "unable to publish app", - "save_qdn": "unable to save to QDN" + "rating_option": "cannot find rating option", + "save_qdn": "unable to save to QDN", + "unable_rate": "unable to rate" }, "generic": { "name_available": "{{ name }} is available", @@ -123,6 +125,7 @@ "order_submitted": "your buy order was submitted", "published": "successfully published. Please wait a couple minutes for the network to propogate the changes.", "published_qdn": "successfully published to QDN", + "rated_app": "successfully rated. Please wait a couple minutes for the network to propogate the changes.", "request_read": "I have read this request", "transfer": "the transfer was succesful!" } From 45e5e9b66048da356fe00d398d0bd79822b91483 Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Fri, 16 May 2025 08:03:41 +0200 Subject: [PATCH 6/9] CapitalizeFirst and CapitalizeAll --- docs/i18n_languages.md | 2 +- src/App.tsx | 56 +++++++------ src/ExtStates/NotAuthenticated.tsx | 81 +++++++++++-------- src/Wallets.tsx | 46 ++++++----- src/components/Apps/AppInfo.tsx | 16 ++-- src/components/Apps/AppInfoSnippet.tsx | 8 +- src/components/Apps/AppPublish.tsx | 50 ++++++------ src/components/Apps/AppRating.tsx | 14 ++-- src/components/Apps/AppsDesktop.tsx | 6 +- src/components/Auth/DownloadWallet.tsx | 22 ++--- src/components/Chat/GroupAnnouncements.tsx | 2 +- src/components/CoreSyncStatus.tsx | 26 +++--- src/components/Explore/Explore.tsx | 10 ++- src/components/GlobalActions/JoinGroup.tsx | 32 ++++---- src/components/Group/AddGroup.tsx | 52 ++++++------ src/components/Group/AddGroupList.tsx | 16 ++-- src/components/Group/Forum/GroupMail.tsx | 10 ++- src/components/Group/Forum/NewThread.tsx | 32 ++++---- src/components/Group/Forum/Thread.tsx | 26 +++--- src/components/Group/Group.tsx | 32 +++++--- src/components/Group/GroupInvites.tsx | 6 +- src/components/Group/GroupJoinRequests.tsx | 4 +- src/components/Group/HomeDesktop.tsx | 6 +- src/components/Group/InviteMember.tsx | 14 ++-- src/components/Group/ListOfBans.tsx | 8 +- .../Group/ListOfGroupPromotions.tsx | 64 ++++++++------- src/components/Group/ListOfInvites.tsx | 10 +-- src/components/Group/ListOfJoinRequests.tsx | 18 +++-- src/components/Group/ListOfMembers.tsx | 44 +++++----- .../Group/ListOfThreadPostsWatched.tsx | 8 +- src/components/Group/ManageMembers.tsx | 38 +++++---- src/components/Group/QMailMessages.tsx | 8 +- src/components/Group/Settings.tsx | 30 +++---- src/components/Group/ThingsToDoInitial.tsx | 8 +- src/components/Group/UserListOfInvites.tsx | 14 ++-- src/components/Home/NewUsersCTA.tsx | 6 +- src/components/Home/QortPrice.tsx | 6 +- src/components/Language/LanguageSelector.tsx | 2 +- src/components/Minting/Minting.tsx | 78 ++++++++++-------- src/components/QMailStatus.tsx | 2 +- src/components/RegisterName.tsx | 36 +++++---- src/components/Save/Save.tsx | 40 ++++----- src/components/Theme/ThemeSelector.tsx | 4 +- src/components/Tutorials/Tutorials.tsx | 4 +- .../Tutorials/useHandleTutorials.tsx | 12 +-- src/i18n/i18n.ts | 13 ++- 46 files changed, 573 insertions(+), 449 deletions(-) diff --git a/docs/i18n_languages.md b/docs/i18n_languages.md index 7447193..9fcf779 100644 --- a/docs/i18n_languages.md +++ b/docs/i18n_languages.md @@ -7,4 +7,4 @@ In JSON file: In GUI: -- If the first letter of the translation must be uppercase, use the postProcess, for example: `{t_auth('advanced_users', { postProcess: 'capitalize' })}` +- If the first letter of the translation must be uppercase, use the postProcess, for example: `{t_auth('advanced_users', { postProcess: 'capitalizeFirst' })}` diff --git a/src/App.tsx b/src/App.tsx index 17dea23..e5f9cc0 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2514,7 +2514,9 @@ function App() { setExtstate('create-wallet'); }} > - {t('auth:action.create_account', { postProcess: 'capitalize' })} + {t('auth:action.create_account', { + postProcess: 'capitalizeFirst', + })} )} @@ -2611,7 +2613,9 @@ function App() { fontWeight: 600, }} > - {t('auth:action.authenticate', { postProcess: 'capitalize' })} + {t('auth:action.authenticate', { + postProcess: 'capitalizeFirst', + })} @@ -2619,7 +2623,7 @@ function App() { <> - {t('auth:wallet.password', { postProcess: 'capitalize' })} + {t('auth:wallet.password', { postProcess: 'capitalizeFirst' })} @@ -2643,7 +2647,7 @@ function App() { fontSize: '12px', }} > - {t('auth:node.using', { postProcess: 'capitalize' })}:{' '} + {t('auth:node.using', { postProcess: 'capitalizeFirst' })}:{' '} {currentNode?.url} @@ -2655,7 +2659,9 @@ function App() { fontSize: '12px', }} > - {t('auth:node.using_public', { postProcess: 'capitalize' })} + {t('auth:node.using_public', { + postProcess: 'capitalizeFirst', + })} )} @@ -2663,7 +2669,9 @@ function App() { - {t('auth:action.authenticate', { postProcess: 'capitalize' })} + {t('auth:action.authenticate', { + postProcess: 'capitalizeFirst', + })} {walletToBeDecryptedError} @@ -2932,7 +2940,7 @@ function App() { {t('auth:action.create_account', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -2978,7 +2986,7 @@ function App() { }} > {t('core:action.backup_account', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -3008,7 +3016,7 @@ function App() { }} > {t('core:message.success.transfer', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -3019,7 +3027,7 @@ function App() { }} > - {t('core:action.continue', { postProcess: 'capitalize' })} + {t('core:action.continue', { postProcess: 'capitalizeFirst' })} @@ -3036,7 +3044,7 @@ function App() { }} > {t('core:message.success.transfer', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -3045,7 +3053,7 @@ function App() { window.close(); }} > - {t('core:action.continue', { postProcess: 'capitalize' })} + {t('core:action.continue', { postProcess: 'capitalizeFirst' })} )} @@ -3061,7 +3069,7 @@ function App() { }} > {t('core:message.success.order_submitted', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -3070,7 +3078,7 @@ function App() { window.close(); }} > - {t('core:action.close', { postProcess: 'capitalize' })} + {t('core:action.close', { postProcess: 'capitalizeFirst' })} )} @@ -3119,7 +3127,7 @@ function App() { {message?.paymentFee && ( {t('core:fee.payment', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} : {message.paymentFee} @@ -3127,7 +3135,7 @@ function App() { {message?.publishFee && ( {t('core:fee.publish', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} : {message.publishFee} @@ -3151,7 +3159,7 @@ function App() { autoFocus > {t('core:action.accept', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -3193,7 +3201,7 @@ function App() { @@ -3214,7 +3222,7 @@ function App() { @@ -3502,7 +3510,7 @@ function App() { {t('core:message.success.request_read', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -3552,7 +3560,7 @@ function App() { }} > {t('core:action.accept', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} onCancelQortalRequestExtension()} > {t('core:action.decline', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} diff --git a/src/ExtStates/NotAuthenticated.tsx b/src/ExtStates/NotAuthenticated.tsx index 2a6b090..c2f6e74 100644 --- a/src/ExtStates/NotAuthenticated.tsx +++ b/src/ExtStates/NotAuthenticated.tsx @@ -351,7 +351,8 @@ export const NotAuthenticated = ({ .catch((error) => { console.error( 'Failed to set API key:', - error.message || t('core:error', { postProcess: 'capitalize' }) + error.message || + t('core:error', { postProcess: 'capitalizeFirst' }) ); }); } else { @@ -361,7 +362,7 @@ export const NotAuthenticated = ({ setInfoSnack({ type: 'error', message: t('auth:apikey.select_valid', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), }); setOpenSnack(true); @@ -387,7 +388,7 @@ export const NotAuthenticated = ({ 'Failed to set API key:', error.message || t('core:error', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }) ); }); @@ -399,7 +400,7 @@ export const NotAuthenticated = ({ message: error?.message || t('auth:apikey.select_valid', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), }); setOpenSnack(true); @@ -481,7 +482,7 @@ export const NotAuthenticated = ({ fontSize: '18px', }} > - {t('auth:welcome', { postProcess: 'capitalize' })} + {t('auth:welcome', { postProcess: 'capitalizeFirst' })} - {t('auth:tips.digital_id', { postProcess: 'capitalize' })} + {t('auth:tips.digital_id', { postProcess: 'capitalizeFirst' })} } > setExtstate('wallets')}> - {t('auth:account.account_many', { postProcess: 'capitalize' })} + {t('auth:account.account_many', { postProcess: 'capitalizeFirst' })} @@ -542,7 +543,7 @@ export const NotAuthenticated = ({ fontSize: '18px', }} > - {t('auth:tips.new_users', { postProcess: 'capitalize' })} + {t('auth:tips.new_users', { postProcess: 'capitalizeFirst' })} - {t('auth:tips.new_account', { postProcess: 'capitalize' })} + {t('auth:tips.new_account', { postProcess: 'capitalizeFirst' })} } @@ -572,7 +573,9 @@ export const NotAuthenticated = ({ }, }} > - {t('auth:action.create_account', { postProcess: 'capitalize' })} + {t('auth:action.create_account', { + postProcess: 'capitalizeFirst', + })} @@ -585,7 +588,7 @@ export const NotAuthenticated = ({ visibility: !useLocalNode && 'hidden', }} > - {t('auth:node.using', { postProcess: 'capitalize' })}:{' '} + {t('auth:node.using', { postProcess: 'capitalizeFirst' })}:{' '} {currentNode?.url} @@ -613,7 +616,7 @@ export const NotAuthenticated = ({ textDecoration: 'underline', }} > - {t('auth:advanced_users', { postProcess: 'capitalize' })} + {t('auth:advanced_users', { postProcess: 'capitalizeFirst' })} @@ -676,8 +683,12 @@ export const NotAuthenticated = ({ component="label" > {apiKey - ? t('auth:node.use_local', { postProcess: 'capitalize' }) - : t('auth:apikey.import', { postProcess: 'capitalize' })} + ? t('auth:node.use_local', { + postProcess: 'capitalizeFirst', + }) + : t('auth:apikey.import', { + postProcess: 'capitalizeFirst', + })} - {t('auth:apikey.key', { postProcess: 'capitalize' })}:{' '} + {t('auth:apikey.key', { postProcess: 'capitalizeFirst' })}:{' '} {importedApiKey} @@ -698,7 +709,7 @@ export const NotAuthenticated = ({ variant="contained" component="label" > - {t('auth:node.choose', { postProcess: 'capitalize' })} + {t('auth:node.choose', { postProcess: 'capitalizeFirst' })} - {t('auth:build_version', { postProcess: 'capitalize' })}: + {t('auth:build_version', { postProcess: 'capitalizeFirst' })}: {manifestData?.version} @@ -728,7 +739,7 @@ export const NotAuthenticated = ({ > {' '} - {t('auth:node.custom_many', { postProcess: 'capitalize' })}: + {t('auth:node.custom_many', { postProcess: 'capitalizeFirst' })}: - {t('core:action.choose', { postProcess: 'capitalize' })} + {t('core:action.choose', { + postProcess: 'capitalizeFirst', + })} @@ -858,7 +871,7 @@ export const NotAuthenticated = ({ variant="contained" > {t('core:action.choose', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -873,7 +886,7 @@ export const NotAuthenticated = ({ variant="contained" > {t('core:action.edit', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -887,7 +900,9 @@ export const NotAuthenticated = ({ }} variant="contained" > - {t('core:remove', { postProcess: 'capitalize' })} + {t('core:remove', { + postProcess: 'capitalizeFirst', + })} @@ -926,7 +941,7 @@ export const NotAuthenticated = ({ {mode === 'list' && ( )} @@ -939,7 +954,7 @@ export const NotAuthenticated = ({ }} autoFocus > - {t('core:action.close', { postProcess: 'capitalize' })} + {t('core:action.close', { postProcess: 'capitalizeFirst' })} )} @@ -954,7 +969,7 @@ export const NotAuthenticated = ({ }} > {t('auth:action.return_to_list', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -964,7 +979,7 @@ export const NotAuthenticated = ({ onClick={() => saveCustomNodes(customNodes)} autoFocus > - {t('core:save', { postProcess: 'capitalize' })} + {t('core:save', { postProcess: 'capitalizeFirst' })} )} @@ -979,7 +994,7 @@ export const NotAuthenticated = ({ aria-describedby="alert-dialog-description" > - {t('auth:apikey.enter', { postProcess: 'capitalize' })} + {t('auth:apikey.enter', { postProcess: 'capitalizeFirst' })} - {t('auth:apikey.alternative', { postProcess: 'capitalize' })} + {t('auth:apikey.alternative', { + postProcess: 'capitalizeFirst', + })} - {t('core:save', { postProcess: 'capitalize' })} + {t('core:save', { postProcess: 'capitalizeFirst' })} diff --git a/src/Wallets.tsx b/src/Wallets.tsx index 9fb153b..bd41369 100644 --- a/src/Wallets.tsx +++ b/src/Wallets.tsx @@ -152,7 +152,7 @@ export const Wallets = ({ setExtState, setRawWallet, rawWallet }) => { } else { setSeedError( t('auth:message.error.account_creation', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }) ); } @@ -160,7 +160,7 @@ export const Wallets = ({ setExtState, setRawWallet, rawWallet }) => { setSeedError( error?.message || t('auth:message.error.account_creation', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }) ); } finally { @@ -202,7 +202,7 @@ export const Wallets = ({ setExtState, setRawWallet, rawWallet }) => { <> {t('auth:message.generic.no_account', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -212,7 +212,7 @@ export const Wallets = ({ setExtState, setRawWallet, rawWallet }) => { <> {t('auth:message.generic.your_accounts', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -224,7 +224,7 @@ export const Wallets = ({ setExtState, setRawWallet, rawWallet }) => { {t('auth:account.selected', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} : @@ -282,7 +282,9 @@ export const Wallets = ({ setExtState, setRawWallet, rawWallet }) => { fontSize: '16px', }} > - {t('auth:tips.existing_account', { postProcess: 'capitalize' })} + {t('auth:tips.existing_account', { + postProcess: 'capitalizeFirst', + })} } @@ -294,7 +296,9 @@ export const Wallets = ({ setExtState, setRawWallet, rawWallet }) => { display: 'inline', }} > - {t('auth:action.add.seed_phrase', { postProcess: 'capitalize' })} + {t('auth:action.add.seed_phrase', { + postProcess: 'capitalizeFirst', + })} @@ -309,7 +313,7 @@ export const Wallets = ({ setExtState, setRawWallet, rawWallet }) => { }} > {t('auth:tips.additional_wallet', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -323,7 +327,7 @@ export const Wallets = ({ setExtState, setRawWallet, rawWallet }) => { > {t('auth:action.add.account', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -341,7 +345,7 @@ export const Wallets = ({ setExtState, setRawWallet, rawWallet }) => { > {t('auth:message.generic.type_seed', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -354,7 +358,7 @@ export const Wallets = ({ setExtState, setRawWallet, rawWallet }) => { > { { { }} > {t('core:action.close', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} { autoFocus > {t('core:action.add', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} { }} > {t('core:action.login', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -546,7 +550,7 @@ const WalletItem = ({ wallet, updateWalletItem, idx, setSelectedWallet }) => { > { { onClick={() => setIsEdit(false)} > {t('core:action.close', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} diff --git a/src/components/Apps/AppInfo.tsx b/src/components/Apps/AppInfo.tsx index b36799a..6e8e274 100644 --- a/src/components/Apps/AppInfo.tsx +++ b/src/components/Apps/AppInfo.tsx @@ -174,10 +174,10 @@ export const AppInfo = ({ app, myName }) => { {isSelectedAppPinned ? t('core:action.unpin_from_dashboard', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }) : t('core:action.pin_from_dashboard', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -200,10 +200,10 @@ export const AppInfo = ({ app, myName }) => { {isInstalled ? t('core:action.open', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }) : t('core:action.download', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -229,7 +229,7 @@ export const AppInfo = ({ app, myName }) => { {t('core:category', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} : @@ -239,7 +239,7 @@ export const AppInfo = ({ app, myName }) => { {app?.metadata?.categoryName || t('core:none', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -249,7 +249,7 @@ export const AppInfo = ({ app, myName }) => { {t('core:q_apps.about', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -259,7 +259,7 @@ export const AppInfo = ({ app, myName }) => { {app?.metadata?.description || t('core:message.generic.no_description', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} diff --git a/src/components/Apps/AppInfoSnippet.tsx b/src/components/Apps/AppInfoSnippet.tsx index c027bb0..1629b5e 100644 --- a/src/components/Apps/AppInfoSnippet.tsx +++ b/src/components/Apps/AppInfoSnippet.tsx @@ -173,10 +173,10 @@ export const AppInfoSnippet = ({ {isSelectedAppPinned ? t('core:action.unpin', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }) : t('core:action.pin', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -196,10 +196,10 @@ export const AppInfoSnippet = ({ {isInstalled ? t('core:action.open', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }) : t('core:action.download', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} diff --git a/src/components/Apps/AppPublish.tsx b/src/components/Apps/AppPublish.tsx index 1425ba6..6ab1525 100644 --- a/src/components/Apps/AppPublish.tsx +++ b/src/components/Apps/AppPublish.tsx @@ -96,7 +96,7 @@ export const AppPublish = ({ names, categories }) => { t('core:message.error.file_too_large', { filename: file.name, size: maxFileSize / (1024 * 1024), - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }) ); } @@ -171,7 +171,7 @@ export const AppPublish = ({ names, categories }) => { const missingFieldsString = missingFields.join(', '); const errorMsg = t('core:message.error.missing_fields', { fields: missingFieldsString, - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }); throw new Error(errorMsg); } @@ -179,13 +179,13 @@ export const AppPublish = ({ names, categories }) => { await show({ message: t('core:save_options.publish_app', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), publishFee: fee.fee + ' QORT', }); setIsLoading( t('core:message.generic.publishing', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }) ); const fileBase64 = await fileToBase64(file); @@ -214,14 +214,16 @@ export const AppPublish = ({ names, categories }) => { .catch((error) => { rej( error.message || - t('core:message.error.generic', { postProcess: 'capitalize' }) + t('core:message.error.generic', { + postProcess: 'capitalizeFirst', + }) ); }); }); setInfoSnack({ type: 'success', message: t('core:message.success.published', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), }); setOpenSnack(true); @@ -244,7 +246,7 @@ export const AppPublish = ({ names, categories }) => { message: error?.message || t('core:message.error.publish_app', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), }); setOpenSnack(true); @@ -268,7 +270,7 @@ export const AppPublish = ({ names, categories }) => { > {t('core:action.create_apps', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} ! @@ -277,7 +279,7 @@ export const AppPublish = ({ names, categories }) => { {t('core:message.generic.one_app_per_name', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -285,7 +287,7 @@ export const AppPublish = ({ names, categories }) => { {t('core:name_app', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -302,7 +304,7 @@ export const AppPublish = ({ names, categories }) => { }} > {t('core:action.select_name_app', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} {/* This is the placeholder item */} @@ -316,7 +318,7 @@ export const AppPublish = ({ names, categories }) => { {t('core:app_service_type', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -333,18 +335,18 @@ export const AppPublish = ({ names, categories }) => { }} > {t('core:action.select_app_type', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} {t('core:app', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} {t('core:website', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -353,7 +355,7 @@ export const AppPublish = ({ names, categories }) => { {t('core:title', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -380,7 +382,7 @@ export const AppPublish = ({ names, categories }) => { {t('core:description', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -407,7 +409,7 @@ export const AppPublish = ({ names, categories }) => { {t('core:category', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -424,7 +426,7 @@ export const AppPublish = ({ names, categories }) => { }} > {t('core:action.select_category', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -441,7 +443,7 @@ export const AppPublish = ({ names, categories }) => { {t('core:tags', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -536,7 +538,9 @@ export const AppPublish = ({ names, categories }) => { - {t('core:message.generic.select_zip', { postProcess: 'capitalize' })} + {t('core:message.generic.select_zip', { + postProcess: 'capitalizeFirst', + })} @@ -556,7 +560,7 @@ export const AppPublish = ({ names, categories }) => { {' '} - {t('core:action.choose_file', { postProcess: 'capitalize' })} + {t('core:action.choose_file', { postProcess: 'capitalizeFirst' })} @@ -567,7 +571,7 @@ export const AppPublish = ({ names, categories }) => { }} onClick={publishApp} > - {t('core:action.publish', { postProcess: 'capitalize' })} + {t('core:action.publish', { postProcess: 'capitalizeFirst' })} diff --git a/src/components/Apps/AppRating.tsx b/src/components/Apps/AppRating.tsx index 7252c1f..34bdee0 100644 --- a/src/components/Apps/AppRating.tsx +++ b/src/components/Apps/AppRating.tsx @@ -106,7 +106,7 @@ export const AppRating = ({ app, myName, ratingCountPosition = 'right' }) => { if (!myName) throw new Error( t('core:message.generic.name_rate', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }) ); if (!app?.name) return; @@ -115,7 +115,7 @@ export const AppRating = ({ app, myName, ratingCountPosition = 'right' }) => { await show({ message: t('core:message.error.generic', { rate: newValue, - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), publishFee: fee.fee + ' QORT', }); @@ -126,7 +126,7 @@ export const AppRating = ({ app, myName, ratingCountPosition = 'right' }) => { const pollDescription = t('core:message.error.generic', { name: app.name, service: app.service, - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }); await new Promise((res, rej) => { @@ -150,7 +150,7 @@ export const AppRating = ({ app, myName, ratingCountPosition = 'right' }) => { setInfoSnack({ type: 'success', message: t('core:message.success.rated_app', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), }); setOpenSnack(true); @@ -169,7 +169,7 @@ export const AppRating = ({ app, myName, ratingCountPosition = 'right' }) => { if (isNaN(optionIndex) || optionIndex === -1) throw new Error( t('core:message.error.rating_option', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }) ); await new Promise((res, rej) => { @@ -191,7 +191,7 @@ export const AppRating = ({ app, myName, ratingCountPosition = 'right' }) => { setInfoSnack({ type: 'success', message: t('core:message.success.rated_app', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), }); setOpenSnack(true); @@ -209,7 +209,7 @@ export const AppRating = ({ app, myName, ratingCountPosition = 'right' }) => { message: error?.message || t('core:message.error.unable_rate', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), }); setOpenSnack(true); diff --git a/src/components/Apps/AppsDesktop.tsx b/src/components/Apps/AppsDesktop.tsx index d1268fb..56c4985 100644 --- a/src/components/Apps/AppsDesktop.tsx +++ b/src/components/Apps/AppsDesktop.tsx @@ -24,6 +24,7 @@ import { AppsIcon } from '../../assets/Icons/AppsIcon'; import { CoreSyncStatus } from '../CoreSyncStatus'; import { MessagingIconFilled } from '../../assets/Icons/MessagingIconFilled'; import { useAtom } from 'jotai'; +import { useTranslation } from 'react-i18next'; const uid = new ShortUniqueId({ length: 8 }); @@ -47,9 +48,9 @@ export const AppsDesktop = ({ const [categories, setCategories] = useState([]); const iframeRefs = useRef({}); const [isEnabledDevMode, setIsEnabledDevMode] = useAtom(enabledDevModeAtom); - const { showTutorial } = useContext(MyContext); const theme = useTheme(); + const { t } = useTranslation(['core', 'group']); const myApp = useMemo(() => { return availableQapps.find( @@ -104,7 +105,6 @@ export const AppsDesktop = ({ try { let apps = []; let websites = []; - // dispatch(setIsLoadingGlobal(true)) const url = `${getBaseApiReact()}/arbitrary/resources/search?service=APP&mode=ALL&limit=0&includestatus=true&includemetadata=true`; const response = await fetch(url, { @@ -113,6 +113,7 @@ export const AppsDesktop = ({ 'Content-Type': 'application/json', }, }); + if (!response?.ok) return; const responseData = await response.json(); const urlWebsites = `${getBaseApiReact()}/arbitrary/resources/search?service=WEBSITE&mode=ALL&limit=0&includestatus=true&includemetadata=true`; @@ -123,6 +124,7 @@ export const AppsDesktop = ({ 'Content-Type': 'application/json', }, }); + if (!responseWebsites?.ok) return; const responseDataWebsites = await responseWebsites.json(); diff --git a/src/components/Auth/DownloadWallet.tsx b/src/components/Auth/DownloadWallet.tsx index f96dbb6..eb85a20 100644 --- a/src/components/Auth/DownloadWallet.tsx +++ b/src/components/Auth/DownloadWallet.tsx @@ -76,14 +76,16 @@ export const DownloadWallet = ({ if (!keepCurrentPassword && !newPassword) { setWalletToBeDownloadedError( t('auth:wallet.error.missing_new_password', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }) ); return; } if (!walletToBeDownloadedPassword) { setWalletToBeDownloadedError( - t('auth:wallet.error.missing_password', { postProcess: 'capitalize' }) + t('auth:wallet.error.missing_password', { + postProcess: 'capitalizeFirst', + }) ); return; } @@ -157,7 +159,9 @@ export const DownloadWallet = ({ fontWeight: 600, }} > - {t('auth:action.download_account', { postProcess: 'capitalize' })} + {t('auth:action.download_account', { + postProcess: 'capitalizeFirst', + })} @@ -167,7 +171,7 @@ export const DownloadWallet = ({ <> {t('auth:wallet.password_confirmation', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -206,7 +210,7 @@ export const DownloadWallet = ({ {t('auth:wallet.keep_password', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -217,7 +221,7 @@ export const DownloadWallet = ({ <> {t('auth:wallet.new_password', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -233,7 +237,7 @@ export const DownloadWallet = ({ {t('auth:password_confirmation', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -248,13 +252,13 @@ export const DownloadWallet = ({ await saveFileToDiskFunc(); await showInfo({ message: t('auth:message.generic.keep_secure', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), }); }} > {t('auth:action.download_account', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} diff --git a/src/components/Chat/GroupAnnouncements.tsx b/src/components/Chat/GroupAnnouncements.tsx index c91bfaa..af92b71 100644 --- a/src/components/Chat/GroupAnnouncements.tsx +++ b/src/components/Chat/GroupAnnouncements.tsx @@ -291,7 +291,7 @@ export const GroupAnnouncements = ({ await show({ message: t('group:question.perform_transaction', { action: 'ARBITRARY', - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), publishFee: fee.fee + ' QORT', }); diff --git a/src/components/CoreSyncStatus.tsx b/src/components/CoreSyncStatus.tsx index 79e22d2..3e782c4 100644 --- a/src/components/CoreSyncStatus.tsx +++ b/src/components/CoreSyncStatus.tsx @@ -77,26 +77,26 @@ export const CoreSyncStatus = () => { let imagePath = syncingImg; let message = t('core:message.status.synchronizing', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }); if (isMintingPossible && !isUsingGateway) { imagePath = syncedMintingImg; - message = `${t(`core:message.status.${isSynchronizing ? 'synchronizing' : 'synchronized'}`, { postProcess: 'capitalize' })} ${t('core:message.status.minting')}`; + message = `${t(`core:message.status.${isSynchronizing ? 'synchronizing' : 'synchronized'}`, { postProcess: 'capitalizeFirst' })} ${t('core:message.status.minting')}`; } else if (isSynchronizing === true && syncPercent === 99) { imagePath = syncingImg; } else if (isSynchronizing && !isMintingPossible && syncPercent === 100) { imagePath = syncingImg; - message = `${t('core:message.status.synchronizing', { postProcess: 'capitalize' })} ${!isUsingGateway ? t('core:message.status.not_minting') : ''}`; + message = `${t('core:message.status.synchronizing', { postProcess: 'capitalizeFirst' })} ${!isUsingGateway ? t('core:message.status.not_minting') : ''}`; } else if (!isSynchronizing && !isMintingPossible && syncPercent === 100) { imagePath = syncedImg; - message = `${t('core:message.status.synchronized', { postProcess: 'capitalize' })} ${!isUsingGateway ? t('core:message.status.not_minting') : ''}`; + message = `${t('core:message.status.synchronized', { postProcess: 'capitalizeFirst' })} ${!isUsingGateway ? t('core:message.status.not_minting') : ''}`; } else if (isSynchronizing && isMintingPossible && syncPercent === 100) { imagePath = syncingImg; - message = `${t('core:message.status.synchronizing', { postProcess: 'capitalize' })} ${!isUsingGateway ? t('core:message.status.minting') : ''}`; + message = `${t('core:message.status.synchronizing', { postProcess: 'capitalizeFirst' })} ${!isUsingGateway ? t('core:message.status.minting') : ''}`; } else if (!isSynchronizing && isMintingPossible && syncPercent === 100) { imagePath = syncedMintingImg; - message = `${t('core:message.status.synchronized', { postProcess: 'capitalize' })} ${!isUsingGateway ? t('core:message.status.minting') : ''}`; + message = `${t('core:message.status.synchronized', { postProcess: 'capitalizeFirst' })} ${!isUsingGateway ? t('core:message.status.minting') : ''}`; } return ( @@ -121,36 +121,38 @@ export const CoreSyncStatus = () => { top: '10px', }} > -

{t('core:core.information', { postProcess: 'capitalize' })}

+

+ {t('core:core.information', { postProcess: 'capitalizeFirst' })} +

- {t('core:core.version', { postProcess: 'capitalize' })}:{' '} + {t('core:core.version', { postProcess: 'capitalizeFirst' })}:{' '} {buildVersion}

{message}

- {t('core:core.block_height', { postProcess: 'capitalize' })}:{' '} + {t('core:core.block_height', { postProcess: 'capitalizeFirst' })}:{' '} {height || ''}

- {t('core:core.peers', { postProcess: 'capitalize' })}:{' '} + {t('core:core.peers', { postProcess: 'capitalizeFirst' })}:{' '} {numberOfConnections || ''}

- {t('auth:node.using_public', { postProcess: 'capitalize' })}:{' '} + {t('auth:node.using_public', { postProcess: 'capitalizeFirst' })}:{' '} {isUsingGateway?.toString()}

- {t('core:ui.version', { postProcess: 'capitalize' })}:{' '} + {t('core:ui.version', { postProcess: 'capitalizeFirst' })}:{' '} {manifestData.version}

diff --git a/src/components/Explore/Explore.tsx b/src/components/Explore/Explore.tsx index 3da3cf5..33c7876 100644 --- a/src/components/Explore/Explore.tsx +++ b/src/components/Explore/Explore.tsx @@ -46,7 +46,7 @@ export const Explore = ({ setDesktopViewMode }) => { fontSize: '1rem', }} > - {t('tutorial:initial.trade_qort', { postProcess: 'capitalize' })} + {t('tutorial:initial.trade_qort', { postProcess: 'capitalizeFirst' })} @@ -73,7 +73,7 @@ export const Explore = ({ setDesktopViewMode }) => { fontSize: '1rem', }} > - {t('tutorial:initial.see_apps', { postProcess: 'capitalize' })} + {t('tutorial:initial.see_apps', { postProcess: 'capitalizeFirst' })} @@ -102,7 +102,9 @@ export const Explore = ({ setDesktopViewMode }) => { fontSize: '1rem', }} > - {t('tutorial:initial.general_chat', { postProcess: 'capitalize' })} + {t('tutorial:initial.general_chat', { + postProcess: 'capitalizeFirst', + })} @@ -129,7 +131,7 @@ export const Explore = ({ setDesktopViewMode }) => { fontSize: '1rem', }} > - {t('core:wallet.wallet_other', { postProcess: 'capitalize' })} + {t('core:wallet.wallet_other', { postProcess: 'capitalizeFirst' })} diff --git a/src/components/GlobalActions/JoinGroup.tsx b/src/components/GlobalActions/JoinGroup.tsx index a56d642..a6ec98f 100644 --- a/src/components/GlobalActions/JoinGroup.tsx +++ b/src/components/GlobalActions/JoinGroup.tsx @@ -72,7 +72,7 @@ export const JoinGroup = () => { await show({ message: t('group:question.perform_transaction', { action: 'JOIN_GROUP', - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), publishFee: fee.fee + ' QORT', }); @@ -89,7 +89,7 @@ export const JoinGroup = () => { setInfoSnack({ type: 'success', message: t('group:message.success.group_join', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), }); @@ -100,11 +100,11 @@ export const JoinGroup = () => { type: 'joined-group', label: t('group:message.success.group_join_label', { group_name: group?.groupName, - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), labelDone: t('group:message.success.group_join_label', { group_name: group?.groupName, - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), done: false, groupId, @@ -118,11 +118,11 @@ export const JoinGroup = () => { type: 'joined-group-request', label: t('group:message.success.group_join_request', { group_name: group?.groupName, - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), labelDone: t('group:message.success.group_join_outcome', { group_name: group?.groupName, - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), done: false, groupId, @@ -147,7 +147,9 @@ export const JoinGroup = () => { type: 'error', message: error.message || - t('core:message.error.generic', { postProcess: 'capitalize' }), + t('core:message.error.generic', { + postProcess: 'capitalizeFirst', + }), }); setOpenSnack(true); rej(error); @@ -205,7 +207,7 @@ export const JoinGroup = () => { fontWeight: 600, }} > - {t('group:group.name', { postProcess: 'capitalize' })}:{' '} + {t('group:group.name', { postProcess: 'capitalizeFirst' })}:{' '} {` ${groupInfo?.groupName}`} @@ -215,8 +217,10 @@ export const JoinGroup = () => { fontWeight: 600, }} > - {t('group:group.member_number', { postProcess: 'capitalize' })}:{' '} - {` ${groupInfo?.memberCount}`} + {t('group:group.member_number', { + postProcess: 'capitalizeFirst', + })} + : {` ${groupInfo?.memberCount}`} {groupInfo?.description && ( @@ -237,7 +241,7 @@ export const JoinGroup = () => { }} > {t('group:message.generic.already_in_group', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} )} @@ -249,7 +253,7 @@ export const JoinGroup = () => { }} > {t('group:message.generic.closed_group', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} )} @@ -276,7 +280,7 @@ export const JoinGroup = () => { }} > {t('core:action.join', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -291,7 +295,7 @@ export const JoinGroup = () => { onClick={() => setIsOpen(false)} > {t('core:action.close', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} diff --git a/src/components/Group/AddGroup.tsx b/src/components/Group/AddGroup.tsx index 8b91ebe..b1da7e5 100644 --- a/src/components/Group/AddGroup.tsx +++ b/src/components/Group/AddGroup.tsx @@ -105,13 +105,13 @@ export const AddGroup = ({ address, open, setOpen }) => { if (!name) throw new Error( t('group:message.error.name_required', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }) ); if (!description) throw new Error( t('group:message.error.description_required', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }) ); @@ -120,7 +120,7 @@ export const AddGroup = ({ address, open, setOpen }) => { await show({ message: t('group:question.perform_transaction', { action: 'CREATE_GROUP', - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), publishFee: fee.fee + ' QORT', }); @@ -140,7 +140,7 @@ export const AddGroup = ({ address, open, setOpen }) => { setInfoSnack({ type: 'success', message: t('group:message.success.group_creation', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), }); setOpenSnack(true); @@ -150,11 +150,11 @@ export const AddGroup = ({ address, open, setOpen }) => { type: 'created-group', label: t('group:message.success.group_creation_name', { group_name: name, - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), labelDone: t('group:message.success.group_creation_label', { group_name: name, - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), done: false, }, @@ -172,7 +172,9 @@ export const AddGroup = ({ address, open, setOpen }) => { rej({ message: error.message || - t('core:message.error.generic', { postProcess: 'capitalize' }), + t('core:message.error.generic', { + postProcess: 'capitalizeFirst', + }), }); }); }); @@ -225,7 +227,7 @@ export const AddGroup = ({ address, open, setOpen }) => { > - {t('group:group.management', { postProcess: 'capitalize' })} + {t('group:group.management', { postProcess: 'capitalizeFirst' })} { > { /> { /> { > setName(e.target.value)} @@ -350,13 +352,13 @@ export const AddGroup = ({ address, open, setOpen }) => { > setDescription(e.target.value)} @@ -372,7 +374,7 @@ export const AddGroup = ({ address, open, setOpen }) => { > @@ -385,12 +387,12 @@ export const AddGroup = ({ address, open, setOpen }) => { > {t('group:group.open', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} {t('group:group.closed', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -407,7 +409,7 @@ export const AddGroup = ({ address, open, setOpen }) => { > {t('group:advanced_options', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -424,7 +426,7 @@ export const AddGroup = ({ address, open, setOpen }) => { > @@ -437,12 +439,12 @@ export const AddGroup = ({ address, open, setOpen }) => { > {t('core:count.none', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} {t('core:count.one', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} 20% @@ -462,7 +464,7 @@ export const AddGroup = ({ address, open, setOpen }) => { > @@ -521,7 +523,7 @@ export const AddGroup = ({ address, open, setOpen }) => { > @@ -582,7 +584,7 @@ export const AddGroup = ({ address, open, setOpen }) => { onClick={handleCreateGroup} > {t('group:action.create_group', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} diff --git a/src/components/Group/AddGroupList.tsx b/src/components/Group/AddGroupList.tsx index 49dce3d..5c577f1 100644 --- a/src/components/Group/AddGroupList.tsx +++ b/src/components/Group/AddGroupList.tsx @@ -115,7 +115,7 @@ export const AddGroupList = ({ setInfoSnack, setOpenSnack }) => { await show({ message: t('group:question.perform_transaction', { action: 'JOIN_GROUP', - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), publishFee: fee.fee + ' QORT', }); @@ -131,7 +131,7 @@ export const AddGroupList = ({ setInfoSnack, setOpenSnack }) => { setInfoSnack({ type: 'success', message: t('group:message.success.join_group', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), }); @@ -142,11 +142,11 @@ export const AddGroupList = ({ setInfoSnack, setOpenSnack }) => { type: 'joined-group', label: t('group:message.success.group_join_label', { group_name: group?.groupName, - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), labelDone: t('group:message.success.group_join_label', { group_name: group?.groupName, - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), done: false, groupId, @@ -160,11 +160,11 @@ export const AddGroupList = ({ setInfoSnack, setOpenSnack }) => { type: 'joined-group-request', label: t('group:message.success.group_join_request', { group_name: group?.groupName, - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), labelDone: t('group:message.success.group_join_outcome', { group_name: group?.groupName, - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), done: false, groupId, @@ -243,7 +243,7 @@ export const AddGroupList = ({ setInfoSnack, setOpenSnack }) => { }} > - {t('core:action.join', { postProcess: 'capitalize' })}{' '} + {t('core:action.join', { postProcess: 'capitalizeFirst' })}{' '} {group?.groupName} @@ -257,7 +257,7 @@ export const AddGroupList = ({ setInfoSnack, setOpenSnack }) => { onClick={() => handleJoinGroup(group, group?.isOpen)} > {t('group:action.join_group', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} diff --git a/src/components/Group/Forum/GroupMail.tsx b/src/components/Group/Forum/GroupMail.tsx index 41f75ef..c1718a5 100644 --- a/src/components/Group/Forum/GroupMail.tsx +++ b/src/components/Group/Forum/GroupMail.tsx @@ -170,7 +170,9 @@ export const GroupMail = ({ .catch((error) => { rej( error.message || - t('core:message.error.generic', { postProcess: 'capitalize' }) + t('core:message.error.generic', { + postProcess: 'capitalizeFirst', + }) ); }); }); @@ -754,7 +756,7 @@ export const GroupMail = ({ {t('group:last_message', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} :{' '} @@ -791,7 +793,7 @@ export const GroupMail = ({ }} > {t('core:page.last', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} diff --git a/src/components/Group/Forum/NewThread.tsx b/src/components/Group/Forum/NewThread.tsx index 0212702..4a561f5 100644 --- a/src/components/Group/Forum/NewThread.tsx +++ b/src/components/Group/Forum/NewThread.tsx @@ -183,19 +183,19 @@ export const NewThread = ({ if (!isMessage && !threadTitle) { errorMsg = t('group:question.provide_thread', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }); } if (!name) { errorMsg = t('group:message.error.access_name', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }); } if (!groupInfo) { errorMsg = t('group:message.error.group_info', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }); } @@ -204,7 +204,7 @@ export const NewThread = ({ const missingFieldsString = missingFields.join(', '); const errMsg = t('core:message.error.missing_fields', { field: missingFieldsString, - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }); errorMsg = errMsg; } @@ -217,7 +217,7 @@ export const NewThread = ({ if (!htmlContent?.trim() || htmlContent?.trim() === '

') { const errMsg = t('group:message.generic.provide_message', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }); throw new Error(errMsg); } @@ -231,7 +231,7 @@ export const NewThread = ({ await show({ message: t('group:question.perform_transaction', { action: 'ARBITRARY', - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), publishFee: feeToShow + ' QORT', }); @@ -257,7 +257,7 @@ export const NewThread = ({ isPrivate === false ? null : await getSecretKey(false, true); if (!secretKey && isPrivate) { const errMsg = t('group:message.error.group_secret_key', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }); throw new Error(errMsg); } @@ -320,7 +320,7 @@ export const NewThread = ({ setInfoSnack({ type: 'success', message: t('group:message.success.thread_creation', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), }); setOpenSnack(true); @@ -332,7 +332,7 @@ export const NewThread = ({ } else { if (!currentThread) { const errMsg = t('group:message.error.thread_id', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }); throw new Error(errMsg); } @@ -360,7 +360,7 @@ export const NewThread = ({ setInfoSnack({ type: 'success', message: t('group:message.success.post_creation', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), }); setOpenSnack(true); @@ -404,10 +404,10 @@ export const NewThread = ({ {currentThread ? t('core:action.new.post', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }) : t('core:action.new.thread', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -437,10 +437,10 @@ export const NewThread = ({ {isMessage ? t('core:action.post_message', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }) : t('core:action.new.thread', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -562,10 +562,10 @@ export const NewThread = ({ {isMessage ? t('core:action.post', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }) : t('core:action.create_thread', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} diff --git a/src/components/Group/Forum/Thread.tsx b/src/components/Group/Forum/Thread.tsx index a6c2d0f..447200e 100644 --- a/src/components/Group/Forum/Thread.tsx +++ b/src/components/Group/Forum/Thread.tsx @@ -609,7 +609,7 @@ export const Thread = ({ {t('group:action.return_to_thread', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -688,7 +688,7 @@ export const Thread = ({ disabled={!hasFirstPage} variant="contained" > - {t('core:page.first', { postProcess: 'capitalize' })} + {t('core:page.first', { postProcess: 'capitalizeFirst' })} @@ -929,7 +929,9 @@ export const Thread = ({ fontSize: '18px', }} > - {t('core:downloading_qdn', { postProcess: 'capitalize' })} + {t('core:downloading_qdn', { + postProcess: 'capitalizeFirst', + })} @@ -961,7 +963,7 @@ export const Thread = ({ }} > {t('group:action.refetch_page', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -1000,7 +1002,7 @@ export const Thread = ({ disabled={!hasFirstPage} variant="contained" > - {t('core:page.first', { postProcess: 'capitalize' })} + {t('core:page.first', { postProcess: 'capitalizeFirst' })} @@ -1071,7 +1073,7 @@ export const Thread = ({ diff --git a/src/components/Group/Group.tsx b/src/components/Group/Group.tsx index a7e330d..b524697 100644 --- a/src/components/Group/Group.tsx +++ b/src/components/Group/Group.tsx @@ -514,7 +514,9 @@ export const Group = ({ .catch((error) => { rej( error.message || - t('core:message.error.generic', { postProcess: 'capitalize' }) + t('core:message.error.generic', { + postProcess: 'capitalizeFirst', + }) ); }); }); @@ -543,7 +545,9 @@ export const Group = ({ .catch((error) => { rej( error.message || - t('core:message.error.generic', { postProcess: 'capitalize' }) + t('core:message.error.generic', { + postProcess: 'capitalizeFirst', + }) ); }); }); @@ -575,7 +579,9 @@ export const Group = ({ .catch((error) => { rej( error.message || - t('core:message.error.generic', { postProcess: 'capitalize' }) + t('core:message.error.generic', { + postProcess: 'capitalizeFirst', + }) ); }); }); @@ -1098,7 +1104,9 @@ export const Group = ({ .catch((error) => { rej( error.message || - t('core:message.error.generic', { postProcess: 'capitalize' }) + t('core:message.error.generic', { + postProcess: 'capitalizeFirst', + }) ); }); }); @@ -1995,7 +2003,7 @@ export const Group = ({ }} > {t('group:message.generic.no_selection', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -2094,7 +2102,7 @@ export const Group = ({ {' '} {t('group:message.generic.encryption_key', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -2120,21 +2128,21 @@ export const Group = ({ {' '} {t('group:message.generic.not_part_group', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} {t('group:message.generic.only_encrypted', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} {t('group:message.generic.notify_admins', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -2156,7 +2164,7 @@ export const Group = ({ onClick={() => notifyAdmin(admin)} > {t('core:action.notify', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -2381,7 +2389,7 @@ export const Group = ({ message: isLoadingGroupMessage || t('group:message.generic.setting_group', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), }} /> @@ -2390,7 +2398,7 @@ export const Group = ({ open={isLoadingGroups} info={{ message: t('group:message.generic.setting_group', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), }} /> diff --git a/src/components/Group/GroupInvites.tsx b/src/components/Group/GroupInvites.tsx index ca3f32c..f3da8a0 100644 --- a/src/components/Group/GroupInvites.tsx +++ b/src/components/Group/GroupInvites.tsx @@ -71,7 +71,7 @@ export const GroupInvites = ({ myAddress, setOpenAddGroup }) => { fontSize: '1rem', }} > - {t('group:group.invites', { postProcess: 'capitalize' })}{' '} + {t('group:group.invites', { postProcess: 'capitalizeFirst' })}{' '} {groupsWithJoinRequests?.length > 0 && ` (${groupsWithJoinRequests?.length})`} @@ -131,7 +131,7 @@ export const GroupInvites = ({ myAddress, setOpenAddGroup }) => { }} > {t('group:message.generic.no_display', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} @@ -181,7 +181,7 @@ export const GroupInvites = ({ myAddress, setOpenAddGroup }) => { }} primary={t('group:message.generic.group_invited_you', { group: group?.groupName, - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} /> diff --git a/src/components/Group/GroupJoinRequests.tsx b/src/components/Group/GroupJoinRequests.tsx index 15304f5..0991edb 100644 --- a/src/components/Group/GroupJoinRequests.tsx +++ b/src/components/Group/GroupJoinRequests.tsx @@ -144,7 +144,7 @@ export const GroupJoinRequests = ({ fontSize: '1rem', }} > - {t('group:join_requests', { postProcess: 'capitalize' })}{' '} + {t('group:join_requests', { postProcess: 'capitalizeFirst' })}{' '} {filteredJoinRequests?.filter((group) => group?.data?.length > 0) ?.length > 0 && ` (${filteredJoinRequests?.filter((group) => group?.data?.length > 0)?.length})`} @@ -207,7 +207,7 @@ export const GroupJoinRequests = ({ }} > {t('group:message.generic.no_display', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', })} diff --git a/src/components/Group/HomeDesktop.tsx b/src/components/Group/HomeDesktop.tsx index 83f8828..c270df0 100644 --- a/src/components/Group/HomeDesktop.tsx +++ b/src/components/Group/HomeDesktop.tsx @@ -85,7 +85,7 @@ export const HomeDesktop = ({ padding: '10px', }} > - {t('core:welcome', { postProcess: 'capitalize' })} + {t('core:welcome', { postProcess: 'capitalizeFirst' })} {userInfo?.name ? ( - {t('tutorial:initial.explore', { postProcess: 'capitalize' })} + {t('tutorial:initial.explore', { + postProcess: 'capitalizeFirst', + })} {' '} diff --git a/src/components/Group/InviteMember.tsx b/src/components/Group/InviteMember.tsx index 24ff960..94414ba 100644 --- a/src/components/Group/InviteMember.tsx +++ b/src/components/Group/InviteMember.tsx @@ -19,7 +19,7 @@ export const InviteMember = ({ groupId, setInfoSnack, setOpenSnack, show }) => { await show({ message: t('group:question.perform_transaction', { action: 'GROUP_INVITE', - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), publishFee: fee.fee + ' QORT', }); @@ -40,7 +40,7 @@ export const InviteMember = ({ groupId, setInfoSnack, setOpenSnack, show }) => { type: 'success', message: t('group:message.success.group_invite', { value: value, - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), }); setOpenSnack(true); @@ -61,7 +61,7 @@ export const InviteMember = ({ groupId, setInfoSnack, setOpenSnack, show }) => { message: error?.message || t('core:message.error.generic', { - postProcess: 'capitalize', + postProcess: 'capitalizeFirst', }), }); setOpenSnack(true); @@ -86,7 +86,7 @@ export const InviteMember = ({ groupId, setInfoSnack, setOpenSnack, show }) => { flexDirection: 'column', }} > - {t('group:action.invite_member', { postProcess: 'capitalize' })} + {t('group:action.invite_member', { postProcess: 'capitalizeFirst' })} @@ -99,14 +99,14 @@ export const InviteMember = ({ groupId, setInfoSnack, setOpenSnack, show }) => { setDomain(e.target.value)} /> + - + setPort(e.target.value)} /> @@ -474,15 +517,20 @@ export const AppsDevModeHome = ({ + diff --git a/src/components/Apps/AppsDevModeNavBar.tsx b/src/components/Apps/AppsDevModeNavBar.tsx index 5a632cd..e011ded 100644 --- a/src/components/Apps/AppsDevModeNavBar.tsx +++ b/src/components/Apps/AppsDevModeNavBar.tsx @@ -23,7 +23,6 @@ export const AppsDevModeNavBar = () => { const [navigationController, setNavigationController] = useAtom( navigationControllerAtom ); - const theme = useTheme(); const [isNewTabWindow, setIsNewTabWindow] = useState(false); const tabsRef = useRef(null); diff --git a/src/components/Apps/AppsHomeDesktop.tsx b/src/components/Apps/AppsHomeDesktop.tsx index 21d9d7d..b2c67cf 100644 --- a/src/components/Apps/AppsHomeDesktop.tsx +++ b/src/components/Apps/AppsHomeDesktop.tsx @@ -16,6 +16,7 @@ import ArrowOutwardIcon from '@mui/icons-material/ArrowOutward'; import { AppsPrivate } from './AppsPrivate'; import ThemeSelector from '../Theme/ThemeSelector'; import LanguageSelector from '../Language/LanguageSelector'; +import { useTranslation } from 'react-i18next'; export const AppsHomeDesktop = ({ setMode, @@ -26,6 +27,7 @@ export const AppsHomeDesktop = ({ }) => { const [qortalUrl, setQortalUrl] = useState(''); const theme = useTheme(); + const { t } = useTranslation(['core', 'group']); const openQortalUrl = () => { try { @@ -41,6 +43,7 @@ export const AppsHomeDesktop = ({ console.log(error); } }; + return ( <> - Apps Dashboard + {t('core:apps_dashboard', { postProcess: 'capitalizeFirst' })} @@ -66,14 +69,14 @@ export const AppsHomeDesktop = ({ > - Library + + {t('core:library', { postProcess: 'capitalizeFirst' })} + diff --git a/src/components/Apps/AppsLibraryDesktop.tsx b/src/components/Apps/AppsLibraryDesktop.tsx index 64f1007..ebe0ddd 100644 --- a/src/components/Apps/AppsLibraryDesktop.tsx +++ b/src/components/Apps/AppsLibraryDesktop.tsx @@ -41,6 +41,7 @@ import { Virtuoso } from 'react-virtuoso'; import { executeEvent } from '../../utils/events'; import { ComposeP, ShowMessageReturnButton } from '../Group/Forum/Mail-styles'; import { ReturnIcon } from '../../assets/Icons/ReturnIcon.tsx'; +import { useTranslation } from 'react-i18next'; const officialAppList = [ 'q-tube', @@ -104,6 +105,7 @@ export const AppsLibraryDesktop = ({ const [searchValue, setSearchValue] = useState(''); const virtuosoRef = useRef(null); const theme = useTheme(); + const { t } = useTranslation(['core', 'group']); const officialApps = useMemo(() => { return availableQapps.filter( @@ -210,9 +212,13 @@ export const AppsLibraryDesktop = ({ ml: 1, paddingLeft: '12px', }} - placeholder="Search for apps" + placeholder={t('core:action.search_apps', { + postProcess: 'capitalizeFirst', + })} inputProps={{ - 'aria-label': 'Search for apps', + 'aria-label': t('core:action.search_apps', { + postProcess: 'capitalizeFirst', + }), fontSize: '16px', fontWeight: 400, }} @@ -273,10 +279,14 @@ export const AppsLibraryDesktop = ({ }} onClick={() => { executeEvent('navigateBack', {}); - }} // TODO translate + }} > - Return to Apps Dashboard + + {t('core:action.return_apps_dashboard', { + postProcess: 'capitalizeFirst', + })} + @@ -302,7 +312,11 @@ export const AppsLibraryDesktop = ({ ) : searchedList?.length === 0 && debouncedValue ? ( - No results + + {t('core:message.generic.no_results', { + postProcess: 'capitalizeFirst', + })} + ) : ( <> @@ -311,7 +325,7 @@ export const AppsLibraryDesktop = ({ fontSize: '30px', }} > - Official Apps + {t('core:apps_official', { postProcess: 'capitalizeFirst' })} @@ -396,7 +410,13 @@ export const AppsLibraryDesktop = ({ textAlign: 'start', }} > - {hasPublishApp ? 'Update your app' : 'Publish your app'} + {hasPublishApp + ? t('core:action.update_app', { + postProcess: 'capitalizeFirst', + }) + : t('core:action.publish_app', { + postProcess: 'capitalizeFirst', + })} @@ -422,7 +442,13 @@ export const AppsLibraryDesktop = ({ }} > - {hasPublishApp ? 'Update' : 'Publish'} + {hasPublishApp + ? t('core:action.update', { + postProcess: 'capitalizeFirst', + }) + : t('core:action.publish', { + postProcess: 'capitalizeFirst', + })} @@ -441,7 +467,9 @@ export const AppsLibraryDesktop = ({ fontSize: '30px', }} > - Categories + {t('core:category_other', { + postProcess: 'capitalizeFirst', + })} @@ -480,7 +508,7 @@ export const AppsLibraryDesktop = ({ }, }} > - All + {t('core:all', { postProcess: 'capitalizeFirst' })} diff --git a/src/components/Apps/AppsNavBarDesktop.tsx b/src/components/Apps/AppsNavBarDesktop.tsx index 8d45604..f294834 100644 --- a/src/components/Apps/AppsNavBarDesktop.tsx +++ b/src/components/Apps/AppsNavBarDesktop.tsx @@ -32,6 +32,7 @@ import { sortablePinnedAppsAtom, } from '../../atoms/global'; import { useAtom, useSetAtom } from 'jotai'; +import { useTranslation } from 'react-i18next'; export function saveToLocalStorage(key, subKey, newValue) { try { @@ -75,7 +76,7 @@ export const AppsNavBarDesktop = ({ disableBack }) => { ); const theme = useTheme(); - + const { t } = useTranslation(['core', 'group']); const [isNewTabWindow, setIsNewTabWindow] = useState(false); const tabsRef = useRef(null); const [anchorEl, setAnchorEl] = useState(null); @@ -238,6 +239,7 @@ export const AppsNavBarDesktop = ({ disableBack }) => { }} /> + { if (!selectedTab) return; @@ -274,9 +276,9 @@ export const AppsNavBarDesktop = ({ disableBack }) => { paper: { sx: { backgroundColor: theme.palette.background.default, + borderRadius: '5px', color: theme.palette.text.primary, width: '148px', - borderRadius: '5px', }, }, }} @@ -375,9 +377,18 @@ export const AppsNavBarDesktop = ({ disableBack }) => { : theme.palette.text.primary, }, }} - primary={`${isSelectedAppPinned ? 'Unpin app' : 'Pin app'}`} + primary={`${ + isSelectedAppPinned + ? t('core:action.unpin_app', { + postProcess: 'capitalizeFirst', + }) + : t('core:action.pin_app', { + postProcess: 'capitalizeFirst', + }) + }}`} /> + { if (selectedTab?.refreshFunc) { @@ -404,6 +415,7 @@ export const AppsNavBarDesktop = ({ disableBack }) => { }} /> + { color: theme.palette.text.primary, }, }} - primary="Copy link" + primary={t('core:action.copy_link', { + postProcess: 'capitalizeFirst', + })} /> )} diff --git a/src/components/Apps/AppsPrivate.tsx b/src/components/Apps/AppsPrivate.tsx index cddbc12..fb0a4dd 100644 --- a/src/components/Apps/AppsPrivate.tsx +++ b/src/components/Apps/AppsPrivate.tsx @@ -36,6 +36,7 @@ import { fileToBase64 } from '../../utils/fileReading'; import { objectToBase64 } from '../../qdn/encryption/group-encryption'; import { getFee } from '../../background'; import { useAtom } from 'jotai'; +import { useTranslation } from 'react-i18next'; const maxFileSize = 50 * 1024 * 1024; // 50MB @@ -62,6 +63,7 @@ export const AppsPrivate = ({ myName }) => { const [memberGroups] = useAtom(memberGroupsAtom); const theme = useTheme(); + const { t } = useTranslation(['core', 'group']); const myGroupsPrivate = useMemo(() => { return memberGroups?.filter( @@ -98,9 +100,11 @@ export const AppsPrivate = ({ myName }) => { errors.forEach((error) => { if (error.code === 'file-too-large') { console.error( - `File ${file.name} is too large. Max size allowed is ${ - maxFileSize / (1024 * 1024) - } MB.` + t('core:message.error.file_too_large', { + filename: file.name, + size: maxFileSize / (1024 * 1024), + postProcess: 'capitalizeFirst', + }) ); } }); @@ -111,7 +115,6 @@ export const AppsPrivate = ({ myName }) => { const addPrivateApp = async () => { try { if (privateAppValues?.groupId === 0) return; - await openApp(privateAppValues, true); } catch (error) { console.error(error); @@ -139,9 +142,28 @@ export const AppsPrivate = ({ myName }) => { const publishPrivateApp = async () => { try { if (selectedGroup === 0) return; - if (!logo) throw new Error('Please select an image for a logo'); - if (!myName) throw new Error('You need a Qortal name to publish'); - if (!newPrivateAppValues?.name) throw new Error('Your app needs a name'); + + if (!logo) + throw new Error( + t('core:message.generic.select_image', { + postProcess: 'capitalizeFirst', + }) + ); + + if (!myName) + throw new Error( + t('core:message.generic.name_publish', { + postProcess: 'capitalizeFirst', + }) + ); + + if (!newPrivateAppValues?.name) + throw new Error( + t('core:message.error.app_need_name', { + postProcess: 'capitalizeFirst', + }) + ); + const base64Logo = await fileToBase64(logo); const base64App = await fileToBase64(file); const objectToSave = { @@ -160,16 +182,22 @@ export const AppsPrivate = ({ myName }) => { if (decryptedData?.error) { throw new Error( - decryptedData?.error || 'Unable to encrypt app. App not published' + decryptedData?.error || + t('core:message.error.unable_encrypt_app', { + postProcess: 'capitalizeFirst', + }) ); } const fee = await getFee('ARBITRARY'); await show({ - message: 'Would you like to publish this app?', + message: t('core:save_options.publish_app', { + postProcess: 'capitalizeFirst', + }), publishFee: fee.fee + ' QORT', }); + await new Promise((res, rej) => { window .sendMessage('publishOnQDN', { @@ -185,7 +213,12 @@ export const AppsPrivate = ({ myName }) => { rej(response.error); }) .catch((error) => { - rej(error.message || 'An error occurred'); + rej( + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirst', + }) + ); }); }); @@ -203,7 +236,11 @@ export const AppsPrivate = ({ myName }) => { setOpenSnackGlobal(true); setInfoSnackCustom({ type: 'error', - message: error?.message || 'Unable to publish app', + message: + error?.message || + t('core:message.error.unable_publish_app', { + postProcess: 'capitalizeFirst', + }), }); } }; @@ -241,6 +278,7 @@ export const AppsPrivate = ({ myName }) => { Private + {isOpenPrivateModal && ( { display: 'flex', flexDirection: 'column', gap: '5px', - }} // TODO translate + }} > - - + + + + + { marginTop: '15px', }} > - + { } /> + { marginTop: '15px', }} > - + + setPrivateAppValues((prev) => { @@ -397,7 +458,7 @@ export const AppsPrivate = ({ myName }) => { setIsOpenPrivateModal(false); }} > - Close + {t('core:action.close', { postProcess: 'capitalizeFirst' })} @@ -424,7 +485,9 @@ export const AppsPrivate = ({ myName }) => { fontSize: '14px', }} > - Select .zip file containing static content:{' '} + {t('core:message.generic.select_zip', { + postProcess: 'capitalizeFirst', + })} @@ -435,10 +498,11 @@ export const AppsPrivate = ({ myName }) => { fontSize: '14px', }} >{` - 50mb MB maximum`} + 50mb MB max`} {file && ( <> + {`Selected: (${file?.name})`} )} @@ -454,7 +518,13 @@ export const AppsPrivate = ({ myName }) => { > {' '} - {file ? 'Change' : 'Choose'} File + {file + ? t('core:action.change_file', { + postProcess: 'capitalizeFirst', + }) + : t('core:action.choose_file', { + postProcess: 'capitalizeFirst', + })} @@ -466,10 +536,18 @@ export const AppsPrivate = ({ myName }) => { gap: '5px', }} > - + + + setNewPrivateAppValues((prev) => { @@ -525,9 +611,14 @@ export const AppsPrivate = ({ myName }) => { marginTop: '15px', }} > - + + setNewPrivateAppValues((prev) => { @@ -543,10 +634,15 @@ export const AppsPrivate = ({ myName }) => { setLogo(file)}> - + {logo?.name} + @@ -558,7 +654,7 @@ export const AppsPrivate = ({ myName }) => { clearFields(); }} > - Close + {t('core:action.close', { postProcess: 'capitalizeFirst' })} diff --git a/src/i18n/locales/en/auth.json b/src/i18n/locales/en/auth.json index 8a514fa..d212416 100644 --- a/src/i18n/locales/en/auth.json +++ b/src/i18n/locales/en/auth.json @@ -37,7 +37,6 @@ "your_accounts": "your saved accounts" } }, - "name": "name", "node": { "choose": "choose custom node", "custom_many": "custom nodes", diff --git a/src/i18n/locales/en/core.json b/src/i18n/locales/en/core.json index 90f00b6..e78df4c 100644 --- a/src/i18n/locales/en/core.json +++ b/src/i18n/locales/en/core.json @@ -1,20 +1,26 @@ { "action": { "add": "add", + "add_custom_framework": "add custom framework", "accept": "accept", + "access": "access", "backup_account": "backup account", "backup_wallet": "backup wallet", "cancel": "cancel", "cancel_invitation": "cancel invitation", "change": "change", + "change_file": "change file", "change_language": "change language", "choose": "choose", + "choose_file": "choose file", "close": "close", "continue": "continue", "continue_logout": "continue to logout", + "copy_link": "copy link", "create_apps": "create apps", "create_file": "create file", "create_thread": "create thread", + "choose_logo": "choose a logo", "choose_name": "choose a name", "decline": "decline", "decrypt": "decrypt", @@ -34,30 +40,44 @@ "notify": "notify", "open": "open", "pin": "pin", + "pin_app": "pin app", "pin_from_dashboard": "pin from dashboard", "post": "post", "post_message": "post message", "publish": "publish", + "publish_app": "publish your app", "register_name": "register name", "remove": "remove", + "return_apps_dashboard": "return to Apps Dashboard", "save": "save", + "search_apps": "search for apps", "select_app_type": "select App Type", "select_category": "select Category", "select_name_app": "select Name/App", "start_minting": "start minting", "unpin": "unpin", - "unpin_from_dashboard": "unpin from dashboard" + "unpin_app": "unpin app", + "unpin_from_dashboard": "unpin from dashboard", + "update": "update", + "update_app": "update your app" }, "admin": "admin", + "all": "all", + "api": "API", "app": "app", + "app_name": "app name", "app_service_type": "app service type", + "apps_dashboard": "apps Dashboard", + "apps_official": "official Apps", "category": "category", + "category_other": "categories", "core": { "block_height": "block height", "information": "core information", "peers": "connected peers", "version": "core version" }, + "domain": "domain", "ui": { "version": "UI version" }, @@ -66,14 +86,18 @@ "one": "one" }, "description": "description", + "devmode_apps": "dev Mode Apps", + "directory": "directory", "downloading_qdn": "downloading from QDN", "fee": { "payment": "payment fee", "publish": "publish fee" }, "general_settings": "general settings", + "identifier": "identifier", "last_height": "last height", "level": "level", + "library": "library", "list": { "invite": "invite list", "join_request": "join request list", @@ -85,31 +109,41 @@ "message": { "error": { "address_not_found": "your address was not found", + "app_need_name": "your app needs a name", "file_too_large": "file {{ filename }} is too large. Max size allowed is {{ size }} MB.", "generic": "an error occurred", "incorrect_password": "incorrect password", + "invalid_zip": "invalid zip", "minting_account_add": "unable to add minting account", "minting_account_remove": "unable to remove minting account", "missing_fields": "missing: {{ fields }}", "publish_app": "unable to publish app", "rating_option": "cannot find rating option", "save_qdn": "unable to save to QDN", + "unable_encrypt_app": "unable to encrypt app. App not published'", + "unable_publish_app": "unable to publish app", "unable_rate": "unable to rate" }, "generic": { + "devmode_local_node": "please use your local node for dev mode! Logout and use Local node.", "name_available": "{{ name }} is available", "name_benefits": "benefits of a name", "name_checking": "checking if name already exists", + "name_preview": "you need a name to use preview", + "name_publish": "you need a Qortal name to publish", "name_rate": "you need a name to rate.", "name_registration": "your balance is {{ balance }} QORT. A name registration requires a {{ fee }} QORT fee", "name_unavailable": "{{ name }} is unavailable", "no_description": "no description", "no_notifications": "no new notifications", + "no_results": "no results", "one_app_per_name": "note: Currently, only one App and Website is allowed per Name.", "publish_data": "publish data to Qortal: anything from apps to videos. Fully decentralized!", "publishing": "publishing... Please wait.", "rating": "rating for {{ service }} {{ name }}", "secure_ownership": "secure ownership of data published by your name. You can even sell your name, along with your data to a third party.", + "select_file": "please select a file", + "select_image": "please select an image for a logo", "select_zip": "select .zip file containing static content:" }, "question": { @@ -131,6 +165,7 @@ } }, "minting_status": "minting status", + "name": "name", "name_app": "name/App", "none": "none", "page": { @@ -140,10 +175,12 @@ "previous": "previous" }, "payment_notification": "payment notification", + "port": "port", "price": "price", "q_apps": { "about": "about this Q-App", - "q_mail": "q-mail" + "q_mail": "q-mail", + "q_sandbox": "q-Sandbox" }, "save_options": { "no_pinned_changes": "you currently do not have any changes to your pinned apps", @@ -162,6 +199,7 @@ "settings": "you are using the export/import way of saving settings.", "unsaved_changes": " you have unsaved changes to your pinned apps. Save them to QDN." }, + "server": "server", "settings": "settings", "supply": "supply", "tags": "tags", @@ -180,6 +218,7 @@ "title": "title", "tutorial": "tutorial", "user_lookup": "user lookup", + "zip": "zip", "wallet": { "wallet": "wallet", "wallet_other": "wallets" diff --git a/src/i18n/locales/en/group.json b/src/i18n/locales/en/group.json index 7a8cc23..009ab97 100644 --- a/src/i18n/locales/en/group.json +++ b/src/i18n/locales/en/group.json @@ -78,6 +78,7 @@ "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.", + "only_private_groups": "only private groups will be shown", "private_key_copied": "private key copied", "provide_message": "please provide a first message to the thread", "secure_place": "keep your private key in a secure place. Do not share!", From 7df70b21653fde95f42a511e82b1720e36104ab2 Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Fri, 16 May 2025 09:13:44 +0200 Subject: [PATCH 8/9] Translate app --- src/components/Apps/AppViewer.tsx | 14 ++++++++++---- src/components/Apps/AppViewerContainer.tsx | 5 ++--- src/i18n/locales/en/core.json | 1 + 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/components/Apps/AppViewer.tsx b/src/components/Apps/AppViewer.tsx index 87f88e8..640d062 100644 --- a/src/components/Apps/AppViewer.tsx +++ b/src/components/Apps/AppViewer.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useMemo, useState } from 'react'; +import { forwardRef, useEffect, useMemo, useState } from 'react'; import { Box } from '@mui/material'; import { getBaseApiReact } from '../../App'; import { subscribeToEvent, unsubscribeFromEvent } from '../../utils/events'; @@ -7,7 +7,7 @@ import { useQortalMessageListener } from './useQortalMessageListener'; import { useThemeContext } from '../Theme/ThemeContext'; import { useTranslation } from 'react-i18next'; -export const AppViewer = React.forwardRef( +export const AppViewer = forwardRef( ({ app, hide, isDevMode, skipAuth }, iframeRef) => { // const iframeRef = useRef(null); const { window: frameWindow } = useFrame(); @@ -23,7 +23,7 @@ export const AppViewer = React.forwardRef( ); const [url, setUrl] = useState(''); const { themeMode } = useThemeContext(); - const { i18n } = useTranslation(['core']); + const { i18n, t } = useTranslation(['core']); const currentLang = i18n.language; useEffect(() => { @@ -184,7 +184,13 @@ export const AppViewer = React.forwardRef( // Timeout after 200ms if no response setTimeout(() => { window.removeEventListener('message', handleNavigationSuccess); - reject(new Error('Navigation timeout')); + reject( + new Error( + t('core:message.error.navigation_timeout', { + postProcess: 'capitalizeFirst', + }) + ) + ); }, 200); const targetOrigin = iframeRef.current ? new URL(iframeRef.current.src).origin diff --git a/src/components/Apps/AppViewerContainer.tsx b/src/components/Apps/AppViewerContainer.tsx index b159aa7..38c017b 100644 --- a/src/components/Apps/AppViewerContainer.tsx +++ b/src/components/Apps/AppViewerContainer.tsx @@ -1,9 +1,8 @@ -import React, { useContext } from 'react'; +import { forwardRef } from 'react'; import { AppViewer } from './AppViewer'; import Frame from 'react-frame-component'; -import { MyContext } from '../../App'; -const AppViewerContainer = React.forwardRef( +const AppViewerContainer = forwardRef( ({ app, isSelected, hide, isDevMode, customHeight, skipAuth }, ref) => { return ( Date: Fri, 16 May 2025 09:23:23 +0200 Subject: [PATCH 9/9] Refactor json structure and move some from group into core --- src/components/Apps/AppPublish.tsx | 2 +- src/components/Apps/AppRating.tsx | 2 +- src/components/Apps/AppsPrivate.tsx | 2 +- src/components/Chat/GroupAnnouncements.tsx | 2 +- src/components/GlobalActions/JoinGroup.tsx | 2 +- src/components/Group/AddGroup.tsx | 2 +- src/components/Group/AddGroupList.tsx | 2 +- src/components/Group/Forum/NewThread.tsx | 4 ++-- src/components/Group/InviteMember.tsx | 2 +- src/components/Group/ListOfBans.tsx | 2 +- .../Group/ListOfGroupPromotions.tsx | 2 +- src/components/Group/ListOfInvites.tsx | 2 +- src/components/Group/ListOfJoinRequests.tsx | 2 +- src/components/Group/ListOfMembers.tsx | 8 +++---- src/components/Group/ManageMembers.tsx | 2 +- src/components/Group/UserListOfInvites.tsx | 2 +- src/components/Minting/Minting.tsx | 2 +- src/components/RegisterName.tsx | 2 +- src/components/Save/Save.tsx | 6 +++--- src/i18n/locales/en/core.json | 21 ++++++++++++------- src/i18n/locales/en/group.json | 5 ----- 21 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/components/Apps/AppPublish.tsx b/src/components/Apps/AppPublish.tsx index 6ab1525..c63cee8 100644 --- a/src/components/Apps/AppPublish.tsx +++ b/src/components/Apps/AppPublish.tsx @@ -178,7 +178,7 @@ export const AppPublish = ({ names, categories }) => { const fee = await getFee('ARBITRARY'); await show({ - message: t('core:save_options.publish_app', { + message: t('core:question.publish_app', { postProcess: 'capitalizeFirst', }), publishFee: fee.fee + ' QORT', diff --git a/src/components/Apps/AppRating.tsx b/src/components/Apps/AppRating.tsx index 34bdee0..8ae7e99 100644 --- a/src/components/Apps/AppRating.tsx +++ b/src/components/Apps/AppRating.tsx @@ -113,7 +113,7 @@ export const AppRating = ({ app, myName, ratingCountPosition = 'right' }) => { const fee = await getFee('CREATE_POLL'); await show({ - message: t('core:message.error.generic', { + message: t('core:question.rate_app', { rate: newValue, postProcess: 'capitalizeFirst', }), diff --git a/src/components/Apps/AppsPrivate.tsx b/src/components/Apps/AppsPrivate.tsx index fb0a4dd..d3af274 100644 --- a/src/components/Apps/AppsPrivate.tsx +++ b/src/components/Apps/AppsPrivate.tsx @@ -192,7 +192,7 @@ export const AppsPrivate = ({ myName }) => { const fee = await getFee('ARBITRARY'); await show({ - message: t('core:save_options.publish_app', { + message: t('core:question.publish_app', { postProcess: 'capitalizeFirst', }), publishFee: fee.fee + ' QORT', diff --git a/src/components/Chat/GroupAnnouncements.tsx b/src/components/Chat/GroupAnnouncements.tsx index af92b71..abb4860 100644 --- a/src/components/Chat/GroupAnnouncements.tsx +++ b/src/components/Chat/GroupAnnouncements.tsx @@ -289,7 +289,7 @@ export const GroupAnnouncements = ({ const fee = await getFee('ARBITRARY'); await show({ - message: t('group:question.perform_transaction', { + message: t('core:question.perform_transaction', { action: 'ARBITRARY', postProcess: 'capitalizeFirst', }), diff --git a/src/components/GlobalActions/JoinGroup.tsx b/src/components/GlobalActions/JoinGroup.tsx index a6ec98f..fc77d85 100644 --- a/src/components/GlobalActions/JoinGroup.tsx +++ b/src/components/GlobalActions/JoinGroup.tsx @@ -70,7 +70,7 @@ export const JoinGroup = () => { const fee = await getFee('JOIN_GROUP'); await show({ - message: t('group:question.perform_transaction', { + message: t('core:question.perform_transaction', { action: 'JOIN_GROUP', postProcess: 'capitalizeFirst', }), diff --git a/src/components/Group/AddGroup.tsx b/src/components/Group/AddGroup.tsx index b1da7e5..24ac2da 100644 --- a/src/components/Group/AddGroup.tsx +++ b/src/components/Group/AddGroup.tsx @@ -118,7 +118,7 @@ export const AddGroup = ({ address, open, setOpen }) => { const fee = await getFee('CREATE_GROUP'); await show({ - message: t('group:question.perform_transaction', { + message: t('core:question.perform_transaction', { action: 'CREATE_GROUP', postProcess: 'capitalizeFirst', }), diff --git a/src/components/Group/AddGroupList.tsx b/src/components/Group/AddGroupList.tsx index 5c577f1..06113a4 100644 --- a/src/components/Group/AddGroupList.tsx +++ b/src/components/Group/AddGroupList.tsx @@ -113,7 +113,7 @@ export const AddGroupList = ({ setInfoSnack, setOpenSnack }) => { const fee = await getFee('JOIN_GROUP'); await show({ - message: t('group:question.perform_transaction', { + message: t('core:question.perform_transaction', { action: 'JOIN_GROUP', postProcess: 'capitalizeFirst', }), diff --git a/src/components/Group/Forum/NewThread.tsx b/src/components/Group/Forum/NewThread.tsx index 4a561f5..802f4a4 100644 --- a/src/components/Group/Forum/NewThread.tsx +++ b/src/components/Group/Forum/NewThread.tsx @@ -182,7 +182,7 @@ export const NewThread = ({ const missingFields: string[] = []; if (!isMessage && !threadTitle) { - errorMsg = t('group:question.provide_thread', { + errorMsg = t('core:question.provide_thread', { postProcess: 'capitalizeFirst', }); } @@ -229,7 +229,7 @@ export const NewThread = ({ feeToShow = +feeToShow * 2; } await show({ - message: t('group:question.perform_transaction', { + message: t('core:question.perform_transaction', { action: 'ARBITRARY', postProcess: 'capitalizeFirst', }), diff --git a/src/components/Group/InviteMember.tsx b/src/components/Group/InviteMember.tsx index 94414ba..8d7bcf2 100644 --- a/src/components/Group/InviteMember.tsx +++ b/src/components/Group/InviteMember.tsx @@ -17,7 +17,7 @@ export const InviteMember = ({ groupId, setInfoSnack, setOpenSnack, show }) => { const fee = await getFee('GROUP_INVITE'); await show({ - message: t('group:question.perform_transaction', { + message: t('core:question.perform_transaction', { action: 'GROUP_INVITE', postProcess: 'capitalizeFirst', }), diff --git a/src/components/Group/ListOfBans.tsx b/src/components/Group/ListOfBans.tsx index 596744d..650c418 100644 --- a/src/components/Group/ListOfBans.tsx +++ b/src/components/Group/ListOfBans.tsx @@ -88,7 +88,7 @@ export const ListOfBans = ({ groupId, setInfoSnack, setOpenSnack, show }) => { try { const fee = await getFee('CANCEL_GROUP_BAN'); await show({ - message: t('group:question.perform_transaction', { + message: t('core:question.perform_transaction', { action: 'CANCEL_GROUP_BAN', postProcess: 'capitalizeFirst', }), diff --git a/src/components/Group/ListOfGroupPromotions.tsx b/src/components/Group/ListOfGroupPromotions.tsx index ab92df4..4e4be16 100644 --- a/src/components/Group/ListOfGroupPromotions.tsx +++ b/src/components/Group/ListOfGroupPromotions.tsx @@ -276,7 +276,7 @@ export const ListOfGroupPromotions = () => { const groupId = group.groupId; const fee = await getFee('JOIN_GROUP'); await show({ - message: t('group:question.perform_transaction', { + message: t('core:question.perform_transaction', { action: 'JOIN_GROUP', postProcess: 'capitalizeFirst', }), diff --git a/src/components/Group/ListOfInvites.tsx b/src/components/Group/ListOfInvites.tsx index 64927a8..fc63464 100644 --- a/src/components/Group/ListOfInvites.tsx +++ b/src/components/Group/ListOfInvites.tsx @@ -94,7 +94,7 @@ export const ListOfInvites = ({ const fee = await getFee('CANCEL_GROUP_INVITE'); await show({ - message: t('group:question.perform_transaction', { + message: t('core:question.perform_transaction', { action: 'CANCEL_GROUP_INVITE', postProcess: 'capitalizeFirst', }), diff --git a/src/components/Group/ListOfJoinRequests.tsx b/src/components/Group/ListOfJoinRequests.tsx index 85b3642..6d9c38a 100644 --- a/src/components/Group/ListOfJoinRequests.tsx +++ b/src/components/Group/ListOfJoinRequests.tsx @@ -97,7 +97,7 @@ export const ListOfJoinRequests = ({ const fee = await getFee('GROUP_INVITE'); await show({ - message: t('group:question.perform_transaction', { + message: t('core:question.perform_transaction', { action: 'GROUP_INVITE', postProcess: 'capitalizeFirst', }), diff --git a/src/components/Group/ListOfMembers.tsx b/src/components/Group/ListOfMembers.tsx index b605758..bfdc11f 100644 --- a/src/components/Group/ListOfMembers.tsx +++ b/src/components/Group/ListOfMembers.tsx @@ -59,7 +59,7 @@ const ListOfMembers = ({ try { const fee = await getFee('GROUP_KICK'); await show({ - message: t('group:question.perform_transaction', { + message: t('core:question.perform_transaction', { action: 'GROUP_KICK', postProcess: 'capitalizeFirst', }), @@ -117,7 +117,7 @@ const ListOfMembers = ({ const fee = await getFee('GROUP_BAN'); await show({ - message: t('group:question.perform_transaction', { + message: t('core:question.perform_transaction', { action: 'GROUP_BAN', postProcess: 'capitalizeFirst', }), @@ -177,7 +177,7 @@ const ListOfMembers = ({ try { const fee = await getFee('ADD_GROUP_ADMIN'); await show({ - message: t('group:question.perform_transaction', { + message: t('core:question.perform_transaction', { action: 'ADD_GROUP_ADMIN', postProcess: 'capitalizeFirst', }), @@ -234,7 +234,7 @@ const ListOfMembers = ({ try { const fee = await getFee('REMOVE_GROUP_ADMIN'); await show({ - message: t('group:question.perform_transaction', { + message: t('core:question.perform_transaction', { action: 'REMOVE_GROUP_ADMIN', postProcess: 'capitalizeFirst', }), diff --git a/src/components/Group/ManageMembers.tsx b/src/components/Group/ManageMembers.tsx index db2444a..d996184 100644 --- a/src/components/Group/ManageMembers.tsx +++ b/src/components/Group/ManageMembers.tsx @@ -84,7 +84,7 @@ export const ManageMembers = ({ setIsLoadingLeave(true); const fee = await getFee('LEAVE_GROUP'); await show({ - message: t('group:question.perform_transaction', { + message: t('core:question.perform_transaction', { action: 'LEAVE_GROUP', postProcess: 'capitalizeFirst', }), diff --git a/src/components/Group/UserListOfInvites.tsx b/src/components/Group/UserListOfInvites.tsx index 38bc29d..fd22d58 100644 --- a/src/components/Group/UserListOfInvites.tsx +++ b/src/components/Group/UserListOfInvites.tsx @@ -99,7 +99,7 @@ export const UserListOfInvites = ({ const fee = await getFee('JOIN_GROUP'); await show({ - message: t('group:question.perform_transaction', { + message: t('core:question.perform_transaction', { action: 'JOIN_GROUP', postProcess: 'capitalizeFirst', }), diff --git a/src/components/Minting/Minting.tsx b/src/components/Minting/Minting.tsx index 0924656..9bffeb7 100644 --- a/src/components/Minting/Minting.tsx +++ b/src/components/Minting/Minting.tsx @@ -301,7 +301,7 @@ export const Minting = ({ setIsOpenMinting, myAddress, show }) => { const createRewardShare = useCallback(async (publicKey, recipient) => { const fee = await getFee('REWARD_SHARE'); await show({ - message: t('group:question.perform_transaction', { + message: t('core:question.perform_transaction', { // TODO move from group into core namespace action: 'REWARD_SHARE', postProcess: 'capitalizeFirst', diff --git a/src/components/RegisterName.tsx b/src/components/RegisterName.tsx index c50f66a..85f4390 100644 --- a/src/components/RegisterName.tsx +++ b/src/components/RegisterName.tsx @@ -127,7 +127,7 @@ export const RegisterName = ({ const fee = await getFee('REGISTER_NAME'); await show({ - message: t('group:question.register_name', { + message: t('core:question.register_name', { postProcess: 'capitalizeFirst', }), publishFee: fee.fee + ' QORT', diff --git a/src/components/Save/Save.tsx b/src/components/Save/Save.tsx index a75baeb..70faac8 100644 --- a/src/components/Save/Save.tsx +++ b/src/components/Save/Save.tsx @@ -424,7 +424,7 @@ export const Save = ({ isDesktop, disableWidth, myName }) => { fontSize: '14px', }} > - {t('core:save_options.reset_qdn', { + {t('core:question.reset_qdn', { postProcess: 'capitalizeFirst', })} @@ -461,7 +461,7 @@ export const Save = ({ isDesktop, disableWidth, myName }) => { }} > {' '} - {t('core:save_options.reset_pinned', { + {t('core:question.reset_pinned', { postProcess: 'capitalizeFirst', })} @@ -495,7 +495,7 @@ export const Save = ({ isDesktop, disableWidth, myName }) => { fontSize: '14px', }} > - {t('core:save_options.overwrite_changes', { + {t('core:question.overwrite_changes', { postProcess: 'capitalizeFirst', })} diff --git a/src/i18n/locales/en/core.json b/src/i18n/locales/en/core.json index 2bb7f90..424c8d0 100644 --- a/src/i18n/locales/en/core.json +++ b/src/i18n/locales/en/core.json @@ -183,22 +183,27 @@ "q_mail": "q-mail", "q_sandbox": "q-Sandbox" }, - "save_options": { - "no_pinned_changes": "you currently do not have any changes to your pinned apps", - "overwrite_changes": "the app was unable to download your existing QDN-saved pinned apps. Would you like to overwrite those changes?", - "overwrite_qdn": "overwrite to QDN", + "question": { + "perform_transaction": "would you like to perform a {{action}} transaction?", + "provide_thread": "please provide a thread title", "publish_app": "would you like to publish this app?", "publish_qdn": "would you like to publish your settings to QDN (encrypted)?", - "qdn": "use QDN saving", + "overwrite_changes": "the app was unable to download your existing QDN-saved pinned apps. Would you like to overwrite those changes?", "rate_app": "would you like to rate this app a rating of {{ rate }}?. It will create a POLL tx.", - "register_name": "you need a registered Qortal name to save your pinned apps to QDN.", + "register_name": "would you like to register this name?", "reset_pinned": "don't like your current local changes? Would you like to reset to the default pinned apps?", - "reset_qdn": "don't like your current local changes? Would you like to reset to your saved QDN pinned apps?", + "reset_qdn": "don't like your current local changes? Would you like to reset to your saved QDN pinned apps?" + }, + "save_options": { + "no_pinned_changes": "you currently do not have any changes to your pinned apps", + "overwrite_qdn": "overwrite to QDN", + "qdn": "use QDN saving", + "register_name": "you need a registered Qortal name to save your pinned apps to QDN.", "revert_default": "revert to default", "revert_qdn": "revert to QDN", "save_qdn": "save to QDN", "settings": "you are using the export/import way of saving settings.", - "unsaved_changes": " you have unsaved changes to your pinned apps. Save them to QDN." + "unsaved_changes": "you have unsaved changes to your pinned apps. Save them to QDN." }, "server": "server", "settings": "settings", diff --git a/src/i18n/locales/en/group.json b/src/i18n/locales/en/group.json index 009ab97..21cb914 100644 --- a/src/i18n/locales/en/group.json +++ b/src/i18n/locales/en/group.json @@ -133,10 +133,5 @@ "user_joined": "user successfully joined!" } }, - "question": { - "perform_transaction": "would you like to perform a {{action}} transaction?", - "provide_thread": "please provide a thread title", - "register_name": "would you like to register this name?" - }, "thread_posts": "new thread posts" }