mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-29 01:39:36 +02:00
Update password reset form and add more localization for error messages
This commit is contained in:
parent
c0fd91ef8d
commit
4839edde7b
14 changed files with 96 additions and 35 deletions
|
@ -86,7 +86,8 @@
|
||||||
bind:value={new_category.icon}
|
bind:value={new_category.icon}
|
||||||
/>
|
/>
|
||||||
<button on:click={toggleEmojiPicker} type="button" class="btn btn-secondary">
|
<button on:click={toggleEmojiPicker} type="button" class="btn btn-secondary">
|
||||||
{isEmojiPickerVisible ? 'Hide' : 'Show'} Emoji Picker
|
{isEmojiPickerVisible ? $t('adventures.hide') : $t('adventures.hide')}
|
||||||
|
{$t('adventures.emoji_picker')}
|
||||||
</button>
|
</button>
|
||||||
<button on:click={custom_category} type="button" class="btn btn-primary">
|
<button on:click={custom_category} type="button" class="btn btn-primary">
|
||||||
{$t('adventures.add')}
|
{$t('adventures.add')}
|
||||||
|
|
|
@ -191,7 +191,10 @@
|
||||||
"category_fetch_error": "Fehler beim Abrufen der Kategorien",
|
"category_fetch_error": "Fehler beim Abrufen der Kategorien",
|
||||||
"copied_to_clipboard": "In die Zwischenablage kopiert!",
|
"copied_to_clipboard": "In die Zwischenablage kopiert!",
|
||||||
"copy_failed": "Das Kopieren ist fehlgeschlagen",
|
"copy_failed": "Das Kopieren ist fehlgeschlagen",
|
||||||
"adventure_calendar": "Abenteuerkalender"
|
"adventure_calendar": "Abenteuerkalender",
|
||||||
|
"emoji_picker": "Emoji-Picker",
|
||||||
|
"hide": "Verstecken",
|
||||||
|
"show": "Zeigen"
|
||||||
},
|
},
|
||||||
"home": {
|
"home": {
|
||||||
"desc_1": "Entdecken, planen und erkunden Sie mit Leichtigkeit",
|
"desc_1": "Entdecken, planen und erkunden Sie mit Leichtigkeit",
|
||||||
|
@ -255,7 +258,10 @@
|
||||||
"profile_picture": "Profilbild",
|
"profile_picture": "Profilbild",
|
||||||
"public_profile": "Öffentliches Profil",
|
"public_profile": "Öffentliches Profil",
|
||||||
"public_tooltip": "Mit einem öffentlichen Profil können Benutzer Sammlungen mit Ihnen teilen und Ihr Profil auf der Benutzerseite anzeigen.",
|
"public_tooltip": "Mit einem öffentlichen Profil können Benutzer Sammlungen mit Ihnen teilen und Ihr Profil auf der Benutzerseite anzeigen.",
|
||||||
"email_required": "E-Mail ist erforderlich"
|
"email_required": "E-Mail ist erforderlich",
|
||||||
|
"both_passwords_required": "Beide Passwörter sind erforderlich",
|
||||||
|
"new_password": "Neues Passwort",
|
||||||
|
"reset_failed": "Passwort konnte nicht zurückgesetzt werden"
|
||||||
},
|
},
|
||||||
"users": {
|
"users": {
|
||||||
"no_users_found": "Keine Benutzer mit öffentlichen Profilen gefunden."
|
"no_users_found": "Keine Benutzer mit öffentlichen Profilen gefunden."
|
||||||
|
|
|
@ -214,6 +214,9 @@
|
||||||
"nothing_planned": "Nothing planned for this day. Enjoy the journey!",
|
"nothing_planned": "Nothing planned for this day. Enjoy the journey!",
|
||||||
"copied_to_clipboard": "Copied to clipboard!",
|
"copied_to_clipboard": "Copied to clipboard!",
|
||||||
"copy_failed": "Copy failed",
|
"copy_failed": "Copy failed",
|
||||||
|
"show": "Show",
|
||||||
|
"hide": "Hide",
|
||||||
|
"emoji_picker": "Emoji Picker",
|
||||||
"days": "days",
|
"days": "days",
|
||||||
"activities": {
|
"activities": {
|
||||||
"general": "General 🌍",
|
"general": "General 🌍",
|
||||||
|
@ -266,7 +269,10 @@
|
||||||
"profile_picture": "Profile Picture",
|
"profile_picture": "Profile Picture",
|
||||||
"public_profile": "Public Profile",
|
"public_profile": "Public Profile",
|
||||||
"public_tooltip": "With a public profile, users can share collections with you and view your profile on the users page.",
|
"public_tooltip": "With a public profile, users can share collections with you and view your profile on the users page.",
|
||||||
"email_required": "Email is required"
|
"email_required": "Email is required",
|
||||||
|
"new_password": "New Password",
|
||||||
|
"both_passwords_required": "Both passwords are required",
|
||||||
|
"reset_failed": "Failed to reset password"
|
||||||
},
|
},
|
||||||
"users": {
|
"users": {
|
||||||
"no_users_found": "No users found with public profiles."
|
"no_users_found": "No users found with public profiles."
|
||||||
|
|
|
@ -238,7 +238,10 @@
|
||||||
"category_fetch_error": "Error al buscar categorías",
|
"category_fetch_error": "Error al buscar categorías",
|
||||||
"copied_to_clipboard": "¡Copiado al portapapeles!",
|
"copied_to_clipboard": "¡Copiado al portapapeles!",
|
||||||
"copy_failed": "Copia fallida",
|
"copy_failed": "Copia fallida",
|
||||||
"adventure_calendar": "Calendario de aventuras"
|
"adventure_calendar": "Calendario de aventuras",
|
||||||
|
"emoji_picker": "Selector de emojis",
|
||||||
|
"hide": "Esconder",
|
||||||
|
"show": "Espectáculo"
|
||||||
},
|
},
|
||||||
"worldtravel": {
|
"worldtravel": {
|
||||||
"all": "Todo",
|
"all": "Todo",
|
||||||
|
@ -266,7 +269,10 @@
|
||||||
"profile_picture": "Foto de perfil",
|
"profile_picture": "Foto de perfil",
|
||||||
"public_profile": "Perfil público",
|
"public_profile": "Perfil público",
|
||||||
"public_tooltip": "Con un perfil público, los usuarios pueden compartir colecciones con usted y ver su perfil en la página de usuarios.",
|
"public_tooltip": "Con un perfil público, los usuarios pueden compartir colecciones con usted y ver su perfil en la página de usuarios.",
|
||||||
"email_required": "Se requiere correo electrónico"
|
"email_required": "Se requiere correo electrónico",
|
||||||
|
"both_passwords_required": "Se requieren ambas contraseñas",
|
||||||
|
"new_password": "Nueva contraseña",
|
||||||
|
"reset_failed": "No se pudo restablecer la contraseña"
|
||||||
},
|
},
|
||||||
"users": {
|
"users": {
|
||||||
"no_users_found": "No se encontraron usuarios con perfiles públicos."
|
"no_users_found": "No se encontraron usuarios con perfiles públicos."
|
||||||
|
|
|
@ -191,7 +191,10 @@
|
||||||
"category_fetch_error": "Erreur lors de la récupération des catégories",
|
"category_fetch_error": "Erreur lors de la récupération des catégories",
|
||||||
"copied_to_clipboard": "Copié dans le presse-papier !",
|
"copied_to_clipboard": "Copié dans le presse-papier !",
|
||||||
"copy_failed": "Échec de la copie",
|
"copy_failed": "Échec de la copie",
|
||||||
"adventure_calendar": "Calendrier d'aventure"
|
"adventure_calendar": "Calendrier d'aventure",
|
||||||
|
"emoji_picker": "Sélecteur d'émoticônes",
|
||||||
|
"hide": "Cacher",
|
||||||
|
"show": "Montrer"
|
||||||
},
|
},
|
||||||
"home": {
|
"home": {
|
||||||
"desc_1": "Découvrez, planifiez et explorez en toute simplicité",
|
"desc_1": "Découvrez, planifiez et explorez en toute simplicité",
|
||||||
|
@ -255,7 +258,10 @@
|
||||||
"profile_picture": "Photo de profil",
|
"profile_picture": "Photo de profil",
|
||||||
"public_profile": "Profil public",
|
"public_profile": "Profil public",
|
||||||
"public_tooltip": "Avec un profil public, les utilisateurs peuvent partager des collections avec vous et afficher votre profil sur la page des utilisateurs.",
|
"public_tooltip": "Avec un profil public, les utilisateurs peuvent partager des collections avec vous et afficher votre profil sur la page des utilisateurs.",
|
||||||
"email_required": "L'e-mail est requis"
|
"email_required": "L'e-mail est requis",
|
||||||
|
"both_passwords_required": "Les deux mots de passe sont requis",
|
||||||
|
"new_password": "Nouveau mot de passe",
|
||||||
|
"reset_failed": "Échec de la réinitialisation du mot de passe"
|
||||||
},
|
},
|
||||||
"users": {
|
"users": {
|
||||||
"no_users_found": "Aucun utilisateur trouvé avec des profils publics."
|
"no_users_found": "Aucun utilisateur trouvé avec des profils publics."
|
||||||
|
|
|
@ -191,7 +191,10 @@
|
||||||
"category_fetch_error": "Errore durante il recupero delle categorie",
|
"category_fetch_error": "Errore durante il recupero delle categorie",
|
||||||
"copied_to_clipboard": "Copiato negli appunti!",
|
"copied_to_clipboard": "Copiato negli appunti!",
|
||||||
"copy_failed": "Copia non riuscita",
|
"copy_failed": "Copia non riuscita",
|
||||||
"adventure_calendar": "Calendario delle avventure"
|
"adventure_calendar": "Calendario delle avventure",
|
||||||
|
"emoji_picker": "Selettore di emoji",
|
||||||
|
"hide": "Nascondere",
|
||||||
|
"show": "Spettacolo"
|
||||||
},
|
},
|
||||||
"home": {
|
"home": {
|
||||||
"desc_1": "Scopri, pianifica ed esplora con facilità",
|
"desc_1": "Scopri, pianifica ed esplora con facilità",
|
||||||
|
@ -255,7 +258,10 @@
|
||||||
"profile_picture": "Immagine del profilo",
|
"profile_picture": "Immagine del profilo",
|
||||||
"public_profile": "Profilo pubblico",
|
"public_profile": "Profilo pubblico",
|
||||||
"public_tooltip": "Con un profilo pubblico, gli utenti possono condividere raccolte con te e visualizzare il tuo profilo nella pagina degli utenti.",
|
"public_tooltip": "Con un profilo pubblico, gli utenti possono condividere raccolte con te e visualizzare il tuo profilo nella pagina degli utenti.",
|
||||||
"email_required": "L'e-mail è obbligatoria"
|
"email_required": "L'e-mail è obbligatoria",
|
||||||
|
"both_passwords_required": "Sono necessarie entrambe le password",
|
||||||
|
"new_password": "Nuova parola d'ordine",
|
||||||
|
"reset_failed": "Impossibile reimpostare la password"
|
||||||
},
|
},
|
||||||
"users": {
|
"users": {
|
||||||
"no_users_found": "Nessun utente trovato con profili pubblici."
|
"no_users_found": "Nessun utente trovato con profili pubblici."
|
||||||
|
|
|
@ -191,7 +191,10 @@
|
||||||
"category_fetch_error": "Fout bij ophalen van categorieën",
|
"category_fetch_error": "Fout bij ophalen van categorieën",
|
||||||
"copied_to_clipboard": "Gekopieerd naar klembord!",
|
"copied_to_clipboard": "Gekopieerd naar klembord!",
|
||||||
"copy_failed": "Kopiëren mislukt",
|
"copy_failed": "Kopiëren mislukt",
|
||||||
"adventure_calendar": "Avonturenkalender"
|
"adventure_calendar": "Avonturenkalender",
|
||||||
|
"emoji_picker": "Emoji-kiezer",
|
||||||
|
"hide": "Verbergen",
|
||||||
|
"show": "Show"
|
||||||
},
|
},
|
||||||
"home": {
|
"home": {
|
||||||
"desc_1": "Ontdek, plan en verken met gemak",
|
"desc_1": "Ontdek, plan en verken met gemak",
|
||||||
|
@ -255,7 +258,10 @@
|
||||||
"profile_picture": "Profielfoto",
|
"profile_picture": "Profielfoto",
|
||||||
"public_profile": "Openbaar profiel",
|
"public_profile": "Openbaar profiel",
|
||||||
"public_tooltip": "Met een openbaar profiel kunnen gebruikers collecties met u delen en uw profiel bekijken op de gebruikerspagina.",
|
"public_tooltip": "Met een openbaar profiel kunnen gebruikers collecties met u delen en uw profiel bekijken op de gebruikerspagina.",
|
||||||
"email_required": "E-mail is vereist"
|
"email_required": "E-mail is vereist",
|
||||||
|
"both_passwords_required": "Beide wachtwoorden zijn vereist",
|
||||||
|
"new_password": "Nieuw wachtwoord",
|
||||||
|
"reset_failed": "Kan het wachtwoord niet opnieuw instellen"
|
||||||
},
|
},
|
||||||
"users": {
|
"users": {
|
||||||
"no_users_found": "Er zijn geen gebruikers gevonden met openbare profielen."
|
"no_users_found": "Er zijn geen gebruikers gevonden met openbare profielen."
|
||||||
|
|
|
@ -238,7 +238,10 @@
|
||||||
},
|
},
|
||||||
"copied_to_clipboard": "Skopiowano do schowka!",
|
"copied_to_clipboard": "Skopiowano do schowka!",
|
||||||
"copy_failed": "Kopiowanie nie powiodło się",
|
"copy_failed": "Kopiowanie nie powiodło się",
|
||||||
"adventure_calendar": "Kalendarz przygód"
|
"adventure_calendar": "Kalendarz przygód",
|
||||||
|
"emoji_picker": "Wybór emoji",
|
||||||
|
"hide": "Ukrywać",
|
||||||
|
"show": "Pokazywać"
|
||||||
},
|
},
|
||||||
"worldtravel": {
|
"worldtravel": {
|
||||||
"country_list": "Lista krajów",
|
"country_list": "Lista krajów",
|
||||||
|
@ -266,7 +269,10 @@
|
||||||
"profile_picture": "Zdjęcie profilowe",
|
"profile_picture": "Zdjęcie profilowe",
|
||||||
"public_profile": "Publiczny profil",
|
"public_profile": "Publiczny profil",
|
||||||
"public_tooltip": "Dzięki publicznemu profilowi użytkownicy mogą dzielić się z Tobą kolekcjami i oglądać Twój profil na stronie użytkowników.",
|
"public_tooltip": "Dzięki publicznemu profilowi użytkownicy mogą dzielić się z Tobą kolekcjami i oglądać Twój profil na stronie użytkowników.",
|
||||||
"email_required": "Adres e-mail jest wymagany"
|
"email_required": "Adres e-mail jest wymagany",
|
||||||
|
"both_passwords_required": "Obydwa hasła są wymagane",
|
||||||
|
"new_password": "Nowe hasło",
|
||||||
|
"reset_failed": "Nie udało się zresetować hasła"
|
||||||
},
|
},
|
||||||
"users": {
|
"users": {
|
||||||
"no_users_found": "Nie znaleziono użytkowników z publicznymi profilami."
|
"no_users_found": "Nie znaleziono użytkowników z publicznymi profilami."
|
||||||
|
|
|
@ -191,7 +191,10 @@
|
||||||
"category_fetch_error": "Det gick inte att hämta kategorier",
|
"category_fetch_error": "Det gick inte att hämta kategorier",
|
||||||
"copied_to_clipboard": "Kopierat till urklipp!",
|
"copied_to_clipboard": "Kopierat till urklipp!",
|
||||||
"copy_failed": "Kopieringen misslyckades",
|
"copy_failed": "Kopieringen misslyckades",
|
||||||
"adventure_calendar": "Äventyrskalender"
|
"adventure_calendar": "Äventyrskalender",
|
||||||
|
"emoji_picker": "Emoji-väljare",
|
||||||
|
"hide": "Dölja",
|
||||||
|
"show": "Visa"
|
||||||
},
|
},
|
||||||
"home": {
|
"home": {
|
||||||
"desc_1": "Upptäck, planera och utforska med lätthet",
|
"desc_1": "Upptäck, planera och utforska med lätthet",
|
||||||
|
@ -266,7 +269,10 @@
|
||||||
"public_tooltip": "Med en offentlig profil kan användare dela samlingar med dig och se din profil på användarsidan.",
|
"public_tooltip": "Med en offentlig profil kan användare dela samlingar med dig och se din profil på användarsidan.",
|
||||||
"profile_picture": "Profilbild",
|
"profile_picture": "Profilbild",
|
||||||
"public_profile": "Offentlig profil",
|
"public_profile": "Offentlig profil",
|
||||||
"email_required": "E-post krävs"
|
"email_required": "E-post krävs",
|
||||||
|
"both_passwords_required": "Båda lösenorden krävs",
|
||||||
|
"new_password": "Nytt lösenord",
|
||||||
|
"reset_failed": "Det gick inte att återställa lösenordet"
|
||||||
},
|
},
|
||||||
"users": {
|
"users": {
|
||||||
"no_users_found": "Inga användare hittades med offentliga profiler."
|
"no_users_found": "Inga användare hittades med offentliga profiler."
|
||||||
|
|
|
@ -191,7 +191,10 @@
|
||||||
"category_fetch_error": "获取类别时出错",
|
"category_fetch_error": "获取类别时出错",
|
||||||
"copied_to_clipboard": "已复制到剪贴板!",
|
"copied_to_clipboard": "已复制到剪贴板!",
|
||||||
"copy_failed": "复制失败",
|
"copy_failed": "复制失败",
|
||||||
"adventure_calendar": "冒险日历"
|
"adventure_calendar": "冒险日历",
|
||||||
|
"emoji_picker": "表情符号选择器",
|
||||||
|
"hide": "隐藏",
|
||||||
|
"show": "展示"
|
||||||
},
|
},
|
||||||
"home": {
|
"home": {
|
||||||
"desc_1": "轻松发现、规划和探索",
|
"desc_1": "轻松发现、规划和探索",
|
||||||
|
@ -255,7 +258,10 @@
|
||||||
"profile_picture": "个人资料图片",
|
"profile_picture": "个人资料图片",
|
||||||
"public_profile": "公开资料",
|
"public_profile": "公开资料",
|
||||||
"public_tooltip": "通过公开个人资料,用户可以与您共享收藏并在用户页面上查看您的个人资料。",
|
"public_tooltip": "通过公开个人资料,用户可以与您共享收藏并在用户页面上查看您的个人资料。",
|
||||||
"email_required": "电子邮件为必填项"
|
"email_required": "电子邮件为必填项",
|
||||||
|
"both_passwords_required": "两个密码都需要",
|
||||||
|
"new_password": "新密码",
|
||||||
|
"reset_failed": "重置密码失败"
|
||||||
},
|
},
|
||||||
"worldtravel": {
|
"worldtravel": {
|
||||||
"all": "全部",
|
"all": "全部",
|
||||||
|
|
|
@ -4,7 +4,7 @@ const PUBLIC_SERVER_URL = process.env['PUBLIC_SERVER_URL'];
|
||||||
import type { Adventure, Collection } from '$lib/types';
|
import type { Adventure, Collection } from '$lib/types';
|
||||||
|
|
||||||
import type { Actions, RequestEvent } from '@sveltejs/kit';
|
import type { Actions, RequestEvent } from '@sveltejs/kit';
|
||||||
import { fetchCSRFToken, tryRefreshToken } from '$lib/index.server';
|
import { fetchCSRFToken } from '$lib/index.server';
|
||||||
import { checkLink } from '$lib';
|
import { checkLink } from '$lib';
|
||||||
|
|
||||||
const serverEndpoint = PUBLIC_SERVER_URL || 'http://localhost:8000';
|
const serverEndpoint = PUBLIC_SERVER_URL || 'http://localhost:8000';
|
||||||
|
|
|
@ -31,7 +31,7 @@ export const load = (async (event) => {
|
||||||
}) satisfies PageServerLoad;
|
}) satisfies PageServerLoad;
|
||||||
|
|
||||||
import type { Actions } from '@sveltejs/kit';
|
import type { Actions } from '@sveltejs/kit';
|
||||||
import { fetchCSRFToken, tryRefreshToken } from '$lib/index.server';
|
import { fetchCSRFToken } from '$lib/index.server';
|
||||||
|
|
||||||
const serverEndpoint = PUBLIC_SERVER_URL || 'http://localhost:8000';
|
const serverEndpoint = PUBLIC_SERVER_URL || 'http://localhost:8000';
|
||||||
|
|
||||||
|
|
|
@ -18,11 +18,11 @@ export const actions: Actions = {
|
||||||
const key = event.params.key;
|
const key = event.params.key;
|
||||||
|
|
||||||
if (!password || !confirm_password) {
|
if (!password || !confirm_password) {
|
||||||
return fail(400, { message: 'both_passwords_required' });
|
return fail(400, { message: 'auth.both_passwords_required' });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (password !== confirm_password) {
|
if (password !== confirm_password) {
|
||||||
return fail(400, { message: 'passwords_not_match' });
|
return fail(400, { message: 'settings.password_does_not_match' });
|
||||||
}
|
}
|
||||||
|
|
||||||
const PUBLIC_SERVER_URL = process.env['PUBLIC_SERVER_URL'];
|
const PUBLIC_SERVER_URL = process.env['PUBLIC_SERVER_URL'];
|
||||||
|
@ -47,7 +47,7 @@ export const actions: Actions = {
|
||||||
const error_message = await response.json();
|
const error_message = await response.json();
|
||||||
console.error(error_message);
|
console.error(error_message);
|
||||||
console.log(response);
|
console.log(response);
|
||||||
return fail(response.status, { message: 'reset_failed' });
|
return fail(response.status, { message: 'auth.reset_failed' });
|
||||||
}
|
}
|
||||||
|
|
||||||
return redirect(302, '/login');
|
return redirect(302, '/login');
|
||||||
|
|
|
@ -9,34 +9,40 @@
|
||||||
|
|
||||||
<h1 class="text-center font-bold text-4xl mb-4">{$t('settings.change_password')}</h1>
|
<h1 class="text-center font-bold text-4xl mb-4">{$t('settings.change_password')}</h1>
|
||||||
|
|
||||||
<form method="POST" use:enhance>
|
<form method="POST" use:enhance class="flex flex-col items-center justify-center space-y-4">
|
||||||
<div class="mb-4">
|
<div class="w-full max-w-xs">
|
||||||
<label for="password" class="block mb-2">{$t('auth.new_password')}</label>
|
<label for="password" class="label">
|
||||||
|
<span class="label-text">{$t('auth.new_password')}</span>
|
||||||
|
</label>
|
||||||
<input
|
<input
|
||||||
type="password"
|
type="password"
|
||||||
id="password"
|
id="password"
|
||||||
name="password"
|
name="password"
|
||||||
required
|
required
|
||||||
class="w-full p-2 border rounded"
|
class="input input-bordered w-full"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-4">
|
|
||||||
<label for="confirm_password" class="block mb-2">{$t('auth.confirm_password')}</label>
|
<div class="w-full max-w-xs">
|
||||||
|
<label for="confirm_password" class="label">
|
||||||
|
<span class="label-text">{$t('auth.confirm_password')}</span>
|
||||||
|
</label>
|
||||||
<input
|
<input
|
||||||
type="password"
|
type="password"
|
||||||
id="confirm_password"
|
id="confirm_password"
|
||||||
name="confirm_password"
|
name="confirm_password"
|
||||||
required
|
required
|
||||||
class="w-full p-2 border rounded"
|
class="input input-bordered w-full"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="bg-blue-500 text-white px-4 py-2 rounded"
|
|
||||||
>{$t('auth.reset_password')}</button
|
<button type="submit" class="btn btn-primary">
|
||||||
>
|
{$t('settings.reset_password')}
|
||||||
|
</button>
|
||||||
|
|
||||||
{#if $page.form?.message}
|
{#if $page.form?.message}
|
||||||
<div class="text-center text-error mt-4">
|
<div class="text-error">
|
||||||
{$page.form?.message}
|
{$t($page.form?.message)}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</form>
|
</form>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue