diff --git a/src/web/frontend/messages/en.json b/src/web/frontend/messages/en.json index 6243fbb..c223f94 100644 --- a/src/web/frontend/messages/en.json +++ b/src/web/frontend/messages/en.json @@ -13,5 +13,28 @@ "section_settings_mta": "Mail Transfer Settings", "section_settings_version": "Running:", - "dashboard_n_accounts_active": "Active: {count}" + "dashboard_n_accounts_active": "Active: {count}", + + "clipboard_email": "Email copied to clipboard.", + "account_configuration": "Account Configuration", + "account_actions": "Actions", + "account_action_send_email": "Send Email", + "account_action_reset_password": "Reset Password", + "account_action_delete_account": "Delete Account", + "account_action_delete_account_confirm": "Are you sure you wish to delete this account?\nThis action is irreversible.\n\nTo confirm, please enter {email}", + "account_action_delete_account_failed": "Failed to delete account:", + "account_action_delete_account_success": "Account deleted successfully.", + "account_details": "Details", + "account_detail_mail_directory": "Mail Directory:", + "warn_account_not_activated": "This account is not activated yet.", + + "create_account": "Create Account", + "create_account_display_name": "Display Name", + "create_account_display_name_placeholder": "Example User", + "create_account_username": "Username", + "create_account_username_placeholder": "user", + "create_account_domain": "Domain", + "create_account_domain_placeholder": "example.org", + "create_account_failed": "Failed to create account:", + "create_account_succeess": "Account created successfully." } diff --git a/src/web/frontend/src/routes/accounts/[email]/+page.svelte b/src/web/frontend/src/routes/accounts/[email]/+page.svelte index 981c150..60c670b 100644 --- a/src/web/frontend/src/routes/accounts/[email]/+page.svelte +++ b/src/web/frontend/src/routes/accounts/[email]/+page.svelte @@ -6,6 +6,7 @@ import Label from '@jupiter/components/ui/Label.svelte'; import { goto } from '$app/navigation'; import * as api from '@jupiter/lib/api'; + import { m } from '@jupiter/paraglide/messages.js'; const { data } = $props(); @@ -17,7 +18,7 @@ "text/plain": email, })]); - pushToast("Email copied to clipboard.", ToastType.SUCCESS); + pushToast(m.clipboard_email(), ToastType.SUCCESS); } async function resetPassword() { @@ -25,21 +26,18 @@ } async function deleteAccount() { - if (prompt( - "Are you sure you wish to delete this account? " + - "This action is irreversible.\n\n" + - `To confirm, please enter ${email}:`) !== email) return; + if (prompt(m.account_action_delete_account_confirm({ email })) !== email) return; const res = await fetch(api.BASE_URL + "/api/v1/accounts/" + email, { method: "DELETE", }) if (!res.ok) { const text = await res.text(); - pushToast("Failed to delete account: " + text, ToastType.ERROR); + pushToast(m.account_action_delete_account_failed() + " " + text, ToastType.ERROR); return } - pushToast("Account deleted successfully.", ToastType.SUCCESS); + pushToast(m.account_action_delete_account_success(), ToastType.SUCCESS); goto("/accounts"); } @@ -47,49 +45,49 @@
-

Account Configuration

+

{m.account_configuration()}

- {#if account} -
diff --git a/src/web/frontend/src/routes/accounts/create/+page.svelte b/src/web/frontend/src/routes/accounts/create/+page.svelte index dfe96e1..9088436 100644 --- a/src/web/frontend/src/routes/accounts/create/+page.svelte +++ b/src/web/frontend/src/routes/accounts/create/+page.svelte @@ -8,6 +8,7 @@ import { type Account } from '@jupiter/lib/account'; import AccountListItem from '@jupiter/components/ui/AccountListItem.svelte'; import { goto } from '$app/navigation'; + import { m } from '@jupiter/paraglide/messages'; let domainInput: HTMLInputElement; @@ -35,12 +36,12 @@ }); if (!res.ok) { const text = await res.text(); - const err = new Error("Failed to create account: " + text); + const err = new Error(m.create_account_failed() + " " + text); pushToast(err.message, ToastType.ERROR); throw err; } - pushToast("Account created successfully.", ToastType.SUCCESS); + pushToast(m.create_account_succeess(), ToastType.SUCCESS); goto("/accounts"); } @@ -50,32 +51,39 @@
-

Create Account

+

{m.create_account()}

- - + + - - { - if (event.key === "@") { - event.preventDefault(); - domainInput.focus(); - } - }}> + + { + if (event.key === "@") { + event.preventDefault(); + domainInput.focus(); + } + }}> - - + + - +