diff --git a/frontend/src/lib/components/ChecklistCard.svelte b/frontend/src/lib/components/ChecklistCard.svelte index 1cdd979..40741d1 100644 --- a/frontend/src/lib/components/ChecklistCard.svelte +++ b/frontend/src/lib/components/ChecklistCard.svelte @@ -3,6 +3,7 @@ import type { Checklist, Collection, User } from '$lib/types'; import { createEventDispatcher } from 'svelte'; const dispatch = createEventDispatcher(); + import { t } from 'svelte-i18n'; import Launch from '~icons/mdi/launch'; import TrashCan from '~icons/mdi/trash-can'; @@ -21,10 +22,10 @@ method: 'DELETE' }); if (res.ok) { - addToast('success', 'Checklist deleted successfully'); + addToast('success', $t('checklist.checklist_deleted')); dispatch('delete', checklist.id); } else { - addToast('Failed to delete checklist', 'error'); + addToast($t('checklist.checklist_delete_error'), 'error'); } } @@ -38,9 +39,12 @@ {checklist.name} -
Checklist
+
{$t('adventures.checklist')}
{#if checklist.items.length > 0} -

{checklist.items.length} {checklist.items.length > 1 ? 'Items' : 'Item'}

+

+ {checklist.items.length} + {checklist.items.length > 1 ? $t('checklist.items') : $t('checklist.item')} +

{/if} {#if checklist.date && checklist.date !== ''}
@@ -49,11 +53,8 @@
{/if}
- {#if checklist.user_id == user?.pk || (collection && user && collection.shared_with.includes(user.uuid))}
{#if items.length > 0}
-

Items

+

{$t('checklist.items')}

{/if} {#each items as item, i} @@ -202,7 +202,7 @@ class="btn btn-sm btn-error absolute right-0 mt-2.5 mr-4" on:click={() => removeItem(i)} > - Remove + {$t('adventures.remove')} {/each} @@ -226,8 +226,8 @@ {/if} - - + + {#if collection.is_public} {/if} {:else}
- +
- + 0}
-

Items

+

{$t('checklist.items')}

{/if} {#each items as item, i} @@ -299,7 +299,7 @@
{/each} - +
{/if} diff --git a/frontend/src/lib/components/EditCollection.svelte b/frontend/src/lib/components/EditCollection.svelte index e46d251..6c96bc8 100644 --- a/frontend/src/lib/components/EditCollection.svelte +++ b/frontend/src/lib/components/EditCollection.svelte @@ -1,7 +1,8 @@ @@ -96,7 +97,7 @@