1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-23 06:49:37 +02:00

more localization

This commit is contained in:
Sean Morley 2024-10-28 15:10:14 -04:00
parent 91c0ec8c07
commit 8068fe93f7
8 changed files with 265 additions and 166 deletions

View file

@ -1,6 +1,7 @@
<script lang="ts"> <script lang="ts">
import { ADVENTURE_TYPES } from '$lib'; import { ADVENTURE_TYPES } from '$lib';
import { onMount } from 'svelte'; import { onMount } from 'svelte';
import { t } from 'svelte-i18n';
let types_arr: string[] = []; let types_arr: string[] = [];
export let types: string; export let types: string;
@ -29,9 +30,13 @@
<div class="collapse collapse-plus mb-4"> <div class="collapse collapse-plus mb-4">
<input type="checkbox" /> <input type="checkbox" />
<div class="collapse-title text-xl bg-base-300 font-medium">Category Filter</div> <div class="collapse-title text-xl bg-base-300 font-medium">
{$t('adventures.category_filter')}
</div>
<div class="collapse-content bg-base-300"> <div class="collapse-content bg-base-300">
<button class="btn btn-wide btn-neutral-300" on:click={clearTypes}>Clear</button> <button class="btn btn-wide btn-neutral-300" on:click={clearTypes}
>{$t(`adventures.clear`)}</button
>
{#each ADVENTURE_TYPES as type} {#each ADVENTURE_TYPES as type}
<li> <li>
<label class="cursor-pointer"> <label class="cursor-pointer">
@ -41,7 +46,7 @@
on:change={() => toggleSelect(type.type)} on:change={() => toggleSelect(type.type)}
checked={types.indexOf(type.type) > -1} checked={types.indexOf(type.type) > -1}
/> />
<span>{type.label}</span> <span>{$t(`adventures.activities.${type.type}`)}</span>
</label> </label>
</li> </li>
{/each} {/each}

View file

@ -2,7 +2,6 @@
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';
import Launch from '~icons/mdi/launch'; import Launch from '~icons/mdi/launch';
import TrashCanOutline from '~icons/mdi/trash-can-outline';
import FileDocumentEdit from '~icons/mdi/file-document-edit'; import FileDocumentEdit from '~icons/mdi/file-document-edit';
import ArchiveArrowDown from '~icons/mdi/archive-arrow-down'; import ArchiveArrowDown from '~icons/mdi/archive-arrow-down';
@ -11,6 +10,7 @@
import { goto } from '$app/navigation'; import { goto } from '$app/navigation';
import type { Adventure, Collection } from '$lib/types'; import type { Adventure, Collection } from '$lib/types';
import { addToast } from '$lib/toasts'; import { addToast } from '$lib/toasts';
import { t } from 'svelte-i18n';
import Plus from '~icons/mdi/plus'; import Plus from '~icons/mdi/plus';
import DotsHorizontal from '~icons/mdi/dots-horizontal'; import DotsHorizontal from '~icons/mdi/dots-horizontal';
@ -39,8 +39,11 @@
body: JSON.stringify({ is_archived: is_archived }) body: JSON.stringify({ is_archived: is_archived })
}); });
if (res.ok) { if (res.ok) {
console.log(`Collection ${is_archived ? 'archived' : 'unarchived'}`); if (is_archived) {
addToast('info', `Collection ${is_archived ? 'archived' : 'unarchived'} successfully!`); addToast('info', $t('adventures.archived_collection_message'));
} else {
addToast('info', $t('adventures.unarchived_collection_message'));
}
dispatch('delete', collection.id); dispatch('delete', collection.id);
} else { } else {
console.log('Error archiving collection'); console.log('Error archiving collection');
@ -57,8 +60,7 @@
} }
}); });
if (res.ok) { if (res.ok) {
console.log('Collection deleted'); addToast('info', $t('adventures.delete_collection_success'));
addToast('info', 'Collection deleted successfully!');
dispatch('delete', collection.id); dispatch('delete', collection.id);
} else { } else {
console.log('Error deleting collection'); console.log('Error deleting collection');
@ -70,9 +72,9 @@
{#if isWarningModalOpen} {#if isWarningModalOpen}
<DeleteWarning <DeleteWarning
title="Delete Collection" title={$t('adventures.delete_collection')}
button_text="Delete" button_text={$t('adventures.delete')}
description="Are you sure you want to delete this collection? This will also delete all of the linked adventures. This action cannot be undone." description={$t('adventures.delete_collection_warning')}
is_warning={true} is_warning={true}
on:close={() => (isWarningModalOpen = false)} on:close={() => (isWarningModalOpen = false)}
on:confirm={deleteCollection} on:confirm={deleteCollection}
@ -97,12 +99,14 @@
</button> </button>
</div> </div>
<div class="inline-flex gap-2 mb-2"> <div class="inline-flex gap-2 mb-2">
<div class="badge badge-secondary">{collection.is_public ? 'Public' : 'Private'}</div> <div class="badge badge-secondary">
{collection.is_public ? $t('adventures.public') : $t('adventures.private')}
</div>
{#if collection.is_archived} {#if collection.is_archived}
<div class="badge badge-warning">Archived</div> <div class="badge badge-warning">{$t('adventures.archived')}</div>
{/if} {/if}
</div> </div>
<p>{collection.adventures.length} Adventures</p> <p>{collection.adventures.length} {$t('navbar.adventures')}</p>
{#if collection.start_date && collection.end_date} {#if collection.start_date && collection.end_date}
<p> <p>
Dates: {new Date(collection.start_date).toLocaleDateString(undefined, { timeZone: 'UTC' })} - Dates: {new Date(collection.start_date).toLocaleDateString(undefined, { timeZone: 'UTC' })} -
@ -136,23 +140,23 @@
<button <button
class="btn btn-neutral mb-2" class="btn btn-neutral mb-2"
on:click={() => goto(`/collections/${collection.id}`)} on:click={() => goto(`/collections/${collection.id}`)}
><Launch class="w-5 h-5 mr-1" />Open Details</button ><Launch class="w-5 h-5 mr-1" />{$t('adventures.open_details')}</button
> >
{#if !collection.is_archived} {#if !collection.is_archived}
<button class="btn btn-neutral mb-2" on:click={editAdventure}> <button class="btn btn-neutral mb-2" on:click={editAdventure}>
<FileDocumentEdit class="w-6 h-6" />Edit Collection <FileDocumentEdit class="w-6 h-6" />{$t('adventures.edit_collection')}
</button> </button>
<button class="btn btn-neutral mb-2" on:click={() => (isShareModalOpen = true)}> <button class="btn btn-neutral mb-2" on:click={() => (isShareModalOpen = true)}>
<FileDocumentEdit class="w-6 h-6" />Share <FileDocumentEdit class="w-6 h-6" />{$t('adventures.share')}
</button> </button>
{/if} {/if}
{#if collection.is_archived} {#if collection.is_archived}
<button class="btn btn-neutral mb-2" on:click={() => archiveCollection(false)}> <button class="btn btn-neutral mb-2" on:click={() => archiveCollection(false)}>
<ArchiveArrowUp class="w-6 h-6 mr-1" />Unarchive <ArchiveArrowUp class="w-6 h-6 mr-1" />{$t('adventures.unarchive')}
</button> </button>
{:else} {:else}
<button class="btn btn-neutral mb-2" on:click={() => archiveCollection(true)}> <button class="btn btn-neutral mb-2" on:click={() => archiveCollection(true)}>
<ArchiveArrowDown class="w-6 h-6 mr" />Archive <ArchiveArrowDown class="w-6 h-6 mr" />{$t('adventures.archive')}
</button> </button>
{/if} {/if}
<button <button
@ -160,14 +164,14 @@
data-umami-event="Delete Adventure" data-umami-event="Delete Adventure"
class="btn btn-warning" class="btn btn-warning"
on:click={() => (isWarningModalOpen = true)} on:click={() => (isWarningModalOpen = true)}
><TrashCan class="w-6 h-6" />Delete</button ><TrashCan class="w-6 h-6" />{$t('adventures.delete')}</button
> >
{/if} {/if}
{#if type == 'viewonly'} {#if type == 'viewonly'}
<button <button
class="btn btn-neutral mb-2" class="btn btn-neutral mb-2"
on:click={() => goto(`/collections/${collection.id}`)} on:click={() => goto(`/collections/${collection.id}`)}
><Launch class="w-5 h-5 mr-1" />Open Details</button ><Launch class="w-5 h-5 mr-1" />{$t('adventures.open_details')}</button
> >
{/if} {/if}
</ul> </ul>

View file

@ -2,6 +2,7 @@
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher();
import { onMount } from 'svelte'; import { onMount } from 'svelte';
import { t } from 'svelte-i18n';
let modal: HTMLDialogElement; let modal: HTMLDialogElement;
export let title: string; export let title: string;
@ -41,6 +42,6 @@
<button class="btn btn-{is_warning ? 'warning' : 'primary'} mr-2" on:click={confirm} <button class="btn btn-{is_warning ? 'warning' : 'primary'} mr-2" on:click={confirm}
>{button_text}</button >{button_text}</button
> >
<button class="btn btn-neutral" on:click={close}>Cancel</button> <button class="btn btn-neutral" on:click={close}>{$t('adventures.cancel')}</button>
</div> </div>
</dialog> </dialog>

View file

@ -66,6 +66,50 @@
"remove_from_collection": "Remove from Collection", "remove_from_collection": "Remove from Collection",
"add_to_collection": "Add to Collection", "add_to_collection": "Add to Collection",
"delete": "Delete", "delete": "Delete",
"not_found": "Adventure not found",
"not_found_desc": "The adventure you were looking for could not be found. Please try a different adventure or check back later.",
"homepage": "Homepage",
"adventure_details": "Adventure Details",
"collection": "Collection",
"adventure_type": "Adventure Type",
"longitude": "Longitude",
"latitude": "Latitude",
"visit": "Visit",
"visits": "Visits",
"create_new": "Create New...",
"adventure": "Adventure",
"count_txt": "results matching your search",
"sort": "Sort",
"order_direction": "Order Direction",
"order_by": "Order By",
"ascending": "Ascending",
"descending": "Descending",
"updated": "Updated",
"name": "Name",
"date": "Date",
"rating": "Rating",
"sources": "Sources",
"collection_adventures": "Include Collection Adventures",
"filter": "Filter",
"category_filter": "Category Filter",
"clear": "Clear",
"my_collections": "My Collections",
"open_filters": "Open Filters",
"close_filters": "Close Filters",
"archived_collections": "Archived Collections",
"share": "Share",
"private": "Private",
"public": "Public",
"archived": "Archived",
"edit_collection": "Edit Collection",
"unarchive": "Unarchive",
"archive": "Archive",
"archived_collection_message": "Collection archived successfully!",
"unarchived_collection_message": "Collection unarchived successfully!",
"delete_collection_success": "Collection deleted successfully!",
"delete_collection_warning": "Are you sure you want to delete this collection? This will also delete all of the linked adventures. This action cannot be undone.",
"cancel": "Cancel",
"delete_collection": "Delete Collection",
"activities": { "activities": {
"general": "General 🌍", "general": "General 🌍",
"outdoor": "Outdoor 🏞️", "outdoor": "Outdoor 🏞️",

View file

@ -1,94 +1,138 @@
{ {
"navbar": { "navbar": {
"adventures": "Aventuras", "adventures": "Aventuras",
"collections": "Colecciones", "collections": "Colecciones",
"worldtravel": "Viajar por el Mundo", "worldtravel": "Viajar por el Mundo",
"map": "Mapa", "map": "Mapa",
"users": "Usuarios", "users": "Usuarios",
"login": "Iniciar Sesión", "login": "Iniciar Sesión",
"signup": "Registrarse", "signup": "Registrarse",
"search": "Buscar", "search": "Buscar",
"profile": "Perfil", "profile": "Perfil",
"greeting": "Hola", "greeting": "Hola",
"my_adventures": "Mis Aventuras", "my_adventures": "Mis Aventuras",
"my_activities": "Mis Actividades", "my_activities": "Mis Actividades",
"shared_with_me": "Compartido Conmigo", "shared_with_me": "Compartido Conmigo",
"settings": "Configuraciones", "settings": "Configuraciones",
"logout": "Cerrar Sesión", "logout": "Cerrar Sesión",
"about": "Acerca de AdventureLog", "about": "Acerca de AdventureLog",
"documentation": "Documentación", "documentation": "Documentación",
"discord": "Discord", "discord": "Discord",
"theme_selection": "Selección de Tema", "theme_selection": "Selección de Tema",
"themes": { "themes": {
"light": "Claro", "light": "Claro",
"dark": "Oscuro", "dark": "Oscuro",
"night": "Noche", "night": "Noche",
"forest": "Bosque", "forest": "Bosque",
"aestetic-dark": "Estético Oscuro", "aestetic-dark": "Estético Oscuro",
"aestetic-light": "Estético Claro", "aestetic-light": "Estético Claro",
"aqua": "Aqua" "aqua": "Aqua"
} }
}, },
"about": { "about": {
"about": "Acerca de", "about": "Acerca de",
"license": "Licenciado bajo la Licencia GPL-3.0.", "license": "Licenciado bajo la Licencia GPL-3.0.",
"source_code": "Código Fuente", "source_code": "Código Fuente",
"message": "Hecho con ❤️ en los Estados Unidos.", "message": "Hecho con ❤️ en los Estados Unidos.",
"oss_attributions": "Atribuciones de Código Abierto", "oss_attributions": "Atribuciones de Código Abierto",
"nominatim_1": "La búsqueda de ubicaciones y geocodificación es proporcionada por", "nominatim_1": "La búsqueda de ubicaciones y geocodificación es proporcionada por",
"nominatim_2": "Sus datos están licenciados bajo la licencia ODbL.", "nominatim_2": "Sus datos están licenciados bajo la licencia ODbL.",
"other_attributions": "Atribuciones adicionales se pueden encontrar en el archivo README.", "other_attributions": "Atribuciones adicionales se pueden encontrar en el archivo README.",
"close": "Cerrar" "close": "Cerrar"
}, },
"home": { "home": {
"hero_1": "Descubre las Aventuras Más Emocionantes del Mundo", "hero_1": "Descubre las Aventuras Más Emocionantes del Mundo",
"hero_2": "Descubre y planifica tu próxima aventura con AdventureLog. Explora destinos impresionantes, crea itinerarios personalizados y mantente conectado en todo momento.", "hero_2": "Descubre y planifica tu próxima aventura con AdventureLog. Explora destinos impresionantes, crea itinerarios personalizados y mantente conectado en todo momento.",
"go_to": "Ir a AdventureLog", "go_to": "Ir a AdventureLog",
"key_features": "Características Clave", "key_features": "Características Clave",
"desc_1": "Descubre, Planifica y Explora Fácilmente", "desc_1": "Descubre, Planifica y Explora Fácilmente",
"desc_2": "AdventureLog está diseñado para simplificar tu viaje, brindándote las herramientas y recursos para planificar, empacar y navegar tu próxima aventura inolvidable.", "desc_2": "AdventureLog está diseñado para simplificar tu viaje, brindándote las herramientas y recursos para planificar, empacar y navegar tu próxima aventura inolvidable.",
"feature_1": "Registro de Viajes", "feature_1": "Registro de Viajes",
"feature_1_desc": "Mantén un registro de tus aventuras con un diario de viaje personalizado y comparte tus experiencias con amigos y familiares.", "feature_1_desc": "Mantén un registro de tus aventuras con un diario de viaje personalizado y comparte tus experiencias con amigos y familiares.",
"feature_2": "Planificación de Viajes", "feature_2": "Planificación de Viajes",
"feature_2_desc": "Crea fácilmente itinerarios personalizados y obtén un desglose diario de tu viaje.", "feature_2_desc": "Crea fácilmente itinerarios personalizados y obtén un desglose diario de tu viaje.",
"feature_3": "Mapa de Viaje", "feature_3": "Mapa de Viaje",
"feature_3_desc": "Visualiza tus viajes por el mundo con un mapa interactivo y explora nuevos destinos." "feature_3_desc": "Visualiza tus viajes por el mundo con un mapa interactivo y explora nuevos destinos."
}, },
"adventures": { "adventures": {
"collection_remove_success": "¡Aventura eliminada de la colección con éxito!", "collection_remove_success": "¡Aventura eliminada de la colección con éxito!",
"collection_remove_error": "Error al eliminar la aventura de la colección", "collection_remove_error": "Error al eliminar la aventura de la colección",
"collection_link_success": "¡Aventura vinculada a la colección con éxito!", "collection_link_success": "¡Aventura vinculada a la colección con éxito!",
"collection_link_error": "Error al vincular la aventura a la colección", "collection_link_error": "Error al vincular la aventura a la colección",
"adventure_delete_confirm": "¿Estás seguro de que quieres eliminar esta aventura? Esta acción no se puede deshacer.", "adventure_delete_confirm": "¿Estás seguro de que quieres eliminar esta aventura? Esta acción no se puede deshacer.",
"open_details": "Abrir Detalles", "open_details": "Abrir Detalles",
"edit_adventure": "Editar Aventura", "edit_adventure": "Editar Aventura",
"remove_from_collection": "Eliminar de la Colección", "remove_from_collection": "Eliminar de la Colección",
"add_to_collection": "Añadir a la Colección", "add_to_collection": "Añadir a la Colección",
"delete": "Eliminar", "delete": "Eliminar",
"activities": { "activities": {
"activity": "Actividad 🏄", "activity": "Actividad 🏄",
"art_museums": "Arte", "art_museums": "Arte",
"attraction": "Atracción 🎢", "attraction": "Atracción 🎢",
"culture": "Cultura 🎭", "culture": "Cultura 🎭",
"dining": "Cenar 🍽️", "dining": "Cenar 🍽️",
"event": "Evento 🎉", "event": "Evento 🎉",
"festivals": "Festivales 🎪", "festivals": "Festivales 🎪",
"fitness": "Fitness 🏋️", "fitness": "Fitness 🏋️",
"general": "Generales 🌍", "general": "Generales 🌍",
"hiking": "Senderismo 🥾", "hiking": "Senderismo 🥾",
"historical_sites": "Sitios Históricos 🏛️", "historical_sites": "Sitios Históricos 🏛️",
"lodging": "Alojamiento 🛌", "lodging": "Alojamiento 🛌",
"music_concerts": "Música", "music_concerts": "Música",
"nightlife": "Vida nocturna 🌃", "nightlife": "Vida nocturna 🌃",
"other": "Otro", "other": "Otro",
"outdoor": "Al aire libre 🏞️", "outdoor": "Al aire libre 🏞️",
"shopping": "Compras 🛍️", "shopping": "Compras 🛍️",
"spiritual_journeys": "Viajes espirituales 🧘‍♀️", "spiritual_journeys": "Viajes espirituales 🧘‍♀️",
"transportation": "Transporte 🚗", "transportation": "Transporte 🚗",
"volunteer_work": "Trabajo voluntario 🤝", "volunteer_work": "Trabajo voluntario 🤝",
"water_sports": "Deportes acuáticos 🚤", "water_sports": "Deportes acuáticos 🚤",
"wildlife": "Vida silvestre 🦒" "wildlife": "Vida silvestre 🦒"
}, },
"no_image_found": "No se encontró ninguna imagen" "no_image_found": "No se encontró ninguna imagen",
} "adventure_details": "Detalles de la aventura",
"adventure_type": "Tipo de aventura",
"collection": "Recopilación",
"homepage": "Página principal",
"latitude": "Latitud",
"longitude": "Longitud",
"not_found": "Aventura no encontrada",
"not_found_desc": "La aventura que buscabas no se pudo encontrar. \nPruebe una aventura diferente o vuelva a consultar más tarde.",
"visit": "Visita",
"visits": "Visitas",
"adventure": "Aventura",
"count_txt": "resultados que coinciden con su búsqueda",
"create_new": "Crear nuevo...",
"ascending": "Ascendente",
"collection_adventures": "Incluir aventuras de colección",
"date": "Fecha",
"descending": "Descendente",
"filter": "Filtrar",
"name": "Nombre",
"order_by": "Ordenar por",
"order_direction": "Dirección del pedido",
"rating": "Clasificación",
"sort": "Clasificar",
"sources": "Fuentes",
"updated": "Actualizado",
"category_filter": "Filtro de categoría",
"clear": "Claro",
"archived_collections": "Colecciones archivadas",
"close_filters": "Cerrar filtros",
"my_collections": "Mis colecciones",
"open_filters": "Abrir filtros",
"private": "Privado",
"public": "Público",
"archived_collection_message": "¡Colección archivada exitosamente!",
"delete_collection": "Eliminar colección",
"delete_collection_success": "¡Colección eliminada exitosamente!",
"delete_collection_warning": "¿Estás seguro de que deseas eliminar esta colección? \nEsto también eliminará todas las aventuras vinculadas. \nEsta acción no se puede deshacer.",
"unarchived_collection_message": "¡Colección desarchivada exitosamente!",
"archive": "Archivo",
"archived": "Archivado",
"edit_collection": "Editar colección",
"share": "Compartir",
"unarchive": "Desarchivar",
"cancel": "Cancelar"
}
} }

View file

@ -7,6 +7,7 @@
import CategoryFilterDropdown from '$lib/components/CategoryFilterDropdown.svelte'; import CategoryFilterDropdown from '$lib/components/CategoryFilterDropdown.svelte';
import NotFound from '$lib/components/NotFound.svelte'; import NotFound from '$lib/components/NotFound.svelte';
import type { Adventure } from '$lib/types'; import type { Adventure } from '$lib/types';
import { t } from 'svelte-i18n';
import Plus from '~icons/mdi/plus'; import Plus from '~icons/mdi/plus';
@ -174,7 +175,7 @@
tabindex="0" tabindex="0"
class="dropdown-content z-[1] menu p-4 shadow bg-base-300 text-base-content rounded-box w-52 gap-4" class="dropdown-content z-[1] menu p-4 shadow bg-base-300 text-base-content rounded-box w-52 gap-4"
> >
<p class="text-center font-bold text-lg">Create new...</p> <p class="text-center font-bold text-lg">{$t('adventures.create_new')}</p>
<button <button
class="btn btn-primary" class="btn btn-primary"
on:click={() => { on:click={() => {
@ -182,7 +183,7 @@
adventureToEdit = null; adventureToEdit = null;
}} }}
> >
Adventure</button {$t('adventures.adventure')}</button
> >
<!-- <button <!-- <button
@ -198,8 +199,8 @@
<input id="my-drawer" type="checkbox" class="drawer-toggle" bind:checked={sidebarOpen} /> <input id="my-drawer" type="checkbox" class="drawer-toggle" bind:checked={sidebarOpen} />
<div class="drawer-content"> <div class="drawer-content">
<!-- Page content --> <!-- Page content -->
<h1 class="text-center font-bold text-4xl mb-6">My Adventures</h1> <h1 class="text-center font-bold text-4xl mb-6">{$t('navbar.my_adventures')}</h1>
<p class="text-center">This search returned {count} results.</p> <p class="text-center">{count} {$t('adventures.count_txt')}</p>
{#if adventures.length === 0} {#if adventures.length === 0}
<NotFound error={undefined} /> <NotFound error={undefined} />
{/if} {/if}
@ -208,7 +209,7 @@
class="btn btn-primary drawer-button lg:hidden mb-4 fixed bottom-0 left-0 ml-2 z-[999]" class="btn btn-primary drawer-button lg:hidden mb-4 fixed bottom-0 left-0 ml-2 z-[999]"
on:click={toggleSidebar} on:click={toggleSidebar}
> >
{sidebarOpen ? 'Close Filters' : 'Open Filters'} {sidebarOpen ? $t(`adventures.close_filters`) : $t(`adventures.open_filters`)}
</button> </button>
<div class="flex flex-wrap gap-4 mr-4 justify-center content-center"> <div class="flex flex-wrap gap-4 mr-4 justify-center content-center">
@ -250,8 +251,8 @@
<form method="get"> <form method="get">
<CategoryFilterDropdown bind:types={typeString} /> <CategoryFilterDropdown bind:types={typeString} />
<div class="divider"></div> <div class="divider"></div>
<h3 class="text-center font-bold text-lg mb-4">Sort</h3> <h3 class="text-center font-bold text-lg mb-4">{$t('adventures.sort')}</h3>
<p class="text-lg font-semibold mb-2">Order Direction</p> <p class="text-lg font-semibold mb-2">{$t('adventures.order_direction')}</p>
<div class="join"> <div class="join">
<input <input
class="join-item btn btn-neutral" class="join-item btn btn-neutral"
@ -259,7 +260,7 @@
name="order_direction" name="order_direction"
id="asc" id="asc"
value="asc" value="asc"
aria-label="Ascending" aria-label={$t('adventures.ascending')}
checked={currentSort.order === 'asc'} checked={currentSort.order === 'asc'}
/> />
<input <input
@ -268,55 +269,55 @@
name="order_direction" name="order_direction"
id="desc" id="desc"
value="desc" value="desc"
aria-label="Descending" aria-label={$t('adventures.descending')}
checked={currentSort.order === 'desc'} checked={currentSort.order === 'desc'}
/> />
</div> </div>
<br /> <br />
<p class="text-lg font-semibold mt-2 mb-2">Order By</p> <p class="text-lg font-semibold mt-2 mb-2">{$t('adventures.order_by')}</p>
<div class="flex join overflow-auto"> <div class="flex flex-wrap gap-2">
<input <input
class="join-item btn btn-neutral" class="btn btn-neutral text-wrap"
type="radio" type="radio"
name="order_by" name="order_by"
id="updated_at" id="updated_at"
value="updated_at" value="updated_at"
aria-label="Updated" aria-label={$t('adventures.updated')}
checked={currentSort.order_by === 'updated_at'} checked={currentSort.order_by === 'updated_at'}
/> />
<input <input
class="join-item btn btn-neutral" class="btn btn-neutral text-wrap"
type="radio" type="radio"
name="order_by" name="order_by"
id="name" id="name"
aria-label="Name" aria-label={$t('adventures.name')}
value="name" value="name"
checked={currentSort.order_by === 'name'} checked={currentSort.order_by === 'name'}
/> />
<input <input
class="join-item btn btn-neutral" class="btn btn-neutral text-wrap"
type="radio" type="radio"
value="date" value="date"
name="order_by" name="order_by"
id="date" id="date"
aria-label="Date" aria-label={$t('adventures.date')}
checked={currentSort.order_by === 'date'} checked={currentSort.order_by === 'date'}
/> />
<input <input
class="join-item btn btn-neutral" class="btn btn-neutral text-wrap"
type="radio" type="radio"
name="order_by" name="order_by"
id="rating" id="rating"
aria-label="Rating" aria-label={$t('adventures.rating')}
value="rating" value="rating"
checked={currentSort.order_by === 'rating'} checked={currentSort.order_by === 'rating'}
/> />
</div> </div>
<br /> <br />
<p class="text-lg font-semibold mt-2 mb-2">Sources</p> <p class="text-lg font-semibold mt-2 mb-2">{$t('adventures.sources')}</p>
<label class="label cursor-pointer"> <label class="label cursor-pointer">
<span class="label-text">Include Collection Adventures</span> <span class="label-text">{$t('adventures.collection_adventures')}</span>
<input <input
type="checkbox" type="checkbox"
name="include_collections" name="include_collections"
@ -325,7 +326,7 @@
checked={currentSort.includeCollections} checked={currentSort.includeCollections}
/> />
</label> </label>
<button type="submit" class="btn btn-success mt-4">Filter</button> <button type="submit" class="btn btn-success mt-4">{$t('adventures.filter')}</button>
</form> </form>
</div> </div>
</ul> </ul>
@ -333,6 +334,6 @@
</div> </div>
<svelte:head> <svelte:head>
<title>Adventures</title> <title>{$t('navbar.adventures')}</title>
<meta name="description" content="View your completed and planned adventures." /> <meta name="description" content="View your completed and planned adventures." />
</svelte:head> </svelte:head>

View file

@ -49,14 +49,15 @@
<img src={Lost} alt="Lost" class="w-1/2" /> <img src={Lost} alt="Lost" class="w-1/2" />
</div> </div>
<h1 class="mt-4 text-3xl font-bold tracking-tight text-foreground sm:text-4xl"> <h1 class="mt-4 text-3xl font-bold tracking-tight text-foreground sm:text-4xl">
Adventure not Found {$t('adventures.not_found')}
</h1> </h1>
<p class="mt-4 text-muted-foreground"> <p class="mt-4 text-muted-foreground">
The adventure you were looking for could not be found. Please try a different adventure or {$t('adventures.not_found_desc')}
check back later.
</p> </p>
<div class="mt-6"> <div class="mt-6">
<button class="btn btn-primary" on:click={() => goto('/')}>Homepage</button> <button class="btn btn-primary" on:click={() => goto('/')}
>{$t('adventures.homepage')}</button
>
</div> </div>
</div> </div>
</div> </div>
@ -258,18 +259,18 @@
></div> ></div>
<div class="grid gap-8"> <div class="grid gap-8">
<div> <div>
<h2 class="text-2xl font-bold mt-4">Adventure Details</h2> <h2 class="text-2xl font-bold mt-4">{$t('adventures.adventure_details')}</h2>
<div class="grid gap-4 mt-4"> <div class="grid gap-4 mt-4">
<div class="grid md:grid-cols-2 gap-4"> <div class="grid md:grid-cols-2 gap-4">
<div> <div>
<p class="text-sm text-muted-foreground">Adventure Type</p> <p class="text-sm text-muted-foreground">{$t('adventures.adventure_type')}</p>
<p class="text-base font-medium"> <p class="text-base font-medium">
{$t(`adventures.activities.${adventure.type}`)} {$t(`adventures.activities.${adventure.type}`)}
</p> </p>
</div> </div>
{#if data.props.collection} {#if data.props.collection}
<div> <div>
<p class="text-sm text-muted-foreground">Collection</p> <p class="text-sm text-muted-foreground">{$t('adventures.collection')}</p>
<a <a
class="text-base font-medium link" class="text-base font-medium link"
href="/collections/{data.props.collection.id}">{data.props.collection.name}</a href="/collections/{data.props.collection.id}">{data.props.collection.name}</a
@ -281,7 +282,9 @@
<p class="text-sm text-muted-foreground">Visits</p> <p class="text-sm text-muted-foreground">Visits</p>
<p class="text-base font-medium"> <p class="text-base font-medium">
{adventure.visits.length} {adventure.visits.length}
{adventure.visits.length > 1 ? 'visits' : 'visit' + ':'} {adventure.visits.length > 1
? $t('adventures.visits')
: $t('adventures.visit') + ':'}
</p> </p>
<!-- show each visit start and end date as well as notes --> <!-- show each visit start and end date as well as notes -->
{#each adventure.visits as visit} {#each adventure.visits as visit}
@ -310,11 +313,11 @@
{#if adventure.longitude && adventure.latitude} {#if adventure.longitude && adventure.latitude}
<div class="grid md:grid-cols-2 gap-4"> <div class="grid md:grid-cols-2 gap-4">
<div> <div>
<p class="text-sm text-muted-foreground">Latitude</p> <p class="text-sm text-muted-foreground">{$t('adventures.latitude')}</p>
<p class="text-base font-medium">{adventure.latitude}° N</p> <p class="text-base font-medium">{adventure.latitude}° N</p>
</div> </div>
<div> <div>
<p class="text-sm text-muted-foreground">Longitude</p> <p class="text-sm text-muted-foreground">{$t('adventures.longitude')}</p>
<p class="text-base font-medium">{adventure.longitude}° W</p> <p class="text-base font-medium">{adventure.longitude}° W</p>
</div> </div>
</div> </div>
@ -336,13 +339,6 @@
<p class="font-semibold text-black text-md"> <p class="font-semibold text-black text-md">
{adventure.type.charAt(0).toUpperCase() + adventure.type.slice(1)} {adventure.type.charAt(0).toUpperCase() + adventure.type.slice(1)}
</p> </p>
<p>
<!-- {adventure.date
? new Date(adventure.date).toLocaleDateString(undefined, {
timeZone: 'UTC'
})
: ''} -->
</p>
{#if adventure.visits.length > 0} {#if adventure.visits.length > 0}
<p class="text-black text-sm"> <p class="text-black text-sm">
{#each adventure.visits as visit} {#each adventure.visits as visit}

View file

@ -6,6 +6,7 @@
import NewCollection from '$lib/components/NewCollection.svelte'; import NewCollection from '$lib/components/NewCollection.svelte';
import NotFound from '$lib/components/NotFound.svelte'; import NotFound from '$lib/components/NotFound.svelte';
import type { Collection } from '$lib/types'; import type { Collection } from '$lib/types';
import { t } from 'svelte-i18n';
import Plus from '~icons/mdi/plus'; import Plus from '~icons/mdi/plus';
@ -142,7 +143,7 @@
tabindex="0" tabindex="0"
class="dropdown-content z-[1] menu p-4 shadow bg-base-300 text-base-content rounded-box w-52 gap-4" class="dropdown-content z-[1] menu p-4 shadow bg-base-300 text-base-content rounded-box w-52 gap-4"
> >
<p class="text-center font-bold text-lg">Create new...</p> <p class="text-center font-bold text-lg">{$t(`adventures.create_new`)}</p>
<button <button
class="btn btn-primary" class="btn btn-primary"
on:click={() => { on:click={() => {
@ -150,7 +151,7 @@
newType = 'visited'; newType = 'visited';
}} }}
> >
Collection</button {$t(`adventures.collection`)}</button
> >
<!-- <button <!-- <button
@ -166,8 +167,8 @@
<input id="my-drawer" type="checkbox" class="drawer-toggle" bind:checked={sidebarOpen} /> <input id="my-drawer" type="checkbox" class="drawer-toggle" bind:checked={sidebarOpen} />
<div class="drawer-content"> <div class="drawer-content">
<!-- Page content --> <!-- Page content -->
<h1 class="text-center font-bold text-4xl mb-6">My Collections</h1> <h1 class="text-center font-bold text-4xl mb-6">{$t(`adventures.my_collections`)}</h1>
<p class="text-center">This search returned {count} results.</p> <p class="text-center">{count} {$t(`adventures.count_txt`)}</p>
{#if collections.length === 0} {#if collections.length === 0}
<NotFound error={undefined} /> <NotFound error={undefined} />
{/if} {/if}
@ -176,7 +177,7 @@
class="btn btn-primary drawer-button lg:hidden mb-4 fixed bottom-0 left-0 ml-2 z-[999]" class="btn btn-primary drawer-button lg:hidden mb-4 fixed bottom-0 left-0 ml-2 z-[999]"
on:click={toggleSidebar} on:click={toggleSidebar}
> >
{sidebarOpen ? 'Close Filters' : 'Open Filters'} {sidebarOpen ? $t(`adventures.close_filters`) : $t(`adventures.open_filters`)}
</button> </button>
<div class="flex flex-wrap gap-4 mr-4 justify-center content-center"> <div class="flex flex-wrap gap-4 mr-4 justify-center content-center">
@ -217,8 +218,8 @@
<!-- Sidebar content here --> <!-- Sidebar content here -->
<div class="form-control"> <div class="form-control">
<form action="?/get" method="post" use:enhance={handleSubmit}> <form action="?/get" method="post" use:enhance={handleSubmit}>
<h3 class="text-center font-semibold text-lg mb-4">Sort</h3> <h3 class="text-center font-semibold text-lg mb-4">{$t(`adventures.sort`)}</h3>
<p class="text-lg font-semibold mb-2">Order Direction</p> <p class="text-lg font-semibold mb-2">{$t(`adventures.order_direction`)}</p>
<div class="join"> <div class="join">
<input <input
class="join-item btn btn-neutral" class="join-item btn btn-neutral"
@ -226,7 +227,7 @@
name="order_direction" name="order_direction"
id="asc" id="asc"
value="asc" value="asc"
aria-label="Ascending" aria-label={$t(`adventures.ascending`)}
checked checked
/> />
<input <input
@ -235,7 +236,7 @@
name="order_direction" name="order_direction"
id="desc" id="desc"
value="desc" value="desc"
aria-label="Descending" aria-label={$t(`adventures.descending`)}
/> />
</div> </div>
<br /> <br />
@ -249,13 +250,16 @@
value="name" value="name"
hidden hidden
/> />
<button type="submit" class="btn btn-success btn-primary mt-4">Sort</button> <button type="submit" class="btn btn-success btn-primary mt-4"
>{$t(`adventures.sort`)}</button
>
</form> </form>
<div class="divider"></div> <div class="divider"></div>
<button <button
type="submit" type="submit"
class="btn btn-neutral btn-primary mt-4" class="btn btn-neutral btn-primary mt-4"
on:click={() => goto('/collections/archived')}>Archived Collections</button on:click={() => goto('/collections/archived')}
>{$t(`adventures.archived_collections`)}</button
> >
</div> </div>
</ul> </ul>
@ -263,6 +267,6 @@
</div> </div>
<svelte:head> <svelte:head>
<title>Collections</title> <title>{$t(`navbar.collections`)}</title>
<meta name="description" content="View your adventure collections." /> <meta name="description" content="View your adventure collections." />
</svelte:head> </svelte:head>