mirror of
https://github.com/Myzel394/kleckrelay-website.git
synced 2025-06-18 23:45:26 +02:00
refactor: Improve i18n for admin updating reserved aliases
This commit is contained in:
parent
b600d56e95
commit
038c157100
@ -1,5 +1,6 @@
|
||||
{
|
||||
"title": "Reserved Aliases",
|
||||
"detailsTitle": "Reserved Alias Details",
|
||||
"pageActions": {
|
||||
"search": {
|
||||
"placeholder": "Search for aliases"
|
||||
@ -8,6 +9,11 @@
|
||||
"actions": {
|
||||
"create": {
|
||||
"label": "Create new Reserved Alias"
|
||||
},
|
||||
"delete": {
|
||||
"label": "Delete Reserved Alias",
|
||||
"description": "Are you sure you want to delete this reserved alias?",
|
||||
"continueActionLabel": "Delete Reserved Alias"
|
||||
}
|
||||
},
|
||||
"userAmount_one": "Forwards to one user",
|
||||
@ -16,19 +22,19 @@
|
||||
"title": "Create your first reserved alias",
|
||||
"description": "Reserved aliases are aliases that will be forwarded to selected admin users. This is useful if you want to create aliases that are meant to be public, like contact@example.com or hello@example.com."
|
||||
},
|
||||
"fields": {
|
||||
"active": {
|
||||
"label": "Active"
|
||||
},
|
||||
"users": {
|
||||
"label": "Users",
|
||||
"me": "{{email}} (Me)"
|
||||
}
|
||||
},
|
||||
"createNew": {
|
||||
"title": "Reserved Aliases",
|
||||
"description": "Define what alias should forward to whom.",
|
||||
"continueActionLabel": "Create Reserved Alias",
|
||||
"fields": {
|
||||
"active": {
|
||||
"label": "Active"
|
||||
},
|
||||
"users": {
|
||||
"label": "Users",
|
||||
"me": "{{email}} (Me)"
|
||||
}
|
||||
},
|
||||
"explanation": {
|
||||
"step1": "User from outside",
|
||||
"step2": "Sends mail to",
|
||||
|
@ -61,7 +61,8 @@
|
||||
"unavailableValue": "Unavailable",
|
||||
"experimentalFeatureExplanation": "This is an experimental feature.",
|
||||
"saveLabel": "Save",
|
||||
"resetLabel": "Reset"
|
||||
"resetLabel": "Reset",
|
||||
"loading": "Loading..."
|
||||
},
|
||||
"noSearchResults": {
|
||||
"title": "Nothing found",
|
||||
|
@ -124,103 +124,6 @@
|
||||
}
|
||||
},
|
||||
"AdminRoute": {
|
||||
"title": "Site configuration",
|
||||
"routes": {
|
||||
"reservedAliases": "Reserved Aliases",
|
||||
"settings": "Global Settings"
|
||||
},
|
||||
"forms": {
|
||||
"reservedAliases": {
|
||||
"title": "Reserved Aliases",
|
||||
"description": "Define what alias should forward to whom.",
|
||||
"saveAction": "Create Alias",
|
||||
"fields": {
|
||||
"local": {
|
||||
"label": "Local"
|
||||
},
|
||||
"users": {
|
||||
"label": "Users",
|
||||
"me": "{{email}} (Me)"
|
||||
}
|
||||
},
|
||||
"explanation": {
|
||||
"step1": "User from outside",
|
||||
"step2": "Sends mail to",
|
||||
"step4": "KleckRelay forwards to"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"randomEmailIdMinLength": {
|
||||
"label": "Minimum random alias ID length",
|
||||
"description": "The minimum length for randomly generated emails. The server will automatically increase the length if required so."
|
||||
},
|
||||
"randomEmailIdChars": {
|
||||
"label": "Random alias character pool",
|
||||
"description": "Characters that are used to generate random emails."
|
||||
},
|
||||
"randomEmailLengthIncreaseOnPercentage": {
|
||||
"label": "Percentage of used aliases",
|
||||
"description": "If the percentage of used random email IDs is higher than this value, the length of the random email ID will be increased. This is used to prevent spammers from guessing the email ID."
|
||||
},
|
||||
"customEmailSuffixLength": {
|
||||
"label": "Custom email suffix length",
|
||||
"description": "The length of the custom email suffix."
|
||||
},
|
||||
"customEmailSuffixChars": {
|
||||
"label": "Custom email suffix character pool",
|
||||
"description": "Characters that are used to generate custom email suffixes."
|
||||
},
|
||||
"imageProxyStorageLifeTimeInHours": {
|
||||
"label": "Image proxy storage lifetime",
|
||||
"description": "The lifetime of images that are stored on the server in hours. After this time, the image will be deleted.",
|
||||
"unit_one": "hour",
|
||||
"unit_other": "hours"
|
||||
},
|
||||
"enableImageProxy": {
|
||||
"label": "Enable image proxy",
|
||||
"description": "If enabled, images will be proxied through the server. This enhances your user's privacy as their ip address will not be leaked."
|
||||
},
|
||||
"enableImageProxyStorage": {
|
||||
"label": "Enable image proxy storage",
|
||||
"description": "If enabled, images will be stored on the server and forwarded to the user. This makes email tracking nearly impossible as every message will be marked as read instantly, which is obviously not true as a user is typically not able to view an email in just a few seconds after it has been sent. This will only affect new images."
|
||||
},
|
||||
"userEmailEnableDisposableEmails": {
|
||||
"label": "Enable disposable emails for new accounts",
|
||||
"description": "If enabled, users will be able to use disposable emails when creating a new account. This will only affect new accounts."
|
||||
},
|
||||
"userEmailEnableOtherRelays": {
|
||||
"label": "Enable other relays for new accounts",
|
||||
"description": "If enabled, users will be able to use other relays (such as SimpleLogin or DuckDuckGo's Email Tracking Protection) when creating a new account. This will only affect new accounts."
|
||||
},
|
||||
"allowStatistics": {
|
||||
"label": "Allow statistics",
|
||||
"description": "If enabled, your instance will collect anonymous statistics and share them. They will only be stored locally on this instance but made public."
|
||||
},
|
||||
"allowAliasDeletion": {
|
||||
"label": "Allow alias deletion",
|
||||
"description": "If enabled, users will be able to delete their aliases."
|
||||
},
|
||||
"maxAliasesPerUser": {
|
||||
"label": "Maximum aliases per user",
|
||||
"description": "The maximum number of aliases a user can create. 0 means unlimited. Existing aliases will not be affected."
|
||||
}
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"title": "Global Settings",
|
||||
"description": "Configure global settings for your instance.",
|
||||
"successMessage": "Settings have been saved successfully!",
|
||||
"randomAliasesPreview": {
|
||||
"title": "Random aliases will look like this",
|
||||
"helperText": "This is just a preview. Those are not real aliases."
|
||||
},
|
||||
"randomAliasesIncreaseExplanation": "Random aliases' length will be increased from {{originalLength}} to {{increasedLength}} characters after {{amount}} aliases have been created.",
|
||||
"resetLabel": "Reset to defaults",
|
||||
"disabled": {
|
||||
"title": "Global settings are disabled",
|
||||
"description": "Global settings have been disabled. You can enable them in the configuration file."
|
||||
}
|
||||
},
|
||||
"reservedAlias": {
|
||||
"actions": {
|
||||
"delete": {
|
||||
|
@ -49,7 +49,7 @@ export default function UsersSelectField({
|
||||
return (
|
||||
<FormControl sx={{minWidth: 180}}>
|
||||
<InputLabel id="users-select" error={error}>
|
||||
{t("createNew.fields.users.label")}
|
||||
{t("fields.users.label")}
|
||||
</InputLabel>
|
||||
<Select<string[]>
|
||||
{...props}
|
||||
@ -98,7 +98,7 @@ export default function UsersSelectField({
|
||||
name="users"
|
||||
id="users"
|
||||
error={error}
|
||||
label={t("createNew.fields.users.label")}
|
||||
label={t("fields.users.label")}
|
||||
>
|
||||
{users ? (
|
||||
users.map(user => (
|
||||
@ -108,7 +108,7 @@ export default function UsersSelectField({
|
||||
primary={(() => {
|
||||
// Check if user is me
|
||||
if (user.id === meUser.id) {
|
||||
return t("createNew.fields.users.me", {
|
||||
return t("fields.users.me", {
|
||||
email: user.email.address,
|
||||
})
|
||||
}
|
||||
@ -119,7 +119,7 @@ export default function UsersSelectField({
|
||||
</MenuItem>
|
||||
))
|
||||
) : (
|
||||
<MenuItem value={""}>{t("general.loading")}</MenuItem>
|
||||
<MenuItem value={""}>{t("general.loading", {ns: "common"})}</MenuItem>
|
||||
)}
|
||||
</Select>
|
||||
{helperText ? <FormHelperText error={error}>{helperText}</FormHelperText> : null}
|
||||
|
@ -22,7 +22,7 @@ export default function AliasActivationSwitch({
|
||||
isActive,
|
||||
queryKey,
|
||||
}: AliasActivationSwitch): ReactElement {
|
||||
const {t} = useTranslation()
|
||||
const {t} = useTranslation("common")
|
||||
const {showError, showSuccess} = useErrorSuccessSnacks()
|
||||
const {isLoading, mutateAsync} = useMutation<
|
||||
ReservedAlias,
|
||||
@ -76,8 +76,8 @@ export default function AliasActivationSwitch({
|
||||
|
||||
showSuccess(
|
||||
isActive
|
||||
? t("relations.alias.mutations.success.aliasChangedToDisabled")
|
||||
: t("relations.alias.mutations.success.aliasChangedToEnabled"),
|
||||
? t("messages.alias.changedToDisabled")
|
||||
: t("messages.alias.changedToEnabled"),
|
||||
)
|
||||
} catch {}
|
||||
}}
|
||||
|
@ -40,7 +40,7 @@ interface Form {
|
||||
}
|
||||
|
||||
export default function AliasUsersList({users, queryKey, id}: AliasUsersListProps): ReactElement {
|
||||
const {t} = useTranslation()
|
||||
const {t} = useTranslation(["admin-reserved-aliases", "common"])
|
||||
const {showError, showSuccess} = useErrorSuccessSnacks()
|
||||
const {mutateAsync} = useMutation<
|
||||
ReservedAlias,
|
||||
@ -73,7 +73,7 @@ export default function AliasUsersList({users, queryKey, id}: AliasUsersListProp
|
||||
}
|
||||
},
|
||||
onSuccess: async newAlias => {
|
||||
showSuccess(t("relations.alias.mutations.success.aliasUpdated"))
|
||||
showSuccess(t("messages.alias.updated", {ns: "common"}))
|
||||
|
||||
await queryClient.cancelQueries(queryKey)
|
||||
|
||||
@ -102,7 +102,7 @@ export default function AliasUsersList({users, queryKey, id}: AliasUsersListProp
|
||||
}),
|
||||
}),
|
||||
)
|
||||
.label(t("routes.AliasDetailRoute.sections.users.fields.users.label")),
|
||||
.label(t("fields.users.label")),
|
||||
})
|
||||
const initialValues: Form = {
|
||||
users: users,
|
||||
@ -126,7 +126,7 @@ export default function AliasUsersList({users, queryKey, id}: AliasUsersListProp
|
||||
<Grid container spacing={1} direction="row">
|
||||
<Grid item>
|
||||
<Typography variant="h6" component="h3">
|
||||
{t("routes.ReservedAliasDetailRoute.sections.users.title")}
|
||||
{t("fields.users.label")}
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
|
@ -14,7 +14,7 @@ import AliasAddress from "~/route-widgets/AliasDetailRoute/AliasAddress"
|
||||
import AliasUsersList from "~/route-widgets/ReservedAliasDetailRoute/AliasUsersList"
|
||||
|
||||
export default function ReservedAliasDetailRoute(): ReactElement {
|
||||
const {t} = useTranslation()
|
||||
const {t} = useTranslation(["admin-reserved-aliases", "common"])
|
||||
const params = useParams()
|
||||
const queryKey = ["get_reserved_alias", params.id!]
|
||||
|
||||
@ -22,20 +22,16 @@ export default function ReservedAliasDetailRoute(): ReactElement {
|
||||
|
||||
return (
|
||||
<SimplePage
|
||||
title={t("routes.ReservedAliasDetailRoute.title")}
|
||||
title={t("detailsTitle")}
|
||||
actions={
|
||||
query.data && (
|
||||
<DeleteButton
|
||||
onDelete={() => deleteReservedAlias(params.id!)}
|
||||
label={t("routes.AdminRoute.reservedAlias.actions.delete.label")}
|
||||
description={t(
|
||||
"routes.adminRoute.reservedAlias.actions.delete.description",
|
||||
)}
|
||||
continueLabel={t(
|
||||
"routes.AdminRoute.reservedAlias.actions.delete.continueAction",
|
||||
)}
|
||||
label={t("actions.delete.label")}
|
||||
description={t("actions.delete.description")}
|
||||
continueLabel={t("actions.delete.continueActionLabel")}
|
||||
navigateTo="/admin/reserved-aliases"
|
||||
successMessage={t("relations.alias.mutations.success.aliasDeleted")}
|
||||
successMessage={t("messages.alias.deleted", {ns: "common"})}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user