✨ add german translation

This commit is contained in:
anbraten committed 2026-09-24 20:28:05 +02:00
1 parent 99a9f908f1
commit c78920ba6e
15 files changed
+3282 -4101

No files matched your search

+3 -2
View File
@@ -1,6 +1,7 @@
<script setup lang="ts">
import type { ExpenseView, PotView } from '~/types';
const { t } = useI18n();
const route = useRoute();
const slug = route.params.slug as string;
const { name } = useIdentity();
@@ -55,7 +56,7 @@ function cancelExpenseForm() {
}
async function removeExpense(id: number) {
if (!confirm('Delete this expense?')) return;
if (!confirm(t('expenses.deleteConfirm'))) return;
await $fetch(`/api/pots/${slug}/expenses/${id}`, { method: 'DELETE' });
await refresh();
}
@@ -88,7 +89,7 @@ async function removeExpense(id: number) {
class="w-full rounded-xl bg-orange-500 px-4 py-2 font-medium text-white shadow-sm transition-colors hover:bg-orange-600"
@click="newExpense"
>
+ Add expense
{{ t('expenses.addExpense') }}
</button>
</section>
</template>
+17 -12
View File
@@ -1,6 +1,7 @@
<script setup lang="ts">
import type { PotView } from '~/types';
const { t } = useI18n();
const route = useRoute();
const slug = route.params.slug as string;
@@ -25,7 +26,7 @@ async function addParticipant(participantName: string) {
}
async function removeParticipant(participant: { id: number; name: string }) {
if (!confirm(`Remove ${participant.name} from this Pot?`)) return;
if (!confirm(t('settings.removeConfirm', { name: participant.name }))) return;
removeError.value = '';
removingId.value = participant.id;
@@ -35,7 +36,7 @@ async function removeParticipant(participant: { id: number; name: string }) {
});
await refresh();
} catch {
removeError.value = `Couldn't remove ${participant.name}. They may have expenses or payments recorded.`;
removeError.value = t('settings.removeError', { name: participant.name });
} finally {
removingId.value = null;
}
@@ -44,9 +45,9 @@ async function removeParticipant(participant: { id: number; name: string }) {
<template>
<div v-if="error" class="space-y-3 text-center">
<p class="text-rose-600 dark:text-rose-400">This Pot couldn't be found.</p>
<p class="text-rose-600 dark:text-rose-400">{{ t('pot.notFound') }}</p>
<NuxtLink to="/" class="font-medium text-orange-600 dark:text-orange-400">
Go home
{{ t('pot.goHome') }}
</NuxtLink>
</div>
@@ -55,7 +56,7 @@ async function removeParticipant(participant: { id: number; name: string }) {
<NuxtLink
:to="`/p/${slug}`"
class="flex h-9 w-9 shrink-0 items-center justify-center rounded-xl border border-stone-300 text-stone-600 transition-colors hover:border-orange-300 hover:text-orange-600 dark:border-stone-700 dark:text-stone-300 dark:hover:border-orange-700 dark:hover:text-orange-400"
aria-label="Back to Pot"
:aria-label="t('settings.backToPot')"
>
<svg class="h-4.5 w-4.5" viewBox="0 0 20 20" fill="currentColor">
<path
@@ -67,7 +68,7 @@ async function removeParticipant(participant: { id: number; name: string }) {
</NuxtLink>
<div>
<h1 class="text-lg font-bold text-stone-900 dark:text-stone-100">
Pot settings
{{ t('settings.title') }}
</h1>
<p class="text-sm text-stone-500 dark:text-stone-400">
{{ data.pot.name }} · {{ data.pot.currency }}
@@ -79,7 +80,7 @@ async function removeParticipant(participant: { id: number; name: string }) {
<h2
class="text-sm font-semibold uppercase tracking-wide text-stone-500 dark:text-stone-400"
>
Participants
{{ t('settings.participants') }}
</h2>
<ul class="space-y-2">
<li
@@ -102,14 +103,18 @@ async function removeParticipant(participant: { id: number; name: string }) {
class="shrink-0 text-sm font-medium text-rose-600 disabled:opacity-50 dark:text-rose-400"
@click="removeParticipant(participant)"
>
{{ removingId === participant.id ? 'Removing…' : 'Remove' }}
{{
removingId === participant.id
? t('settings.removing')
: t('settings.remove')
}}
</button>
</li>
<li
v-if="data.participants.length === 0"
class="rounded-2xl border border-dashed border-stone-300 p-4 text-center text-sm text-stone-500 dark:border-stone-700 dark:text-stone-400"
>
No one's in this Pot yet.
{{ t('settings.noParticipants') }}
</li>
</ul>
<p v-if="removeError" class="text-sm text-rose-600 dark:text-rose-400">
@@ -123,11 +128,11 @@ async function removeParticipant(participant: { id: number; name: string }) {
<h2
class="text-sm font-semibold uppercase tracking-wide text-stone-500 dark:text-stone-400"
>
Add a participant
{{ t('settings.addParticipant') }}
</h2>
<NameForm
title="Name"
:button-label="adding ? 'Adding…' : 'Add'"
:title="t('settings.nameLabel')"
:button-label="adding ? t('settings.adding') : t('settings.add')"
@submit="addParticipant"
/>
</section>
+7 -6
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
const { t } = useI18n();
const route = useRoute();
const slug = route.params.slug as string;
@@ -34,10 +35,10 @@ function skip() {
<div class="space-y-1 text-center">
<div class="text-3xl">👋</div>
<h1 class="text-xl font-bold text-stone-900 dark:text-stone-100">
Add the rest of the group
{{ t('setup.title') }}
</h1>
<p class="text-sm text-stone-500 dark:text-stone-400">
Add everyone else's name now, or skip and add them later from settings.
{{ t('setup.subtitle') }}
</p>
</div>
@@ -48,7 +49,7 @@ function skip() {
v-model="names[index]"
type="text"
class="block w-full rounded-xl border border-stone-300 bg-white px-3 py-2 text-base text-stone-900 shadow-sm placeholder:text-stone-400 focus:border-orange-400 focus:outline-none focus:ring-2 focus:ring-orange-200 dark:border-stone-700 dark:bg-stone-900 dark:text-stone-100 dark:placeholder:text-stone-500 dark:focus:ring-orange-900"
placeholder="Participant name"
:placeholder="t('setup.placeholder')"
/>
</div>
@@ -57,7 +58,7 @@ function skip() {
class="w-full rounded-xl border border-dashed border-stone-300 px-4 py-2 text-sm font-medium text-stone-600 transition-colors hover:border-orange-300 hover:text-orange-600 dark:border-stone-700 dark:text-stone-400 dark:hover:border-orange-700 dark:hover:text-orange-400"
@click="addRow"
>
+ Add another
{{ t('setup.addAnother') }}
</button>
<div class="flex gap-3">
@@ -66,7 +67,7 @@ function skip() {
class="flex-1 rounded-xl border border-stone-300 px-4 py-2 font-medium text-stone-700 dark:border-stone-700 dark:text-stone-300"
@click="skip"
>
Skip
{{ t('setup.skip') }}
</button>
<button
type="button"
@@ -74,7 +75,7 @@ function skip() {
class="flex-1 rounded-xl bg-orange-500 px-4 py-2 font-medium text-white shadow-sm transition-colors hover:bg-orange-600 active:bg-orange-600 disabled:opacity-50"
@click="continueToPot"
>
{{ saving ? 'Saving…' : 'Continue' }}
{{ saving ? t('setup.saving') : t('setup.continue') }}
</button>
</div>
</div>