Update all useTranslation references with all namespaces

This commit is contained in:
Nicola Benaglia
2025-05-18 19:14:03 +02:00
parent 42cc8ad247
commit 10bbf420c3
46 changed files with 102 additions and 66 deletions

View File

@@ -37,7 +37,7 @@ export const AppInfo = ({ app, myName }) => {
);
const theme = useTheme();
const { t } = useTranslation(['core', 'auth', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const isSelectedAppPinned = !!sortablePinnedApps?.find(
(item) => item?.name === app?.name && item?.service === app?.service

View File

@@ -42,7 +42,7 @@ export const AppInfoSnippet = ({
);
const theme = useTheme();
const { t } = useTranslation(['core', 'auth', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
return (
<AppInfoSnippetContainer

View File

@@ -67,7 +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 { t } = useTranslation(['auth', 'core', 'group']);
const [tag1, setTag1] = useState('');
const [tag2, setTag2] = useState('');
const [tag3, setTag3] = useState('');

View File

@@ -20,7 +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 { t } = useTranslation(['auth', 'core', 'group']);
const getRating = useCallback(async (name, service) => {
try {

View File

@@ -50,7 +50,7 @@ export const AppsDesktop = ({
const [isEnabledDevMode, setIsEnabledDevMode] = useAtom(enabledDevModeAtom);
const { showTutorial } = useContext(MyContext);
const theme = useTheme();
const { t } = useTranslation(['core', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const myApp = useMemo(() => {
return availableQapps.find(
@@ -381,7 +381,12 @@ export const AppsDesktop = ({
setDesktopViewMode('apps');
}}
>
<IconWrapper label="Apps" disableWidth>
<IconWrapper
label={t('core:app_other', {
postProcess: 'capitalizeFirst',
})}
disableWidth
>
<AppsIcon height={30} color={theme.palette.text.primary} />
</IconWrapper>
</ButtonBase>
@@ -399,7 +404,9 @@ export const AppsDesktop = ({
? theme.palette.text.primary
: theme.palette.text.secondary
}
label="Chat"
label={t('core:chat', {
postProcess: 'capitalizeFirst',
})}
disableWidth
>
<MessagingIconFilled
@@ -428,7 +435,9 @@ export const AppsDesktop = ({
? theme.palette.text.primary
: theme.palette.text.secondary
}
label="Dev"
label={t('core:dev', {
postProcess: 'capitalizeFirst',
})}
disableWidth
>
<AppsIcon

View File

@@ -17,6 +17,7 @@ import { AppsIcon } from '../../assets/Icons/AppsIcon';
import { IconWrapper } from '../Desktop/DesktopFooter';
import { CoreSyncStatus } from '../CoreSyncStatus';
import { MessagingIconFilled } from '../../assets/Icons/MessagingIconFilled';
import { useTranslation } from 'react-i18next';
const uid = new ShortUniqueId({ length: 8 });
@@ -46,6 +47,7 @@ export const AppsDevMode = ({
const [categories, setCategories] = useState([]);
const iframeRefs = useRef({});
const theme = useTheme();
const { t } = useTranslation(['auth', 'core', 'group']);
useEffect(() => {
setTimeout(() => {
@@ -108,7 +110,6 @@ export const AppsDevMode = ({
setTabs((prev) => [...prev, newTab]);
setSelectedTab(newTab);
setMode('viewer');
setIsNewTabWindow(false);
};
@@ -215,25 +216,25 @@ export const AppsDevMode = ({
<AppsParent
sx={{
flexDirection: 'row',
position: !show && 'fixed',
left: !show && '-200vw',
position: !show && 'fixed',
}}
>
<Box
sx={{
width: '60px',
flexDirection: 'column',
height: '100vh',
alignItems: 'center',
display: 'flex',
flexDirection: 'column',
gap: '25px',
height: '100vh',
width: '60px',
}}
>
<ButtonBase
sx={{
width: '70px',
height: '70px',
paddingTop: '23px',
width: '70px',
}}
>
<CoreSyncStatus />
@@ -241,8 +242,8 @@ export const AppsDevMode = ({
<ButtonBase
sx={{
width: '60px',
height: '60px',
width: '60px',
}}
onClick={() => {
goToHome();
@@ -267,7 +268,9 @@ export const AppsDevMode = ({
color={
isApps ? theme.palette.text.primary : theme.palette.text.secondary
}
label="Apps"
label={t('core:app_other', {
postProcess: 'capitalizeFirst',
})}
disableWidth
>
<AppsIcon
@@ -294,7 +297,9 @@ export const AppsDevMode = ({
? theme.palette.text.primary
: theme.palette.text.secondary
}
label="Chat"
label={t('core:chat', {
postProcess: 'capitalizeFirst',
})}
disableWidth
>
<MessagingIconFilled
@@ -323,7 +328,9 @@ export const AppsDevMode = ({
? theme.palette.text.primary
: theme.palette.text.secondary
}
label="Dev"
label={t('core:dev', {
postProcess: 'capitalizeFirst',
})}
disableWidth
>
<AppsIcon
@@ -336,6 +343,7 @@ export const AppsDevMode = ({
/>
</IconWrapper>
</ButtonBase>
{mode !== 'home' && <AppsDevModeNavBar />}
</Box>
@@ -382,10 +390,10 @@ export const AppsDevMode = ({
<Box
sx={{
display: 'flex',
width: '100%',
flexDirection: 'column',
height: '100vh',
overflow: 'auto',
width: '100%',
}}
>
<Spacer height="30px" />

View File

@@ -41,7 +41,7 @@ export const AppsDevModeHome = ({
const [domain, setDomain] = useState('127.0.0.1');
const [port, setPort] = useState('');
const [selectedPreviewFile, setSelectedPreviewFile] = useState(null);
const { t } = useTranslation(['core', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const { isShow, onCancel, onOk, show, message } = useModal();
const {
openSnackGlobal,

View File

@@ -27,7 +27,7 @@ export const AppsHomeDesktop = ({
}) => {
const [qortalUrl, setQortalUrl] = useState('');
const theme = useTheme();
const { t } = useTranslation(['core', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const openQortalUrl = () => {
try {

View File

@@ -105,7 +105,7 @@ export const AppsLibraryDesktop = ({
const [searchValue, setSearchValue] = useState('');
const virtuosoRef = useRef(null);
const theme = useTheme();
const { t } = useTranslation(['core', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const officialApps = useMemo(() => {
return availableQapps.filter(

View File

@@ -76,7 +76,7 @@ export const AppsNavBarDesktop = ({ disableBack }) => {
);
const theme = useTheme();
const { t } = useTranslation(['core', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const [isNewTabWindow, setIsNewTabWindow] = useState(false);
const tabsRef = useRef(null);
const [anchorEl, setAnchorEl] = useState(null);

View File

@@ -63,7 +63,7 @@ export const AppsPrivate = ({ myName }) => {
const [memberGroups] = useAtom(memberGroupsAtom);
const theme = useTheme();
const { t } = useTranslation(['core', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const myGroupsPrivate = useMemo(() => {
return memberGroups?.filter(
@@ -321,7 +321,9 @@ export const AppsPrivate = ({ myName }) => {
}}
>
<Tab
label="Access app"
label={t('core:action.access_app', {
postProcess: 'capitalizeFirst',
})}
{...a11yProps(0)}
sx={{
'&.Mui-selected': {
@@ -331,7 +333,9 @@ export const AppsPrivate = ({ myName }) => {
}}
/>
<Tab
label="Publish app"
label={t('core:action.publish_app', {
postProcess: 'capitalizeFirst',
})}
{...a11yProps(1)}
sx={{
'&.Mui-selected': {
@@ -367,7 +371,9 @@ export const AppsPrivate = ({ myName }) => {
labelId="demo-simple-select-label"
id="demo-simple-select"
value={privateAppValues?.groupId}
label="Groups"
label={t('group:group.group_other', {
postProcess: 'capitalizeFirst',
})}
onChange={(e) => {
setPrivateAppValues((prev) => {
return {
@@ -552,7 +558,9 @@ export const AppsPrivate = ({ myName }) => {
labelId="demo-simple-select-label"
id="demo-simple-select"
value={selectedGroup}
label="Groups where you are an admin"
label={t('group:group.groups_admin', {
postProcess: 'capitalizeFirst',
})}
onChange={(e) => setSelectedGroup(e.target.value)}
>
<MenuItem value={0}>
@@ -560,6 +568,7 @@ export const AppsPrivate = ({ myName }) => {
postProcess: 'capitalizeFirst',
})}
</MenuItem>
{myGroupsWhereIAmAdmin
?.filter((item) => !item?.isOpen)
.map((group) => {

View File

@@ -19,7 +19,7 @@ export const AdminSpace = ({
isOwner,
}) => {
const [isMoved, setIsMoved] = useState(false);
const { t } = useTranslation(['core', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
useEffect(() => {
if (hide) {

View File

@@ -13,7 +13,7 @@ export const CoreSyncStatus = () => {
const [coreInfos, setCoreInfos] = useState({});
const [isUsingGateway, setIsUsingGateway] = useState(false);
const { t } = useTranslation(['auth', 'core']);
const { t } = useTranslation(['auth', 'core', 'group']);
const theme = useTheme();
useEffect(() => {

View File

@@ -9,6 +9,7 @@ import { CoreSyncStatus } from './CoreSyncStatus';
import LanguageSelector from './Language/LanguageSelector';
import { MessagingIconFilled } from '../assets/Icons/MessagingIconFilled';
import { useAtom } from 'jotai';
import { useTranslation } from 'react-i18next';
export const DesktopSideBar = ({
goToHome,
@@ -27,6 +28,7 @@ export const DesktopSideBar = ({
const [isEnabledDevMode, setIsEnabledDevMode] = useAtom(enabledDevModeAtom);
const theme = useTheme();
const { t } = useTranslation(['auth', 'core', 'group']);
return (
<Box
@@ -79,7 +81,7 @@ export const DesktopSideBar = ({
color={
isApps ? theme.palette.text.primary : theme.palette.text.secondary
}
label="Apps"
label={t('core:app_other', { postProcess: 'capitalizeFirst' })}
selected={isApps}
disableWidth
>
@@ -105,7 +107,7 @@ export const DesktopSideBar = ({
? theme.palette.text.primary
: theme.palette.text.secondary
}
label="Chat"
label={t('core:chat', { postProcess: 'capitalizeFirst' })}
disableWidth
>
<MessagingIconFilled
@@ -135,7 +137,7 @@ export const DesktopSideBar = ({
? theme.palette.text.primary
: theme.palette.text.secondary
}
label="Dev"
label={t('core:dev', { postProcess: 'capitalizeFirst' })}
disableWidth
>
<AppsIcon height={30} color={theme.palette.text.secondary} />

View File

@@ -32,7 +32,7 @@ export const GeneralNotifications = ({ address }) => {
setAnchorEl(event.currentTarget);
};
const { t } = useTranslation(['core']);
const { t } = useTranslation(['auth', 'core', 'group']);
const theme = useTheme();
return (

View File

@@ -29,7 +29,7 @@ export const JoinGroup = () => {
const [isLoadingInfo, setIsLoadingInfo] = useState(false);
const [isOpen, setIsOpen] = useState(false);
const theme = useTheme();
const { t } = useTranslation(['core', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const [isLoadingJoinGroup, setIsLoadingJoinGroup] = useState(false);
const handleJoinGroup = async (e) => {

View File

@@ -97,7 +97,7 @@ export const AddGroup = ({ address, open, setOpen }) => {
setMaxBlock(event.target.value as string);
};
const { t } = useTranslation(['core', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const theme = useTheme();
const handleCreateGroup = async () => {

View File

@@ -44,7 +44,7 @@ export const AddGroupList = ({ setInfoSnack, setOpenSnack }) => {
const setTxList = useSetAtom(txListAtom);
const { t } = useTranslation(['core', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const [groups, setGroups] = useState([]);
const [popoverAnchor, setPopoverAnchor] = useState(null); // Track which list item the popover is anchored to
const [openPopoverIndex, setOpenPopoverIndex] = useState(null); // Track which list item has the popover open

View File

@@ -73,7 +73,7 @@ export const GroupMail = ({
const anchorElInstanceFilter = useRef<any>(null);
const [tempPublishedList, setTempPublishedList] = useState([]);
const dataPublishes = useRef({});
const { t } = useTranslation(['core']);
const { t } = useTranslation(['auth', 'core', 'group']);
const theme = useTheme();
const [isLoading, setIsLoading] = useState(false);
const groupIdRef = useRef<any>(null);

View File

@@ -141,7 +141,7 @@ export const NewThread = ({
setPostReply,
isPrivate,
}: NewMessageProps) => {
const { t } = useTranslation(['core', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const { show } = useContext(MyContext);
const [isOpen, setIsOpen] = useState<boolean>(false);
const [value, setValue] = useState('');

View File

@@ -115,7 +115,7 @@ export const Thread = ({
const [isLoading, setIsLoading] = useState(true);
const [postReply, setPostReply] = useState(null);
const [hasLastPage, setHasLastPage] = useState(false);
const { t } = useTranslation(['core']);
const { t } = useTranslation(['auth', 'core', 'group']);
const theme = useTheme();
// Update: Use a new ref for the scrollable container
const threadContainerRef = useRef(null);

View File

@@ -444,7 +444,7 @@ export const Group = ({
const [isForceShowCreationKeyPopup, setIsForceShowCreationKeyPopup] =
useState(false);
const groupsOwnerNamesRef = useRef({});
const { t } = useTranslation(['core', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const [groupsProperties, setGroupsProperties] = useAtom(groupsPropertiesAtom);
const setGroupsOwnerNames = useSetAtom(groupsOwnerNamesAtom);

View File

@@ -37,7 +37,7 @@ export const GroupInvites = ({ myAddress, setOpenAddGroup }) => {
}
};
const { t } = useTranslation(['core', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const theme = useTheme();
useEffect(() => {

View File

@@ -28,7 +28,7 @@ export const GroupJoinRequests = ({
setDesktopViewMode,
}) => {
const [isExpanded, setIsExpanded] = React.useState(false);
const { t } = useTranslation(['core', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const [groupsWithJoinRequests, setGroupsWithJoinRequests] = React.useState(
[]
);

View File

@@ -31,7 +31,7 @@ export const HomeDesktop = ({
const [checked1, setChecked1] = React.useState(false);
const [checked2, setChecked2] = React.useState(false);
const { t } = useTranslation(['core']);
const { t } = useTranslation(['auth', 'core', 'group']);
const theme = useTheme();
React.useEffect(() => {

View File

@@ -10,7 +10,7 @@ export const InviteMember = ({ groupId, setInfoSnack, setOpenSnack, show }) => {
const [value, setValue] = useState('');
const [expiryTime, setExpiryTime] = useState<string>('259200');
const [isLoadingInvite, setIsLoadingInvite] = useState(false);
const { t } = useTranslation(['core', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const inviteMember = async () => {
try {

View File

@@ -56,7 +56,7 @@ export const ListOfBans = ({ groupId, setInfoSnack, setOpenSnack, show }) => {
const [openPopoverIndex, setOpenPopoverIndex] = useState(null); // Track which list item has the popover open
const listRef = useRef(null);
const [isLoadingUnban, setIsLoadingUnban] = useState(false);
const { t } = useTranslation(['core', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const getInvites = async (groupId) => {
try {

View File

@@ -97,7 +97,7 @@ export const ListOfGroupPromotions = () => {
const { show } = useContext(MyContext);
const setTxList = useSetAtom(txListAtom);
const theme = useTheme();
const { t } = useTranslation(['core', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const listRef = useRef(null);
const rowVirtualizer = useVirtualizer({
count: promotions.length,

View File

@@ -60,7 +60,7 @@ export const ListOfInvites = ({
const [popoverAnchor, setPopoverAnchor] = useState(null); // Track which list item the popover is anchored to
const [openPopoverIndex, setOpenPopoverIndex] = useState(null); // Track which list item has the popover open
const [isLoadingCancelInvite, setIsLoadingCancelInvite] = useState(false);
const { t } = useTranslation(['core', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const listRef = useRef(null);
const getInvites = async (groupId) => {

View File

@@ -64,7 +64,7 @@ export const ListOfJoinRequests = ({
const [openPopoverIndex, setOpenPopoverIndex] = useState(null); // Track which list item has the popover open
const listRef = useRef(null);
const [isLoadingAccept, setIsLoadingAccept] = useState(false);
const { t } = useTranslation(['core', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const getInvites = async (groupId) => {
try {

View File

@@ -42,7 +42,7 @@ const ListOfMembers = ({
const [isLoadingMakeAdmin, setIsLoadingMakeAdmin] = useState(false);
const [isLoadingRemoveAdmin, setIsLoadingRemoveAdmin] = useState(false);
const theme = useTheme();
const { t } = useTranslation(['core', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const listRef = useRef(null);
const handlePopoverOpen = (event, index) => {

View File

@@ -14,7 +14,7 @@ import { useTranslation } from 'react-i18next';
export const ListOfThreadPostsWatched = () => {
const [posts, setPosts] = useState([]);
const [loading, setLoading] = useState(true);
const { t } = useTranslation(['core', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const getPosts = async () => {
try {

View File

@@ -71,7 +71,7 @@ export const ManageMembers = ({
setValue(newValue);
};
const theme = useTheme();
const { t } = useTranslation(['core', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const { show } = useContext(MyContext);
const setTxList = useSetAtom(txListAtom);

View File

@@ -54,7 +54,7 @@ export const QMailMessages = ({ userName, userAddress }) => {
const [loading, setLoading] = useState(true);
const theme = useTheme();
const { t } = useTranslation(['core', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const getMails = useCallback(async () => {
try {

View File

@@ -87,7 +87,7 @@ export const Settings = ({ open, setOpen, rawWallet }) => {
const [checked, setChecked] = useState(false);
const [isEnabledDevMode, setIsEnabledDevMode] = useAtom(enabledDevModeAtom);
const theme = useTheme();
const { t } = useTranslation(['core', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const handleChange = (event: ChangeEvent<HTMLInputElement>) => {
setChecked(event.target.checked);
@@ -231,7 +231,7 @@ const ExportPrivateKey = ({ rawWallet }) => {
const [privateKey, setPrivateKey] = useState('');
const [isOpen, setIsOpen] = useState(false);
const { setOpenSnackGlobal, setInfoSnackCustom } = useContext(MyContext);
const { t } = useTranslation(['core', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const exportPrivateKeyFunc = async () => {
try {

View File

@@ -61,7 +61,7 @@ export const UserListOfInvites = ({
const [invites, setInvites] = useState<any[]>([]);
const [isLoading, setIsLoading] = useState(false);
const theme = useTheme();
const { t } = useTranslation(['core', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const [popoverAnchor, setPopoverAnchor] = useState(null); // Track which list item the popover is anchored to
const [openPopoverIndex, setOpenPopoverIndex] = useState(null); // Track which list item has the popover open
const listRef = useRef(null);

View File

@@ -3,7 +3,7 @@ import { Spacer } from '../../common/Spacer';
import { useTranslation } from 'react-i18next';
export const NewUsersCTA = ({ balance }) => {
const { t } = useTranslation(['core']);
const { t } = useTranslation(['auth', 'core', 'group']);
if (balance === undefined || +balance > 0) return null;

View File

@@ -45,7 +45,7 @@ export const Minting = ({ setIsOpenMinting, myAddress, show }) => {
const { show: showKey, message } = useModal();
const { isShow: isShowNext, onOk, show: showNext } = useModal();
const theme = useTheme();
const { t } = useTranslation(['core', 'auth', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const [info, setInfo] = useState(null);
const [names, setNames] = useState({});
const [accountInfos, setAccountInfos] = useState({});

View File

@@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next';
import { useAtom } from 'jotai';
export const QMailStatus = () => {
const { t } = useTranslation(['core']);
const { t } = useTranslation(['auth', 'core', 'group']);
const theme = useTheme();
const [lastEnteredTimestamp, setLastEnteredTimestamp] = useAtom(

View File

@@ -51,7 +51,7 @@ export const RegisterName = ({
);
const [nameFee, setNameFee] = useState(null);
const theme = useTheme();
const { t } = useTranslation(['core', 'auth', 'group']);
const { t } = useTranslation(['auth', 'core', 'group']);
const checkIfNameExisits = async (name) => {
if (!name?.trim()) {
setIsNameAvailable(Availability.NULL);

View File

@@ -84,7 +84,7 @@ export const Save = ({ isDesktop, disableWidth, myName }) => {
const [anchorEl, setAnchorEl] = useState(null);
const { show } = useContext(MyContext);
const theme = useTheme();
const { t } = useTranslation(['core']);
const { t } = useTranslation(['auth', 'core', 'group']);
const hasChanged = useMemo(() => {
const newChanges = {

View File

@@ -5,7 +5,7 @@ import DarkModeIcon from '@mui/icons-material/DarkMode';
import { useTranslation } from 'react-i18next';
const ThemeSelector = () => {
const { t } = useTranslation(['core']);
const { t } = useTranslation(['auth', 'core', 'group']);
const { themeMode, toggleTheme } = useThemeContext();