✨ 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

+10 -9
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
const { t } = useI18n();
const { name, setName } = useIdentity();
const { pots: visitedPots } = useVisitedPots();
@@ -24,7 +25,7 @@ async function createPot() {
});
await navigateTo(`/p/${pot.slug}/setup`);
} catch {
error.value = 'Could not create the Pot. Please try again.';
error.value = t('home.createError');
} finally {
creating.value = false;
}
@@ -36,16 +37,16 @@ async function createPot() {
<div class="space-y-1 text-center">
<div class="text-4xl">🍯</div>
<h1 class="text-2xl font-bold text-stone-900 dark:text-stone-100">
Splitt the Bill
{{ t('home.title') }}
</h1>
<p class="text-sm text-stone-500 dark:text-stone-400">
Track shared costs with friends, the easy way.
{{ t('home.subtitle') }}
</p>
</div>
<section v-if="visitedPots.length" class="space-y-2">
<h2 class="text-sm font-semibold text-stone-500 dark:text-stone-400">
Your Pots
{{ t('home.yourPots') }}
</h2>
<ul class="space-y-2">
<li v-for="pot in visitedPots" :key="pot.slug">
@@ -73,14 +74,14 @@ async function createPot() {
@submit.prevent="createPot"
>
<p class="text-sm text-stone-600 dark:text-stone-400">
Hi {{ name }}! Create a new Pot to start splitting costs.
{{ t('home.greeting', { name }) }}
</p>
<div>
<label
for="pot-name"
class="block text-sm font-medium text-stone-700 dark:text-stone-300"
>Pot name</label
>{{ t('home.potNameLabel') }}</label
>
<input
id="pot-name"
@@ -88,7 +89,7 @@ async function createPot() {
type="text"
required
class="mt-1 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-950 dark:text-stone-100 dark:placeholder:text-stone-500 dark:focus:ring-orange-900"
placeholder="Weekend in Lisbon"
:placeholder="t('home.potNamePlaceholder')"
/>
</div>
@@ -96,7 +97,7 @@ async function createPot() {
<label
for="currency"
class="block text-sm font-medium text-stone-700 dark:text-stone-300"
>Currency</label
>{{ t('home.currencyLabel') }}</label
>
<select
id="currency"
@@ -118,7 +119,7 @@ async function createPot() {
:disabled="creating"
class="w-full 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"
>
{{ creating ? 'Creating…' : 'Create Pot' }}
{{ creating ? t('home.creating') : t('home.createPot') }}
</button>
</form>
</div>
+11 -10
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;
const { name, setName } = useIdentity();
@@ -53,15 +54,15 @@ async function copyLink() {
<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>
<NameForm
v-else-if="!name && isPotTab"
title="What's your name?"
:title="t('pot.whatIsYourName')"
@submit="setName"
/>
@@ -78,7 +79,7 @@ async function copyLink() {
clip-rule="evenodd"
/>
</svg>
All Pots
{{ t('pot.allPots') }}
</NuxtLink>
<div class="flex items-start justify-between gap-2">
@@ -96,12 +97,12 @@ async function copyLink() {
class="rounded-xl border border-stone-300 px-3 py-1.5 text-sm font-medium text-stone-700 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"
@click="copyLink"
>
{{ linkCopied ? 'Copied!' : 'Copy link' }}
{{ linkCopied ? t('pot.linkCopied') : t('pot.copyLink') }}
</button>
<NuxtLink
:to="`/p/${slug}/settings`"
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="Pot settings"
:aria-label="t('pot.settingsLabel')"
>
<svg class="h-4.5 w-4.5" viewBox="0 0 20 20" fill="currentColor">
<path
@@ -119,14 +120,14 @@ async function copyLink() {
class="rounded-2xl border border-orange-200 bg-orange-50 p-4 text-sm dark:border-orange-900 dark:bg-orange-950/40"
>
<p class="mb-2 text-stone-700 dark:text-stone-300">
You're not in this Pot's participant list yet.
{{ t('pot.notInPot') }}
</p>
<button
type="button"
class="rounded-xl bg-orange-500 px-3 py-1.5 font-medium text-white shadow-sm transition-colors hover:bg-orange-600"
@click="addMyself"
>
Add myself as {{ name }}
{{ t('pot.addMyself', { name }) }}
</button>
</div>
@@ -142,7 +143,7 @@ async function copyLink() {
: 'text-stone-500 hover:text-stone-700 dark:text-stone-400 dark:hover:text-stone-200'
"
>
People &amp; balances
{{ t('pot.tabPeople') }}
</NuxtLink>
<NuxtLink
:to="`/p/${slug}/expenses`"
@@ -153,7 +154,7 @@ async function copyLink() {
: 'text-stone-500 hover:text-stone-700 dark:text-stone-400 dark:hover:text-stone-200'
"
>
Expenses
{{ t('pot.tabExpenses') }}
</NuxtLink>
</div>
</template>
+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>