mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-07-22 20:26:50 +00:00
Add translations
This commit is contained in:
@@ -454,7 +454,9 @@ export const ChatOptions = ({
|
||||
>
|
||||
<Select
|
||||
id="demo-simple-select"
|
||||
label="By member"
|
||||
label={t('core:sort.by_member', {
|
||||
postProcess: 'capitalizeFirst',
|
||||
})}
|
||||
labelId="demo-simple-select-label"
|
||||
onChange={(e) => setSelectedMember(e.target.value)}
|
||||
size="small"
|
||||
|
@@ -8,6 +8,7 @@ import { MembersIcon } from '../../assets/Icons/MembersIcon';
|
||||
import { AdminsIcon } from '../../assets/Icons/AdminsIcon';
|
||||
import LockIcon from '@mui/icons-material/Lock';
|
||||
import NoEncryptionGmailerrorredIcon from '@mui/icons-material/NoEncryptionGmailerrorred';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
const IconWrapper = ({
|
||||
children,
|
||||
@@ -83,6 +84,8 @@ export const DesktopHeader = ({
|
||||
}) => {
|
||||
const [value, setValue] = useState(0);
|
||||
const theme = useTheme();
|
||||
const { t } = useTranslation(['auth', 'core', 'group']);
|
||||
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
@@ -108,6 +111,7 @@ export const DesktopHeader = ({
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
{isPrivate === false && (
|
||||
<NoEncryptionGmailerrorredIcon
|
||||
sx={{
|
||||
@@ -115,6 +119,7 @@ export const DesktopHeader = ({
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
<Typography
|
||||
sx={{
|
||||
fontSize: '16px',
|
||||
@@ -122,7 +127,7 @@ export const DesktopHeader = ({
|
||||
}}
|
||||
>
|
||||
{selectedGroup?.groupId === '0'
|
||||
? 'General'
|
||||
? t('core:general', { postProcess: 'capitalizeFirst' })
|
||||
: selectedGroup?.groupName}
|
||||
</Typography>
|
||||
</Box>
|
||||
@@ -146,7 +151,7 @@ export const DesktopHeader = ({
|
||||
? theme.palette.text.primary
|
||||
: theme.palette.text.secondary
|
||||
}
|
||||
label="ANN"
|
||||
label={t('core:announcement', { postProcess: 'capitalizeFirst' })}
|
||||
selected={isAnnouncement}
|
||||
selectColor={theme.palette.action.selected}
|
||||
customHeight="55px"
|
||||
@@ -174,7 +179,7 @@ export const DesktopHeader = ({
|
||||
color={
|
||||
isChat ? theme.palette.text.primary : theme.palette.text.secondary
|
||||
}
|
||||
label="Chat"
|
||||
label={t('core:chat', { postProcess: 'capitalizeFirst' })}
|
||||
selected={isChat}
|
||||
selectColor={theme.palette.action.selected}
|
||||
customHeight="55px"
|
||||
@@ -204,7 +209,7 @@ export const DesktopHeader = ({
|
||||
? theme.palette.text.primary
|
||||
: theme.palette.text.secondary
|
||||
}
|
||||
label="Threads"
|
||||
label={t('core:thread_other', { postProcess: 'capitalizeFirst' })}
|
||||
selected={isForum}
|
||||
selectColor={theme.palette.action.selected}
|
||||
customHeight="55px"
|
||||
@@ -229,7 +234,7 @@ export const DesktopHeader = ({
|
||||
<IconWrapper
|
||||
color={theme.palette.text.secondary}
|
||||
customHeight="55px"
|
||||
label="Members"
|
||||
label={t('core:member_other', { postProcess: 'capitalizeFirst' })}
|
||||
selected={false}
|
||||
>
|
||||
<MembersIcon
|
||||
@@ -251,7 +256,7 @@ export const DesktopHeader = ({
|
||||
? theme.palette.text.primary
|
||||
: theme.palette.text.secondary
|
||||
}
|
||||
label="Admins"
|
||||
label={t('core:admin_other', { postProcess: 'capitalizeFirst' })}
|
||||
selected={groupSection === 'adminSpace'}
|
||||
customHeight="55px"
|
||||
selectColor={theme.palette.action.selected}
|
||||
|
@@ -107,7 +107,7 @@ export const Embed = ({ embedLink }) => {
|
||||
setType('POLL');
|
||||
if (!parsedData?.name)
|
||||
throw new Error(
|
||||
t('core:message.error.invalid_embed_link_name', {
|
||||
t('core:message.error.invalid_poll_embed_link_name', {
|
||||
postProcess: 'capitalizeFirst',
|
||||
})
|
||||
);
|
||||
@@ -237,9 +237,10 @@ export const Embed = ({ embedLink }) => {
|
||||
if (imageFinalUrl) {
|
||||
return imageFinalUrl;
|
||||
} else {
|
||||
//TODO translate
|
||||
setErrorMsg(
|
||||
'Unable to download IMAGE. Please try again later by clicking the refresh button'
|
||||
t('core:message.error.unable_download_image', {
|
||||
postProcess: 'capitalizeFirst',
|
||||
})
|
||||
);
|
||||
return null;
|
||||
}
|
||||
@@ -248,7 +249,7 @@ export const Embed = ({ embedLink }) => {
|
||||
setErrorMsg(
|
||||
error?.error ||
|
||||
error?.message ||
|
||||
'An unexpected error occurred while trying to download the image'
|
||||
t('core:message.error.generic', { postProcess: 'capitalizeFirst' })
|
||||
);
|
||||
return null;
|
||||
}
|
||||
@@ -259,7 +260,11 @@ export const Embed = ({ embedLink }) => {
|
||||
setIsLoading(true);
|
||||
setErrorMsg('');
|
||||
if (!parsedData?.name || !parsedData?.service || !parsedData?.identifier)
|
||||
throw new Error('Invalid image embed link. Missing param.');
|
||||
throw new Error(
|
||||
t('core:message.error.invalid_image_embed_link_name', {
|
||||
postProcess: 'capitalizeFirst',
|
||||
})
|
||||
);
|
||||
let image = await getImage(
|
||||
{
|
||||
name: parsedData.name,
|
||||
@@ -272,7 +277,12 @@ export const Embed = ({ embedLink }) => {
|
||||
|
||||
setImageUrl(image);
|
||||
} catch (error) {
|
||||
setErrorMsg(error?.message || 'Invalid embed link');
|
||||
setErrorMsg(
|
||||
error?.message ||
|
||||
t('core:message.error.invalid_embed_link', {
|
||||
postProcess: 'capitalizeFirst',
|
||||
})
|
||||
);
|
||||
} finally {
|
||||
setIsLoading(false);
|
||||
}
|
||||
@@ -309,7 +319,12 @@ export const Embed = ({ embedLink }) => {
|
||||
break;
|
||||
}
|
||||
} catch (error) {
|
||||
setErrorMsg(error?.message || 'Invalid embed link');
|
||||
setErrorMsg(
|
||||
error?.message ||
|
||||
t('core:message.error.invalid_embed_link', {
|
||||
postProcess: 'capitalizeFirst',
|
||||
})
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -318,7 +333,12 @@ export const Embed = ({ embedLink }) => {
|
||||
const parsedData = parseQortalLink(embedLink);
|
||||
handleImage(parsedData);
|
||||
} catch (error) {
|
||||
setErrorMsg(error?.message || 'Invalid embed link');
|
||||
setErrorMsg(
|
||||
error?.message ||
|
||||
t('core:message.error.invalid_embed_link', {
|
||||
postProcess: 'capitalizeFirst',
|
||||
})
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -898,7 +898,9 @@ export const ListOfGroupPromotions = () => {
|
||||
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)}
|
||||
variant="outlined"
|
||||
>
|
||||
|
Reference in New Issue
Block a user