Add translation to group

This commit is contained in:
Nicola Benaglia 2025-04-24 21:45:42 +02:00
parent b0f0ec57a9
commit 230cc25a3b
6 changed files with 22 additions and 16 deletions

View File

@ -15,8 +15,7 @@
"export": "export", "export": "export",
"import": "import", "import": "import",
"logout": "logout", "logout": "logout",
"refetch_page": "refetch page", "refetch_page": "refetch page"
"return_to_thread": "return to threads"
}, },
"core": { "core": {
"block_height": "block height", "block_height": "block height",

View File

@ -1,12 +1,17 @@
{ {
"action": {
"return_to_thread": "return to threads"
},
"group_invites": "group invites",
"provide_thread": "please provide a thread title", "provide_thread": "please provide a thread title",
"result": { "result": {
"cannot": { "cannot": {
"access_name": "Cannot send a message without a access to your name", "access_name": "Cannot send a message without a access to your name",
"group_info": "Cannot access group information" "group_info": "Cannot access group information"
} },
"loading_threads": "loading threads... please wait."
}, },
"": "",
"": "", "": "",
"": "", "": "",
"": "", "": "",

View File

@ -121,7 +121,9 @@ export const GroupMail = ({
}); });
setTempPublishedList(tempData); setTempPublishedList(tempData);
} }
} catch (error) {} } catch (error) {
console.log(error);
}
}; };
const getEncryptedResource = async ( const getEncryptedResource = async (

View File

@ -608,7 +608,7 @@ export const Thread = ({
> >
<MailIconImg src={ReturnSVG} /> <MailIconImg src={ReturnSVG} />
<ComposeP> <ComposeP>
{t('core:action.return_to_thread', { postProcess: 'capitalize' })} {t('group:action.return_to_thread', { postProcess: 'capitalize' })}
</ComposeP> </ComposeP>
</ShowMessageReturnButton> </ShowMessageReturnButton>
{/* Conditionally render the scroll buttons */} {/* Conditionally render the scroll buttons */}

View File

@ -55,8 +55,6 @@ import { RequestQueueWithPromise } from '../../utils/queue/queue';
import { WebSocketActive } from './WebsocketActive'; import { WebSocketActive } from './WebsocketActive';
import { useMessageQueue } from '../../MessageQueueContext'; import { useMessageQueue } from '../../MessageQueueContext';
import { ContextMenu } from '../ContextMenu'; import { ContextMenu } from '../ContextMenu';
import { ReturnIcon } from '../../assets/Icons/ReturnIcon';
import { ExitIcon } from '../../assets/Icons/ExitIcon';
import { HomeDesktop } from './HomeDesktop'; import { HomeDesktop } from './HomeDesktop';
import { IconWrapper } from '../Desktop/DesktopFooter'; import { IconWrapper } from '../Desktop/DesktopFooter';
import { DesktopHeader } from '../Desktop/DesktopHeader'; import { DesktopHeader } from '../Desktop/DesktopHeader';
@ -80,6 +78,7 @@ import LockIcon from '@mui/icons-material/Lock';
import NoEncryptionGmailerrorredIcon from '@mui/icons-material/NoEncryptionGmailerrorred'; import NoEncryptionGmailerrorredIcon from '@mui/icons-material/NoEncryptionGmailerrorred';
import { BlockedUsersModal } from './BlockedUsersModal'; import { BlockedUsersModal } from './BlockedUsersModal';
import { WalletsAppWrapper } from './WalletsAppWrapper'; import { WalletsAppWrapper } from './WalletsAppWrapper';
import { useTranslation } from 'react-i18next';
export const getPublishesFromAdmins = async (admins: string[], groupId) => { export const getPublishesFromAdmins = async (admins: string[], groupId) => {
const queryString = admins.map((name) => `name=${name}`).join('&'); const queryString = admins.map((name) => `name=${name}`).join('&');
@ -450,6 +449,7 @@ export const Group = ({
const [isOpenSideViewGroups, setIsOpenSideViewGroups] = useState(false); const [isOpenSideViewGroups, setIsOpenSideViewGroups] = useState(false);
const [isForceShowCreationKeyPopup, setIsForceShowCreationKeyPopup] = const [isForceShowCreationKeyPopup, setIsForceShowCreationKeyPopup] =
useState(false); useState(false);
const { t } = useTranslation(['core', 'group']);
const [groupsProperties, setGroupsProperties] = const [groupsProperties, setGroupsProperties] =
useRecoilState(groupsPropertiesAtom); useRecoilState(groupsPropertiesAtom);

View File

@ -1,4 +1,4 @@
import * as React from 'react'; import { useEffect, useState } from 'react';
import List from '@mui/material/List'; import List from '@mui/material/List';
import ListItem from '@mui/material/ListItem'; import ListItem from '@mui/material/ListItem';
import ListItemButton from '@mui/material/ListItemButton'; import ListItemButton from '@mui/material/ListItemButton';
@ -12,14 +12,13 @@ import { CustomLoader } from '../../common/CustomLoader';
import { getBaseApiReact } from '../../App'; import { getBaseApiReact } from '../../App';
import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
import ExpandLessIcon from '@mui/icons-material/ExpandLess'; import ExpandLessIcon from '@mui/icons-material/ExpandLess';
import { useTranslation } from 'react-i18next';
export const GroupInvites = ({ myAddress, setOpenAddGroup }) => { export const GroupInvites = ({ myAddress, setOpenAddGroup }) => {
const [groupsWithJoinRequests, setGroupsWithJoinRequests] = React.useState( const [groupsWithJoinRequests, setGroupsWithJoinRequests] = useState([]);
[] const [isExpanded, setIsExpanded] = useState(false);
);
const [isExpanded, setIsExpanded] = React.useState(false);
const [loading, setLoading] = React.useState(true); const [loading, setLoading] = useState(true);
const getJoinRequests = async () => { const getJoinRequests = async () => {
try { try {
@ -38,9 +37,10 @@ export const GroupInvites = ({ myAddress, setOpenAddGroup }) => {
} }
}; };
const { t } = useTranslation(['core', 'group']);
const theme = useTheme(); const theme = useTheme();
React.useEffect(() => { useEffect(() => {
if (myAddress) { if (myAddress) {
getJoinRequests(); getJoinRequests();
} }
@ -71,7 +71,7 @@ export const GroupInvites = ({ myAddress, setOpenAddGroup }) => {
fontSize: '1rem', fontSize: '1rem',
}} // TODO translate }} // TODO translate
> >
Group Invites{' '} {t('group:group_invites', { postProcess: 'capitalize' })}{' '}
{groupsWithJoinRequests?.length > 0 && {groupsWithJoinRequests?.length > 0 &&
` (${groupsWithJoinRequests?.length})`} ` (${groupsWithJoinRequests?.length})`}
</Typography> </Typography>