From 71475c2e77522cfd01561df313ff3b9df6f367ee Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Tue, 20 May 2025 22:29:35 +0200 Subject: [PATCH] Translate placeholders --- src/Wallets.tsx | 14 +++++++++----- src/components/Apps/AppPublish.tsx | 20 +++++++++++++++----- src/components/Apps/AppsCategoryDesktop.tsx | 6 +++++- src/components/Apps/AppsPrivate.tsx | 4 +++- src/components/Chat/ChatDirect.tsx | 4 +++- src/components/Chat/ChatOptions.tsx | 4 +++- src/components/Group/BlockedUsersModal.tsx | 4 +++- src/components/Group/Forum/NewThread.tsx | 4 +++- src/components/Group/InviteMember.tsx | 4 +++- src/components/NotAuthenticated.tsx | 8 ++++++-- src/components/RegisterName.tsx | 4 +++- src/i18n/locales/en/auth.json | 3 ++- src/i18n/locales/en/core.json | 9 +++++++-- 13 files changed, 65 insertions(+), 23 deletions(-) diff --git a/src/Wallets.tsx b/src/Wallets.tsx index 298cb26..e8a5ae1 100644 --- a/src/Wallets.tsx +++ b/src/Wallets.tsx @@ -362,7 +362,9 @@ export const Wallets = ({ setExtState, setRawWallet, rawWallet }) => { })} setSeedName(e.target.value)} /> @@ -370,12 +372,14 @@ export const Wallets = ({ setExtState, setRawWallet, rawWallet }) => { setSeedValue(e.target.value)} @@ -554,7 +558,7 @@ const WalletItem = ({ wallet, updateWalletItem, idx, setSelectedWallet }) => { })} setName(e.target.value)} sx={{ @@ -570,7 +574,7 @@ const WalletItem = ({ wallet, updateWalletItem, idx, setSelectedWallet }) => { })} setNote(e.target.value)} inputProps={{ diff --git a/src/components/Apps/AppPublish.tsx b/src/components/Apps/AppPublish.tsx index d81bde3..7dfcf3c 100644 --- a/src/components/Apps/AppPublish.tsx +++ b/src/components/Apps/AppPublish.tsx @@ -292,7 +292,9 @@ export const AppPublish = ({ names, categories }) => { setName(event?.target.value)} @@ -323,7 +325,9 @@ export const AppPublish = ({ names, categories }) => { setAppType(event?.target.value)} @@ -339,11 +343,13 @@ export const AppPublish = ({ names, categories }) => { })} + {t('core:app', { postProcess: 'capitalizeFirstChar', })} + {t('core:website', { postProcess: 'capitalizeFirstChar', @@ -370,7 +376,7 @@ export const AppPublish = ({ names, categories }) => { width: '100%', maxWidth: '450px', }} - placeholder="Title" + placeholder={t('core:title', { postProcess: 'capitalizeFirstChar' })} inputProps={{ 'aria-label': 'Title', fontSize: '14px', @@ -397,7 +403,9 @@ export const AppPublish = ({ names, categories }) => { width: '100%', maxWidth: '450px', }} - placeholder="Description" + placeholder={t('core:description', { + postProcess: 'capitalizeFirstChar', + })} inputProps={{ 'aria-label': 'Description', fontSize: '14px', @@ -415,7 +423,9 @@ export const AppPublish = ({ names, categories }) => { setCategory(event?.target.value)} > diff --git a/src/components/Apps/AppsCategoryDesktop.tsx b/src/components/Apps/AppsCategoryDesktop.tsx index 7fc853a..bd52a53 100644 --- a/src/components/Apps/AppsCategoryDesktop.tsx +++ b/src/components/Apps/AppsCategoryDesktop.tsx @@ -15,6 +15,7 @@ import IconClearInput from '../../assets/svgs/ClearInput.svg'; import { Spacer } from '../../common/Spacer'; import { AppInfoSnippet } from './AppInfoSnippet'; import { Virtuoso } from 'react-virtuoso'; +import { useTranslation } from 'react-i18next'; const StyledVirtuosoContainer = styled('div')({ position: 'relative', @@ -44,6 +45,7 @@ export const AppsCategoryDesktop = ({ const [searchValue, setSearchValue] = useState(''); const virtuosoRef = useRef(null); const theme = useTheme(); + const { t } = useTranslation(['auth', 'core', 'group']); const categoryList = useMemo(() => { if (category?.id === 'all') return availableQapps; @@ -139,7 +141,9 @@ export const AppsCategoryDesktop = ({ ml: 1, paddingLeft: '12px', }} - placeholder="Search for apps" + placeholder={t('core:action.search_apps', { + postProcess: 'capitalizeFirstChar', + })} inputProps={{ 'aria-label': 'Search for apps', fontSize: '16px', diff --git a/src/components/Apps/AppsPrivate.tsx b/src/components/Apps/AppsPrivate.tsx index 8a64713..ea3b060 100644 --- a/src/components/Apps/AppsPrivate.tsx +++ b/src/components/Apps/AppsPrivate.tsx @@ -415,7 +415,9 @@ export const AppsPrivate = ({ myName }) => { {t('core:name', { postProcess: 'capitalizeFirstChar' })} setPrivateAppValues((prev) => { diff --git a/src/components/Chat/ChatDirect.tsx b/src/components/Chat/ChatDirect.tsx index 3e57f93..35370ad 100644 --- a/src/components/Chat/ChatDirect.tsx +++ b/src/components/Chat/ChatDirect.tsx @@ -589,7 +589,9 @@ export const ChatDirect = ({ fontSize: '18px', padding: '5px', }} - placeholder="Name or address" + placeholder={t('auth:message.generic.name_address', { + postProcess: 'capitalizeFirstChar', + })} value={directToValue} onChange={(e) => setDirectToValue(e.target.value)} /> diff --git a/src/components/Chat/ChatOptions.tsx b/src/components/Chat/ChatOptions.tsx index de14177..a79a4a2 100644 --- a/src/components/Chat/ChatOptions.tsx +++ b/src/components/Chat/ChatOptions.tsx @@ -422,7 +422,9 @@ export const ChatOptions = ({ value={searchValue} onChange={(e) => setSearchValue(e.target.value)} sx={{ ml: 1, flex: 1 }} - placeholder="Search chat text" + placeholder={t('core:action.search_chat_text', { + postProcess: 'capitalizeFirstChar', + })} inputProps={{ 'aria-label': 'Search for apps', fontSize: '16px', diff --git a/src/components/Group/BlockedUsersModal.tsx b/src/components/Group/BlockedUsersModal.tsx index 5ebd2fc..adc0a10 100644 --- a/src/components/Group/BlockedUsersModal.tsx +++ b/src/components/Group/BlockedUsersModal.tsx @@ -187,7 +187,9 @@ export const BlockedUsersModal = () => { }} > { setValue(e.target.value); diff --git a/src/components/Group/Forum/NewThread.tsx b/src/components/Group/Forum/NewThread.tsx index d41e9f0..763ecb6 100644 --- a/src/components/Group/Forum/NewThread.tsx +++ b/src/components/Group/Forum/NewThread.tsx @@ -476,7 +476,9 @@ export const NewThread = ({ onChange={(e) => { setThreadTitle(e.target.value); }} - placeholder="Thread Title" + placeholder={t('core:thread_title', { + postProcess: 'capitalizeFirstChar', + })} disableUnderline autoComplete="off" autoCorrect="off" diff --git a/src/components/Group/InviteMember.tsx b/src/components/Group/InviteMember.tsx index cc6e431..07ee3a7 100644 --- a/src/components/Group/InviteMember.tsx +++ b/src/components/Group/InviteMember.tsx @@ -92,7 +92,9 @@ export const InviteMember = ({ groupId, setInfoSnack, setOpenSnack, show }) => { setValue(e.target.value)} /> diff --git a/src/components/NotAuthenticated.tsx b/src/components/NotAuthenticated.tsx index f6bf34e..0ee147c 100644 --- a/src/components/NotAuthenticated.tsx +++ b/src/components/NotAuthenticated.tsx @@ -925,14 +925,18 @@ export const NotAuthenticated = ({ }} > { setUrl(e.target.value); }} /> { setCustomApiKey(e.target.value); diff --git a/src/components/RegisterName.tsx b/src/components/RegisterName.tsx index 966cb71..dab0585 100644 --- a/src/components/RegisterName.tsx +++ b/src/components/RegisterName.tsx @@ -235,7 +235,9 @@ export const RegisterName = ({ autoFocus onChange={(e) => setRegisterNameValue(e.target.value)} value={registerNameValue} - placeholder="Choose a name" + placeholder={t('core:action.choose_name', { + postProcess: 'capitalizeFirstChar', + })} /> {(!balance || (nameFee && balance && balance < nameFee)) && ( <> diff --git a/src/i18n/locales/en/auth.json b/src/i18n/locales/en/auth.json index e091927..fb84c57 100644 --- a/src/i18n/locales/en/auth.json +++ b/src/i18n/locales/en/auth.json @@ -69,6 +69,7 @@ "choose_block": "choose 'block txs' or 'all' to block chat messages", "congrats_setup": "congrats, you’re all set up!", "decide_block": "decide what to block", + "name_address": "name or address", "no_account": "no accounts saved", "no_minimum_length": "there is no minimum length requirement", "no_secret_key_published": "no secret key published yet", @@ -96,7 +97,7 @@ "note": "note", "password": "password", "password_confirmation": "confirm password", - "seed": "seed phrase", + "seed_phrase": "seed phrase", "seed_your": "your seedphrase", "tips": { "additional_wallet": "use this option to connect additional Qortal wallets you've already made, in order to login with them afterwards. You will need access to your backup JSON file in order to do so.", diff --git a/src/i18n/locales/en/core.json b/src/i18n/locales/en/core.json index eaae575..8c409ef 100644 --- a/src/i18n/locales/en/core.json +++ b/src/i18n/locales/en/core.json @@ -17,6 +17,8 @@ "choose": "choose", "choose_file": "choose file", "choose_image": "choose image", + "choose_logo": "choose a logo", + "choose_name": "choose a name", "close": "close", "close_chat": "close Direct Chat", "continue": "continue", @@ -25,8 +27,6 @@ "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", "disable_enter": "disable enter", @@ -67,6 +67,7 @@ "save_disk": "save to disk", "search": "search", "search_apps": "search for apps", + "search_chat_text": "search chat text", "select_app_type": "select App Type", "select_category": "select Category", "select_name_app": "select Name/App", @@ -289,6 +290,7 @@ "name_app": "name/App", "new_post_in": "new post in {{ title }}", "none": "none", + "note": "note", "option": "option", "option_other": "options", "page": { @@ -311,6 +313,7 @@ "receiver": "receiver", "sender": "sender", "server": "server", + "service_type": "service type", "settings": "settings", "sort": { "by_member": "by member" @@ -323,6 +326,7 @@ }, "thread": "thread", "thread_other": "threads", + "thread_title": "thread title", "time": { "day_one": "{{count}} day", "day_other": "{{count}} days", @@ -335,6 +339,7 @@ "title": "title", "to": "to", "tutorial": "tutorial", + "url": "url", "user_lookup": "user lookup", "vote": "vote", "vote_other": "{{ count }} votes",