diff --git a/frontend/src/lib/components/CategoryDropdown.svelte b/frontend/src/lib/components/CategoryDropdown.svelte index e9c2631..d509370 100644 --- a/frontend/src/lib/components/CategoryDropdown.svelte +++ b/frontend/src/lib/components/CategoryDropdown.svelte @@ -86,7 +86,8 @@ bind:value={new_category.icon} /> <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 on:click={custom_category} type="button" class="btn btn-primary"> {$t('adventures.add')} diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index 1600f24..53e620e 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -191,7 +191,10 @@ "category_fetch_error": "Fehler beim Abrufen der Kategorien", "copied_to_clipboard": "In die Zwischenablage kopiert!", "copy_failed": "Das Kopieren ist fehlgeschlagen", - "adventure_calendar": "Abenteuerkalender" + "adventure_calendar": "Abenteuerkalender", + "emoji_picker": "Emoji-Picker", + "hide": "Verstecken", + "show": "Zeigen" }, "home": { "desc_1": "Entdecken, planen und erkunden Sie mit Leichtigkeit", @@ -255,7 +258,10 @@ "profile_picture": "Profilbild", "public_profile": "Öffentliches Profil", "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": { "no_users_found": "Keine Benutzer mit öffentlichen Profilen gefunden." diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index b167429..b7603b2 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -214,6 +214,9 @@ "nothing_planned": "Nothing planned for this day. Enjoy the journey!", "copied_to_clipboard": "Copied to clipboard!", "copy_failed": "Copy failed", + "show": "Show", + "hide": "Hide", + "emoji_picker": "Emoji Picker", "days": "days", "activities": { "general": "General 🌍", @@ -266,7 +269,10 @@ "profile_picture": "Profile Picture", "public_profile": "Public Profile", "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": { "no_users_found": "No users found with public profiles." diff --git a/frontend/src/locales/es.json b/frontend/src/locales/es.json index 8506ddd..5283e35 100644 --- a/frontend/src/locales/es.json +++ b/frontend/src/locales/es.json @@ -238,7 +238,10 @@ "category_fetch_error": "Error al buscar categorías", "copied_to_clipboard": "¡Copiado al portapapeles!", "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": { "all": "Todo", @@ -266,7 +269,10 @@ "profile_picture": "Foto de perfil", "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.", - "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": { "no_users_found": "No se encontraron usuarios con perfiles públicos." diff --git a/frontend/src/locales/fr.json b/frontend/src/locales/fr.json index 6d71969..1f58959 100644 --- a/frontend/src/locales/fr.json +++ b/frontend/src/locales/fr.json @@ -191,7 +191,10 @@ "category_fetch_error": "Erreur lors de la récupération des catégories", "copied_to_clipboard": "Copié dans le presse-papier !", "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": { "desc_1": "Découvrez, planifiez et explorez en toute simplicité", @@ -255,7 +258,10 @@ "profile_picture": "Photo de profil", "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.", - "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": { "no_users_found": "Aucun utilisateur trouvé avec des profils publics." diff --git a/frontend/src/locales/it.json b/frontend/src/locales/it.json index 3cdaead..77b5498 100644 --- a/frontend/src/locales/it.json +++ b/frontend/src/locales/it.json @@ -191,7 +191,10 @@ "category_fetch_error": "Errore durante il recupero delle categorie", "copied_to_clipboard": "Copiato negli appunti!", "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": { "desc_1": "Scopri, pianifica ed esplora con facilità", @@ -255,7 +258,10 @@ "profile_picture": "Immagine del profilo", "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.", - "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": { "no_users_found": "Nessun utente trovato con profili pubblici." diff --git a/frontend/src/locales/nl.json b/frontend/src/locales/nl.json index 598ba05..4ebd11b 100644 --- a/frontend/src/locales/nl.json +++ b/frontend/src/locales/nl.json @@ -191,7 +191,10 @@ "category_fetch_error": "Fout bij ophalen van categorieën", "copied_to_clipboard": "Gekopieerd naar klembord!", "copy_failed": "Kopiëren mislukt", - "adventure_calendar": "Avonturenkalender" + "adventure_calendar": "Avonturenkalender", + "emoji_picker": "Emoji-kiezer", + "hide": "Verbergen", + "show": "Show" }, "home": { "desc_1": "Ontdek, plan en verken met gemak", @@ -255,7 +258,10 @@ "profile_picture": "Profielfoto", "public_profile": "Openbaar profiel", "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": { "no_users_found": "Er zijn geen gebruikers gevonden met openbare profielen." diff --git a/frontend/src/locales/pl.json b/frontend/src/locales/pl.json index 6b37bf3..7e50cc8 100644 --- a/frontend/src/locales/pl.json +++ b/frontend/src/locales/pl.json @@ -238,7 +238,10 @@ }, "copied_to_clipboard": "Skopiowano do schowka!", "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": { "country_list": "Lista krajów", @@ -266,7 +269,10 @@ "profile_picture": "Zdjęcie profilowe", "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.", - "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": { "no_users_found": "Nie znaleziono użytkowników z publicznymi profilami." diff --git a/frontend/src/locales/sv.json b/frontend/src/locales/sv.json index 29b7e53..fe462f9 100644 --- a/frontend/src/locales/sv.json +++ b/frontend/src/locales/sv.json @@ -191,7 +191,10 @@ "category_fetch_error": "Det gick inte att hämta kategorier", "copied_to_clipboard": "Kopierat till urklipp!", "copy_failed": "Kopieringen misslyckades", - "adventure_calendar": "Äventyrskalender" + "adventure_calendar": "Äventyrskalender", + "emoji_picker": "Emoji-väljare", + "hide": "Dölja", + "show": "Visa" }, "home": { "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.", "profile_picture": "Profilbild", "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": { "no_users_found": "Inga användare hittades med offentliga profiler." diff --git a/frontend/src/locales/zh.json b/frontend/src/locales/zh.json index 11202b8..228f664 100644 --- a/frontend/src/locales/zh.json +++ b/frontend/src/locales/zh.json @@ -191,7 +191,10 @@ "category_fetch_error": "获取类别时出错", "copied_to_clipboard": "已复制到剪贴板!", "copy_failed": "复制失败", - "adventure_calendar": "冒险日历" + "adventure_calendar": "冒险日历", + "emoji_picker": "表情符号选择器", + "hide": "隐藏", + "show": "展示" }, "home": { "desc_1": "轻松发现、规划和探索", @@ -255,7 +258,10 @@ "profile_picture": "个人资料图片", "public_profile": "公开资料", "public_tooltip": "通过公开个人资料,用户可以与您共享收藏并在用户页面上查看您的个人资料。", - "email_required": "电子邮件为必填项" + "email_required": "电子邮件为必填项", + "both_passwords_required": "两个密码都需要", + "new_password": "新密码", + "reset_failed": "重置密码失败" }, "worldtravel": { "all": "全部", diff --git a/frontend/src/routes/collections/+page.server.ts b/frontend/src/routes/collections/+page.server.ts index 8e2dac7..f88e5ee 100644 --- a/frontend/src/routes/collections/+page.server.ts +++ b/frontend/src/routes/collections/+page.server.ts @@ -4,7 +4,7 @@ const PUBLIC_SERVER_URL = process.env['PUBLIC_SERVER_URL']; import type { Adventure, Collection } from '$lib/types'; import type { Actions, RequestEvent } from '@sveltejs/kit'; -import { fetchCSRFToken, tryRefreshToken } from '$lib/index.server'; +import { fetchCSRFToken } from '$lib/index.server'; import { checkLink } from '$lib'; const serverEndpoint = PUBLIC_SERVER_URL || 'http://localhost:8000'; diff --git a/frontend/src/routes/collections/[id]/+page.server.ts b/frontend/src/routes/collections/[id]/+page.server.ts index a7af726..bf54a5b 100644 --- a/frontend/src/routes/collections/[id]/+page.server.ts +++ b/frontend/src/routes/collections/[id]/+page.server.ts @@ -31,7 +31,7 @@ export const load = (async (event) => { }) satisfies PageServerLoad; 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'; diff --git a/frontend/src/routes/user/reset-password/[key]/+page.server.ts b/frontend/src/routes/user/reset-password/[key]/+page.server.ts index 951310c..2db51f6 100644 --- a/frontend/src/routes/user/reset-password/[key]/+page.server.ts +++ b/frontend/src/routes/user/reset-password/[key]/+page.server.ts @@ -18,11 +18,11 @@ export const actions: Actions = { const key = event.params.key; if (!password || !confirm_password) { - return fail(400, { message: 'both_passwords_required' }); + return fail(400, { message: 'auth.both_passwords_required' }); } 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']; @@ -47,7 +47,7 @@ export const actions: Actions = { const error_message = await response.json(); console.error(error_message); console.log(response); - return fail(response.status, { message: 'reset_failed' }); + return fail(response.status, { message: 'auth.reset_failed' }); } return redirect(302, '/login'); diff --git a/frontend/src/routes/user/reset-password/[key]/+page.svelte b/frontend/src/routes/user/reset-password/[key]/+page.svelte index 6772f6f..7e837a4 100644 --- a/frontend/src/routes/user/reset-password/[key]/+page.svelte +++ b/frontend/src/routes/user/reset-password/[key]/+page.svelte @@ -9,34 +9,40 @@ <h1 class="text-center font-bold text-4xl mb-4">{$t('settings.change_password')}</h1> -<form method="POST" use:enhance> - <div class="mb-4"> - <label for="password" class="block mb-2">{$t('auth.new_password')}</label> +<form method="POST" use:enhance class="flex flex-col items-center justify-center space-y-4"> + <div class="w-full max-w-xs"> + <label for="password" class="label"> + <span class="label-text">{$t('auth.new_password')}</span> + </label> <input type="password" id="password" name="password" required - class="w-full p-2 border rounded" + class="input input-bordered w-full" /> </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 type="password" id="confirm_password" name="confirm_password" required - class="w-full p-2 border rounded" + class="input input-bordered w-full" /> </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} - <div class="text-center text-error mt-4"> - {$page.form?.message} + <div class="text-error"> + {$t($page.form?.message)} </div> {/if} </form>