✨ add german translation
This commit is contained in:
15 files changed
+3282
-4101
No files matched your search
+19
@@ -1,9 +1,28 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
const { locale, locales, setLocale } = useI18n();
|
||||||
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="min-h-screen bg-orange-50/40 text-stone-900 dark:bg-stone-950 dark:text-stone-100"
|
class="min-h-screen bg-orange-50/40 text-stone-900 dark:bg-stone-950 dark:text-stone-100"
|
||||||
>
|
>
|
||||||
<NuxtRouteAnnouncer />
|
<NuxtRouteAnnouncer />
|
||||||
<main class="mx-auto max-w-md px-4 py-8">
|
<main class="mx-auto max-w-md px-4 py-8">
|
||||||
|
<div class="mb-4 flex justify-end">
|
||||||
|
<select
|
||||||
|
:value="locale"
|
||||||
|
class="rounded-lg border border-stone-300 bg-white px-2 py-1 text-xs font-medium text-stone-600 shadow-sm dark:border-stone-700 dark:bg-stone-900 dark:text-stone-300"
|
||||||
|
@change="
|
||||||
|
setLocale(
|
||||||
|
($event.target as HTMLSelectElement).value as typeof locale,
|
||||||
|
)
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<option v-for="loc in locales" :key="loc.code" :value="loc.code">
|
||||||
|
{{ loc.name }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
<NuxtPage />
|
<NuxtPage />
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ const emit = defineEmits<{
|
|||||||
cancel: [];
|
cancel: [];
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
|
||||||
const description = ref(props.editing?.description ?? '');
|
const description = ref(props.editing?.description ?? '');
|
||||||
const amount = ref(
|
const amount = ref(
|
||||||
props.editing ? fromCents(props.editing.amountCents).toString() : '',
|
props.editing ? fromCents(props.editing.amountCents).toString() : '',
|
||||||
@@ -45,15 +47,15 @@ function onSubmit() {
|
|||||||
const amountCents = toCents(Number(amount.value));
|
const amountCents = toCents(Number(amount.value));
|
||||||
|
|
||||||
if (!description.value.trim()) {
|
if (!description.value.trim()) {
|
||||||
error.value = 'Description is required.';
|
error.value = t('expenseForm.errorDescriptionRequired');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!Number.isFinite(amountCents) || amountCents <= 0) {
|
if (!Number.isFinite(amountCents) || amountCents <= 0) {
|
||||||
error.value = 'Enter a valid amount.';
|
error.value = t('expenseForm.errorInvalidAmount');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (selectedIds.value.length === 0) {
|
if (selectedIds.value.length === 0) {
|
||||||
error.value = 'Select at least one participant to split with.';
|
error.value = t('expenseForm.errorSelectParticipant');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,7 +77,7 @@ function onSubmit() {
|
|||||||
<label
|
<label
|
||||||
for="description"
|
for="description"
|
||||||
class="block text-sm font-medium text-stone-700 dark:text-stone-300"
|
class="block text-sm font-medium text-stone-700 dark:text-stone-300"
|
||||||
>Description</label
|
>{{ t('expenseForm.descriptionLabel') }}</label
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
id="description"
|
id="description"
|
||||||
@@ -83,7 +85,7 @@ function onSubmit() {
|
|||||||
type="text"
|
type="text"
|
||||||
required
|
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"
|
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="Dinner, taxi, groceries…"
|
:placeholder="t('expenseForm.descriptionPlaceholder')"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -92,7 +94,7 @@ function onSubmit() {
|
|||||||
for="amount"
|
for="amount"
|
||||||
class="block text-sm font-medium text-stone-700 dark:text-stone-300"
|
class="block text-sm font-medium text-stone-700 dark:text-stone-300"
|
||||||
>
|
>
|
||||||
Amount ({{ currency }})
|
{{ t('expenseForm.amountLabel', { currency }) }}
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
id="amount"
|
id="amount"
|
||||||
@@ -102,7 +104,7 @@ function onSubmit() {
|
|||||||
min="0.01"
|
min="0.01"
|
||||||
required
|
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"
|
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="0.00"
|
:placeholder="t('expenseForm.amountPlaceholder')"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -110,7 +112,7 @@ function onSubmit() {
|
|||||||
<label
|
<label
|
||||||
for="payer"
|
for="payer"
|
||||||
class="block text-sm font-medium text-stone-700 dark:text-stone-300"
|
class="block text-sm font-medium text-stone-700 dark:text-stone-300"
|
||||||
>Paid by</label
|
>{{ t('expenseForm.paidByLabel') }}</label
|
||||||
>
|
>
|
||||||
<select
|
<select
|
||||||
id="payer"
|
id="payer"
|
||||||
@@ -128,8 +130,9 @@ function onSubmit() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<span class="block text-sm font-medium text-stone-700 dark:text-stone-300"
|
<span
|
||||||
>Split equally among</span
|
class="block text-sm font-medium text-stone-700 dark:text-stone-300"
|
||||||
|
>{{ t('expenseForm.splitEquallyLabel') }}</span
|
||||||
>
|
>
|
||||||
<div class="mt-2 flex flex-wrap gap-2">
|
<div class="mt-2 flex flex-wrap gap-2">
|
||||||
<button
|
<button
|
||||||
@@ -159,13 +162,15 @@ function onSubmit() {
|
|||||||
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"
|
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="emit('cancel')"
|
@click="emit('cancel')"
|
||||||
>
|
>
|
||||||
Cancel
|
{{ t('common.cancel') }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
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"
|
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"
|
||||||
>
|
>
|
||||||
{{ editing ? 'Save changes' : 'Add expense' }}
|
{{
|
||||||
|
editing ? t('expenseForm.saveChanges') : t('expenseForm.addExpense')
|
||||||
|
}}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ const props = defineProps<{
|
|||||||
|
|
||||||
const emit = defineEmits<{ settled: []; updated: [] }>();
|
const emit = defineEmits<{ settled: []; updated: [] }>();
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
const { lastLink, rememberLink } = usePaymentLinkCache();
|
const { lastLink, rememberLink } = usePaymentLinkCache();
|
||||||
|
|
||||||
const showSettlements = ref(false);
|
const showSettlements = ref(false);
|
||||||
@@ -22,7 +23,9 @@ const editError = ref('');
|
|||||||
const savingLink = ref(false);
|
const savingLink = ref(false);
|
||||||
|
|
||||||
function nameOf(id: number) {
|
function nameOf(id: number) {
|
||||||
return props.participants.find((p) => p.id === id)?.name ?? 'Unknown';
|
return (
|
||||||
|
props.participants.find((p) => p.id === id)?.name ?? t('common.unknown')
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function paymentLinkOf(id: number) {
|
function paymentLinkOf(id: number) {
|
||||||
@@ -51,7 +54,7 @@ function cancelEdit() {
|
|||||||
async function saveEdit(participant: ParticipantView) {
|
async function saveEdit(participant: ParticipantView) {
|
||||||
const trimmed = editValue.value.trim();
|
const trimmed = editValue.value.trim();
|
||||||
if (trimmed && !isValidPaymentLink(trimmed)) {
|
if (trimmed && !isValidPaymentLink(trimmed)) {
|
||||||
editError.value = 'Enter a valid link starting with http:// or https://.';
|
editError.value = t('balances.invalidLink');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
savingLink.value = true;
|
savingLink.value = true;
|
||||||
@@ -93,7 +96,7 @@ async function markSettled(settlement: SettlementView) {
|
|||||||
v-if="participants.length === 0"
|
v-if="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"
|
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. Add people from the settings page.
|
{{ t('balances.empty') }}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<ul v-else class="space-y-2">
|
<ul v-else class="space-y-2">
|
||||||
@@ -131,7 +134,7 @@ async function markSettled(settlement: SettlementView) {
|
|||||||
class="text-xs font-medium text-orange-600 hover:underline dark:text-orange-400"
|
class="text-xs font-medium text-orange-600 hover:underline dark:text-orange-400"
|
||||||
@click.stop
|
@click.stop
|
||||||
>
|
>
|
||||||
Payment link
|
{{ t('balances.paymentLink') }}
|
||||||
</a>
|
</a>
|
||||||
<span
|
<span
|
||||||
class="text-sm font-semibold"
|
class="text-sm font-semibold"
|
||||||
@@ -145,7 +148,7 @@ async function markSettled(settlement: SettlementView) {
|
|||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<template v-if="(netBalances[participant.id] ?? 0) === 0">
|
<template v-if="(netBalances[participant.id] ?? 0) === 0">
|
||||||
settled up
|
{{ t('balances.settledUp') }}
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
{{ (netBalances[participant.id] ?? 0) > 0 ? '+' : '−'
|
{{ (netBalances[participant.id] ?? 0) > 0 ? '+' : '−'
|
||||||
@@ -167,13 +170,13 @@ async function markSettled(settlement: SettlementView) {
|
|||||||
<label
|
<label
|
||||||
class="block text-xs font-medium text-stone-500 dark:text-stone-400"
|
class="block text-xs font-medium text-stone-500 dark:text-stone-400"
|
||||||
>
|
>
|
||||||
Payment link for {{ participant.name }}
|
{{ t('balances.paymentLinkLabelFor', { name: participant.name }) }}
|
||||||
</label>
|
</label>
|
||||||
<div class="flex gap-2">
|
<div class="flex gap-2">
|
||||||
<input
|
<input
|
||||||
v-model="editValue"
|
v-model="editValue"
|
||||||
type="url"
|
type="url"
|
||||||
placeholder="https://paypal.me/yourname"
|
:placeholder="t('balances.paymentLinkPlaceholder')"
|
||||||
class="block w-full rounded-xl border border-stone-300 bg-white px-3 py-2 text-sm 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"
|
class="block w-full rounded-xl border border-stone-300 bg-white px-3 py-2 text-sm 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"
|
||||||
@keyup.enter="saveEdit(participant)"
|
@keyup.enter="saveEdit(participant)"
|
||||||
/>
|
/>
|
||||||
@@ -183,14 +186,14 @@ async function markSettled(settlement: SettlementView) {
|
|||||||
class="shrink-0 rounded-xl bg-orange-500 px-3 py-2 text-sm font-medium text-white shadow-sm transition-colors hover:bg-orange-600 disabled:opacity-50"
|
class="shrink-0 rounded-xl bg-orange-500 px-3 py-2 text-sm font-medium text-white shadow-sm transition-colors hover:bg-orange-600 disabled:opacity-50"
|
||||||
@click="saveEdit(participant)"
|
@click="saveEdit(participant)"
|
||||||
>
|
>
|
||||||
{{ savingLink ? 'Saving…' : 'Save' }}
|
{{ savingLink ? t('common.saving') : t('common.save') }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="shrink-0 rounded-xl border border-stone-300 px-3 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-300 dark:hover:border-orange-700 dark:hover:text-orange-400"
|
class="shrink-0 rounded-xl border border-stone-300 px-3 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-300 dark:hover:border-orange-700 dark:hover:text-orange-400"
|
||||||
@click="cancelEdit"
|
@click="cancelEdit"
|
||||||
>
|
>
|
||||||
Cancel
|
{{ t('common.cancel') }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<p v-if="editError" class="text-xs text-rose-600 dark:text-rose-400">
|
<p v-if="editError" class="text-xs text-rose-600 dark:text-rose-400">
|
||||||
@@ -206,7 +209,7 @@ async function markSettled(settlement: SettlementView) {
|
|||||||
class="flex w-full items-center justify-between gap-2 text-sm font-medium text-orange-600 dark:text-orange-400"
|
class="flex w-full items-center justify-between gap-2 text-sm font-medium text-orange-600 dark:text-orange-400"
|
||||||
@click="showSettlements = !showSettlements"
|
@click="showSettlements = !showSettlements"
|
||||||
>
|
>
|
||||||
<span>Suggested payments</span>
|
<span>{{ t('balances.suggestedPayments') }}</span>
|
||||||
<svg
|
<svg
|
||||||
class="h-4 w-4 shrink-0 transition-transform"
|
class="h-4 w-4 shrink-0 transition-transform"
|
||||||
:class="{ 'rotate-180': showSettlements }"
|
:class="{ 'rotate-180': showSettlements }"
|
||||||
@@ -225,7 +228,7 @@ async function markSettled(settlement: SettlementView) {
|
|||||||
v-if="showSettlements && settlements.length === 0"
|
v-if="showSettlements && settlements.length === 0"
|
||||||
class="text-sm text-stone-500 dark:text-stone-400"
|
class="text-sm text-stone-500 dark:text-stone-400"
|
||||||
>
|
>
|
||||||
Everyone is settled up.
|
{{ t('balances.allSettled') }}
|
||||||
</p>
|
</p>
|
||||||
<ul v-else-if="showSettlements" class="space-y-2">
|
<ul v-else-if="showSettlements" class="space-y-2">
|
||||||
<li
|
<li
|
||||||
@@ -283,7 +286,7 @@ async function markSettled(settlement: SettlementView) {
|
|||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
class="rounded-full border border-orange-300 px-3 py-1 text-xs font-medium text-orange-700 transition-colors hover:bg-white dark:border-orange-800 dark:text-orange-300 dark:hover:bg-stone-900"
|
class="rounded-full border border-orange-300 px-3 py-1 text-xs font-medium text-orange-700 transition-colors hover:bg-white dark:border-orange-800 dark:text-orange-300 dark:hover:bg-stone-900"
|
||||||
>
|
>
|
||||||
Pay now
|
{{ t('balances.payNow') }}
|
||||||
</a>
|
</a>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@@ -292,7 +295,9 @@ async function markSettled(settlement: SettlementView) {
|
|||||||
@click="markSettled(settlement)"
|
@click="markSettled(settlement)"
|
||||||
>
|
>
|
||||||
{{
|
{{
|
||||||
settlingKey === keyOf(settlement) ? 'Marking…' : 'Mark as paid'
|
settlingKey === keyOf(settlement)
|
||||||
|
? t('balances.marking')
|
||||||
|
: t('balances.markAsPaid')
|
||||||
}}
|
}}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,14 +12,22 @@ const emit = defineEmits<{
|
|||||||
remove: [id: number];
|
remove: [id: number];
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
const expandedId = ref<number | null>(null);
|
const expandedId = ref<number | null>(null);
|
||||||
|
|
||||||
function nameOf(id: number) {
|
function nameOf(id: number) {
|
||||||
return props.participants.find((p) => p.id === id)?.name ?? 'Unknown';
|
return (
|
||||||
|
props.participants.find((p) => p.id === id)?.name ?? t('common.unknown')
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function namesOf(ids: number[]) {
|
function splitOf(expense: ExpenseView) {
|
||||||
return ids.map(nameOf).join(', ');
|
const shares = computeSplit(expense.amountCents, expense.participantIds);
|
||||||
|
return expense.participantIds.map((id) => ({
|
||||||
|
id,
|
||||||
|
name: nameOf(id),
|
||||||
|
amountCents: shares[id]!,
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggle(id: number) {
|
function toggle(id: number) {
|
||||||
@@ -37,7 +45,7 @@ const sorted = computed(() =>
|
|||||||
v-if="expenses.length === 0"
|
v-if="expenses.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"
|
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 expenses yet. Add the first one below.
|
{{ t('expenses.empty') }}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
@@ -73,8 +81,12 @@ const sorted = computed(() =>
|
|||||||
<p
|
<p
|
||||||
class="truncate font-medium text-emerald-800 dark:text-emerald-300"
|
class="truncate font-medium text-emerald-800 dark:text-emerald-300"
|
||||||
>
|
>
|
||||||
{{ nameOf(expense.payerId) }} paid
|
{{
|
||||||
{{ nameOf(expense.participantIds[0]!) }}
|
t('expenses.paymentDescription', {
|
||||||
|
payer: nameOf(expense.payerId),
|
||||||
|
recipient: nameOf(expense.participantIds[0]!),
|
||||||
|
})
|
||||||
|
}}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="min-w-0">
|
<div v-else class="min-w-0">
|
||||||
@@ -82,7 +94,7 @@ const sorted = computed(() =>
|
|||||||
{{ expense.description }}
|
{{ expense.description }}
|
||||||
</p>
|
</p>
|
||||||
<p class="text-sm text-stone-500 dark:text-stone-400">
|
<p class="text-sm text-stone-500 dark:text-stone-400">
|
||||||
paid by {{ nameOf(expense.payerId) }}
|
{{ t('expenses.paidBy', { name: nameOf(expense.payerId) }) }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex shrink-0 items-center gap-2">
|
<div class="flex shrink-0 items-center gap-2">
|
||||||
@@ -120,12 +132,19 @@ const sorted = computed(() =>
|
|||||||
: 'border-stone-100 dark:border-stone-800'
|
: 'border-stone-100 dark:border-stone-800'
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<p
|
<ul
|
||||||
v-if="expense.type === 'expense'"
|
v-if="expense.type === 'expense'"
|
||||||
class="text-xs text-stone-400 dark:text-stone-500"
|
class="space-y-1 text-xs text-stone-400 dark:text-stone-500"
|
||||||
>
|
>
|
||||||
split among {{ namesOf(expense.participantIds) }}
|
<li
|
||||||
</p>
|
v-for="share in splitOf(expense)"
|
||||||
|
:key="share.id"
|
||||||
|
class="flex justify-between gap-2"
|
||||||
|
>
|
||||||
|
<span>{{ share.name }}</span>
|
||||||
|
<span>{{ formatCurrency(share.amountCents, currency) }}</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
<div class="flex gap-3">
|
<div class="flex gap-3">
|
||||||
<button
|
<button
|
||||||
v-if="expense.type === 'expense'"
|
v-if="expense.type === 'expense'"
|
||||||
@@ -133,14 +152,14 @@ const sorted = computed(() =>
|
|||||||
class="text-sm font-medium text-orange-600 dark:text-orange-400"
|
class="text-sm font-medium text-orange-600 dark:text-orange-400"
|
||||||
@click="emit('edit', expense)"
|
@click="emit('edit', expense)"
|
||||||
>
|
>
|
||||||
Edit
|
{{ t('expenses.edit') }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="text-sm font-medium text-rose-600 dark:text-rose-400"
|
class="text-sm font-medium text-rose-600 dark:text-rose-400"
|
||||||
@click="emit('remove', expense.id)"
|
@click="emit('remove', expense.id)"
|
||||||
>
|
>
|
||||||
Delete
|
{{ t('expenses.delete') }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const props = defineProps<{ title?: string; buttonLabel?: string }>();
|
const props = defineProps<{ title?: string; buttonLabel?: string }>();
|
||||||
const emit = defineEmits<{ submit: [name: string] }>();
|
const emit = defineEmits<{ submit: [name: string] }>();
|
||||||
|
const { t } = useI18n();
|
||||||
|
|
||||||
const name = ref('');
|
const name = ref('');
|
||||||
|
|
||||||
@@ -17,7 +18,7 @@ function onSubmit() {
|
|||||||
for="name"
|
for="name"
|
||||||
class="block text-sm font-medium text-stone-700 dark:text-stone-300"
|
class="block text-sm font-medium text-stone-700 dark:text-stone-300"
|
||||||
>
|
>
|
||||||
{{ props.title ?? "What's your name?" }}
|
{{ props.title ?? t('nameForm.defaultTitle') }}
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
id="name"
|
id="name"
|
||||||
@@ -26,14 +27,14 @@ function onSubmit() {
|
|||||||
autocomplete="name"
|
autocomplete="name"
|
||||||
required
|
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-900 dark:text-stone-100 dark:placeholder:text-stone-500 dark:focus:ring-orange-900"
|
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-900 dark:text-stone-100 dark:placeholder:text-stone-500 dark:focus:ring-orange-900"
|
||||||
placeholder="Your name"
|
:placeholder="t('nameForm.placeholder')"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
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"
|
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"
|
||||||
>
|
>
|
||||||
{{ props.buttonLabel ?? 'Continue' }}
|
{{ props.buttonLabel ?? t('nameForm.continue') }}
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</template>
|
</template>
|
||||||
+10
-9
@@ -1,4 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
const { t } = useI18n();
|
||||||
const { name, setName } = useIdentity();
|
const { name, setName } = useIdentity();
|
||||||
const { pots: visitedPots } = useVisitedPots();
|
const { pots: visitedPots } = useVisitedPots();
|
||||||
|
|
||||||
@@ -24,7 +25,7 @@ async function createPot() {
|
|||||||
});
|
});
|
||||||
await navigateTo(`/p/${pot.slug}/setup`);
|
await navigateTo(`/p/${pot.slug}/setup`);
|
||||||
} catch {
|
} catch {
|
||||||
error.value = 'Could not create the Pot. Please try again.';
|
error.value = t('home.createError');
|
||||||
} finally {
|
} finally {
|
||||||
creating.value = false;
|
creating.value = false;
|
||||||
}
|
}
|
||||||
@@ -36,16 +37,16 @@ async function createPot() {
|
|||||||
<div class="space-y-1 text-center">
|
<div class="space-y-1 text-center">
|
||||||
<div class="text-4xl">🍯</div>
|
<div class="text-4xl">🍯</div>
|
||||||
<h1 class="text-2xl font-bold text-stone-900 dark:text-stone-100">
|
<h1 class="text-2xl font-bold text-stone-900 dark:text-stone-100">
|
||||||
Splitt the Bill
|
{{ t('home.title') }}
|
||||||
</h1>
|
</h1>
|
||||||
<p class="text-sm text-stone-500 dark:text-stone-400">
|
<p class="text-sm text-stone-500 dark:text-stone-400">
|
||||||
Track shared costs with friends, the easy way.
|
{{ t('home.subtitle') }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<section v-if="visitedPots.length" class="space-y-2">
|
<section v-if="visitedPots.length" class="space-y-2">
|
||||||
<h2 class="text-sm font-semibold text-stone-500 dark:text-stone-400">
|
<h2 class="text-sm font-semibold text-stone-500 dark:text-stone-400">
|
||||||
Your Pots
|
{{ t('home.yourPots') }}
|
||||||
</h2>
|
</h2>
|
||||||
<ul class="space-y-2">
|
<ul class="space-y-2">
|
||||||
<li v-for="pot in visitedPots" :key="pot.slug">
|
<li v-for="pot in visitedPots" :key="pot.slug">
|
||||||
@@ -73,14 +74,14 @@ async function createPot() {
|
|||||||
@submit.prevent="createPot"
|
@submit.prevent="createPot"
|
||||||
>
|
>
|
||||||
<p class="text-sm text-stone-600 dark:text-stone-400">
|
<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>
|
</p>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label
|
<label
|
||||||
for="pot-name"
|
for="pot-name"
|
||||||
class="block text-sm font-medium text-stone-700 dark:text-stone-300"
|
class="block text-sm font-medium text-stone-700 dark:text-stone-300"
|
||||||
>Pot name</label
|
>{{ t('home.potNameLabel') }}</label
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
id="pot-name"
|
id="pot-name"
|
||||||
@@ -88,7 +89,7 @@ async function createPot() {
|
|||||||
type="text"
|
type="text"
|
||||||
required
|
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"
|
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>
|
</div>
|
||||||
|
|
||||||
@@ -96,7 +97,7 @@ async function createPot() {
|
|||||||
<label
|
<label
|
||||||
for="currency"
|
for="currency"
|
||||||
class="block text-sm font-medium text-stone-700 dark:text-stone-300"
|
class="block text-sm font-medium text-stone-700 dark:text-stone-300"
|
||||||
>Currency</label
|
>{{ t('home.currencyLabel') }}</label
|
||||||
>
|
>
|
||||||
<select
|
<select
|
||||||
id="currency"
|
id="currency"
|
||||||
@@ -118,7 +119,7 @@ async function createPot() {
|
|||||||
:disabled="creating"
|
: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"
|
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>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+11
-10
@@ -1,6 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PotView } from '~/types';
|
import type { PotView } from '~/types';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const slug = route.params.slug as string;
|
const slug = route.params.slug as string;
|
||||||
const { name, setName } = useIdentity();
|
const { name, setName } = useIdentity();
|
||||||
@@ -53,15 +54,15 @@ async function copyLink() {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="error" class="space-y-3 text-center">
|
<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">
|
<NuxtLink to="/" class="font-medium text-orange-600 dark:text-orange-400">
|
||||||
Go home
|
{{ t('pot.goHome') }}
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<NameForm
|
<NameForm
|
||||||
v-else-if="!name && isPotTab"
|
v-else-if="!name && isPotTab"
|
||||||
title="What's your name?"
|
:title="t('pot.whatIsYourName')"
|
||||||
@submit="setName"
|
@submit="setName"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -78,7 +79,7 @@ async function copyLink() {
|
|||||||
clip-rule="evenodd"
|
clip-rule="evenodd"
|
||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
All Pots
|
{{ t('pot.allPots') }}
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
|
|
||||||
<div class="flex items-start justify-between gap-2">
|
<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"
|
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"
|
@click="copyLink"
|
||||||
>
|
>
|
||||||
{{ linkCopied ? 'Copied!' : 'Copy link' }}
|
{{ linkCopied ? t('pot.linkCopied') : t('pot.copyLink') }}
|
||||||
</button>
|
</button>
|
||||||
<NuxtLink
|
<NuxtLink
|
||||||
:to="`/p/${slug}/settings`"
|
: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"
|
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">
|
<svg class="h-4.5 w-4.5" viewBox="0 0 20 20" fill="currentColor">
|
||||||
<path
|
<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"
|
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">
|
<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>
|
</p>
|
||||||
<button
|
<button
|
||||||
type="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"
|
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"
|
@click="addMyself"
|
||||||
>
|
>
|
||||||
Add myself as {{ name }}
|
{{ t('pot.addMyself', { name }) }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -142,7 +143,7 @@ async function copyLink() {
|
|||||||
: 'text-stone-500 hover:text-stone-700 dark:text-stone-400 dark:hover:text-stone-200'
|
: 'text-stone-500 hover:text-stone-700 dark:text-stone-400 dark:hover:text-stone-200'
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
People & balances
|
{{ t('pot.tabPeople') }}
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
<NuxtLink
|
<NuxtLink
|
||||||
:to="`/p/${slug}/expenses`"
|
: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'
|
: 'text-stone-500 hover:text-stone-700 dark:text-stone-400 dark:hover:text-stone-200'
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
Expenses
|
{{ t('pot.tabExpenses') }}
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ExpenseView, PotView } from '~/types';
|
import type { ExpenseView, PotView } from '~/types';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const slug = route.params.slug as string;
|
const slug = route.params.slug as string;
|
||||||
const { name } = useIdentity();
|
const { name } = useIdentity();
|
||||||
@@ -55,7 +56,7 @@ function cancelExpenseForm() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function removeExpense(id: number) {
|
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 $fetch(`/api/pots/${slug}/expenses/${id}`, { method: 'DELETE' });
|
||||||
await refresh();
|
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"
|
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"
|
@click="newExpense"
|
||||||
>
|
>
|
||||||
+ Add expense
|
{{ t('expenses.addExpense') }}
|
||||||
</button>
|
</button>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PotView } from '~/types';
|
import type { PotView } from '~/types';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const slug = route.params.slug as string;
|
const slug = route.params.slug as string;
|
||||||
|
|
||||||
@@ -25,7 +26,7 @@ async function addParticipant(participantName: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function removeParticipant(participant: { id: number; name: 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 = '';
|
removeError.value = '';
|
||||||
removingId.value = participant.id;
|
removingId.value = participant.id;
|
||||||
@@ -35,7 +36,7 @@ async function removeParticipant(participant: { id: number; name: string }) {
|
|||||||
});
|
});
|
||||||
await refresh();
|
await refresh();
|
||||||
} catch {
|
} catch {
|
||||||
removeError.value = `Couldn't remove ${participant.name}. They may have expenses or payments recorded.`;
|
removeError.value = t('settings.removeError', { name: participant.name });
|
||||||
} finally {
|
} finally {
|
||||||
removingId.value = null;
|
removingId.value = null;
|
||||||
}
|
}
|
||||||
@@ -44,9 +45,9 @@ async function removeParticipant(participant: { id: number; name: string }) {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="error" class="space-y-3 text-center">
|
<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">
|
<NuxtLink to="/" class="font-medium text-orange-600 dark:text-orange-400">
|
||||||
Go home
|
{{ t('pot.goHome') }}
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -55,7 +56,7 @@ async function removeParticipant(participant: { id: number; name: string }) {
|
|||||||
<NuxtLink
|
<NuxtLink
|
||||||
:to="`/p/${slug}`"
|
: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"
|
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">
|
<svg class="h-4.5 w-4.5" viewBox="0 0 20 20" fill="currentColor">
|
||||||
<path
|
<path
|
||||||
@@ -67,7 +68,7 @@ async function removeParticipant(participant: { id: number; name: string }) {
|
|||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
<div>
|
<div>
|
||||||
<h1 class="text-lg font-bold text-stone-900 dark:text-stone-100">
|
<h1 class="text-lg font-bold text-stone-900 dark:text-stone-100">
|
||||||
Pot settings
|
{{ t('settings.title') }}
|
||||||
</h1>
|
</h1>
|
||||||
<p class="text-sm text-stone-500 dark:text-stone-400">
|
<p class="text-sm text-stone-500 dark:text-stone-400">
|
||||||
{{ data.pot.name }} · {{ data.pot.currency }}
|
{{ data.pot.name }} · {{ data.pot.currency }}
|
||||||
@@ -79,7 +80,7 @@ async function removeParticipant(participant: { id: number; name: string }) {
|
|||||||
<h2
|
<h2
|
||||||
class="text-sm font-semibold uppercase tracking-wide text-stone-500 dark:text-stone-400"
|
class="text-sm font-semibold uppercase tracking-wide text-stone-500 dark:text-stone-400"
|
||||||
>
|
>
|
||||||
Participants
|
{{ t('settings.participants') }}
|
||||||
</h2>
|
</h2>
|
||||||
<ul class="space-y-2">
|
<ul class="space-y-2">
|
||||||
<li
|
<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"
|
class="shrink-0 text-sm font-medium text-rose-600 disabled:opacity-50 dark:text-rose-400"
|
||||||
@click="removeParticipant(participant)"
|
@click="removeParticipant(participant)"
|
||||||
>
|
>
|
||||||
{{ removingId === participant.id ? 'Removing…' : 'Remove' }}
|
{{
|
||||||
|
removingId === participant.id
|
||||||
|
? t('settings.removing')
|
||||||
|
: t('settings.remove')
|
||||||
|
}}
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
<li
|
<li
|
||||||
v-if="data.participants.length === 0"
|
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"
|
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>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p v-if="removeError" class="text-sm text-rose-600 dark:text-rose-400">
|
<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
|
<h2
|
||||||
class="text-sm font-semibold uppercase tracking-wide text-stone-500 dark:text-stone-400"
|
class="text-sm font-semibold uppercase tracking-wide text-stone-500 dark:text-stone-400"
|
||||||
>
|
>
|
||||||
Add a participant
|
{{ t('settings.addParticipant') }}
|
||||||
</h2>
|
</h2>
|
||||||
<NameForm
|
<NameForm
|
||||||
title="Name"
|
:title="t('settings.nameLabel')"
|
||||||
:button-label="adding ? 'Adding…' : 'Add'"
|
:button-label="adding ? t('settings.adding') : t('settings.add')"
|
||||||
@submit="addParticipant"
|
@submit="addParticipant"
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const slug = route.params.slug as string;
|
const slug = route.params.slug as string;
|
||||||
|
|
||||||
@@ -34,10 +35,10 @@ function skip() {
|
|||||||
<div class="space-y-1 text-center">
|
<div class="space-y-1 text-center">
|
||||||
<div class="text-3xl">👋</div>
|
<div class="text-3xl">👋</div>
|
||||||
<h1 class="text-xl font-bold text-stone-900 dark:text-stone-100">
|
<h1 class="text-xl font-bold text-stone-900 dark:text-stone-100">
|
||||||
Add the rest of the group
|
{{ t('setup.title') }}
|
||||||
</h1>
|
</h1>
|
||||||
<p class="text-sm text-stone-500 dark:text-stone-400">
|
<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>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -48,7 +49,7 @@ function skip() {
|
|||||||
v-model="names[index]"
|
v-model="names[index]"
|
||||||
type="text"
|
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"
|
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>
|
</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"
|
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"
|
@click="addRow"
|
||||||
>
|
>
|
||||||
+ Add another
|
{{ t('setup.addAnother') }}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div class="flex gap-3">
|
<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"
|
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"
|
@click="skip"
|
||||||
>
|
>
|
||||||
Skip
|
{{ t('setup.skip') }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="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"
|
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"
|
@click="continueToPot"
|
||||||
>
|
>
|
||||||
{{ saving ? 'Saving…' : 'Continue' }}
|
{{ saving ? t('setup.saving') : t('setup.continue') }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,96 @@
|
|||||||
|
{
|
||||||
|
"common": {
|
||||||
|
"cancel": "Abbrechen",
|
||||||
|
"save": "Speichern",
|
||||||
|
"saving": "Wird gespeichert…",
|
||||||
|
"unknown": "Unbekannt"
|
||||||
|
},
|
||||||
|
"nameForm": {
|
||||||
|
"defaultTitle": "Wie heißt du?",
|
||||||
|
"placeholder": "Dein Name",
|
||||||
|
"continue": "Weiter"
|
||||||
|
},
|
||||||
|
"home": {
|
||||||
|
"title": "Splitt the Bill",
|
||||||
|
"subtitle": "Teile gemeinsame Kosten mit Freunden – ganz einfach.",
|
||||||
|
"yourPots": "Deine Töpfe",
|
||||||
|
"greeting": "Hi {name}! Erstelle einen neuen Topf, um Kosten aufzuteilen.",
|
||||||
|
"potNameLabel": "Name des Topfes",
|
||||||
|
"potNamePlaceholder": "Wochenende in Lissabon",
|
||||||
|
"currencyLabel": "Währung",
|
||||||
|
"createPot": "Topf erstellen",
|
||||||
|
"creating": "Wird erstellt…",
|
||||||
|
"createError": "Der Topf konnte nicht erstellt werden. Bitte versuche es erneut."
|
||||||
|
},
|
||||||
|
"pot": {
|
||||||
|
"notFound": "Dieser Topf wurde nicht gefunden.",
|
||||||
|
"goHome": "Zur Startseite",
|
||||||
|
"whatIsYourName": "Wie heißt du?",
|
||||||
|
"allPots": "Alle Töpfe",
|
||||||
|
"copyLink": "Link kopieren",
|
||||||
|
"linkCopied": "Kopiert!",
|
||||||
|
"settingsLabel": "Topf-Einstellungen",
|
||||||
|
"notInPot": "Du bist noch nicht in der Teilnehmerliste dieses Topfes.",
|
||||||
|
"addMyself": "Mich als {name} hinzufügen",
|
||||||
|
"tabPeople": "Personen & Salden",
|
||||||
|
"tabExpenses": "Ausgaben"
|
||||||
|
},
|
||||||
|
"balances": {
|
||||||
|
"empty": "Noch niemand in diesem Topf. Füge Personen auf der Einstellungsseite hinzu.",
|
||||||
|
"settledUp": "ausgeglichen",
|
||||||
|
"paymentLink": "Zahlungslink",
|
||||||
|
"paymentLinkLabelFor": "Zahlungslink für {name}",
|
||||||
|
"paymentLinkPlaceholder": "https://paypal.me/deinname",
|
||||||
|
"invalidLink": "Gib einen gültigen Link ein, der mit http:// oder https:// beginnt.",
|
||||||
|
"suggestedPayments": "Vorgeschlagene Zahlungen",
|
||||||
|
"allSettled": "Alle sind ausgeglichen.",
|
||||||
|
"payNow": "Jetzt zahlen",
|
||||||
|
"markAsPaid": "Als bezahlt markieren",
|
||||||
|
"marking": "Wird markiert…"
|
||||||
|
},
|
||||||
|
"expenses": {
|
||||||
|
"empty": "Noch keine Ausgaben. Füge die erste unten hinzu.",
|
||||||
|
"addExpense": "+ Ausgabe hinzufügen",
|
||||||
|
"paidBy": "bezahlt von {name}",
|
||||||
|
"paymentDescription": "{payer} hat {recipient} bezahlt",
|
||||||
|
"edit": "Bearbeiten",
|
||||||
|
"delete": "Löschen",
|
||||||
|
"deleteConfirm": "Diese Ausgabe löschen?"
|
||||||
|
},
|
||||||
|
"expenseForm": {
|
||||||
|
"descriptionLabel": "Beschreibung",
|
||||||
|
"descriptionPlaceholder": "Abendessen, Taxi, Einkauf…",
|
||||||
|
"amountLabel": "Betrag ({currency})",
|
||||||
|
"amountPlaceholder": "0,00",
|
||||||
|
"paidByLabel": "Bezahlt von",
|
||||||
|
"splitEquallyLabel": "Gleich aufteilen zwischen",
|
||||||
|
"addExpense": "Ausgabe hinzufügen",
|
||||||
|
"saveChanges": "Änderungen speichern",
|
||||||
|
"errorDescriptionRequired": "Beschreibung ist erforderlich.",
|
||||||
|
"errorInvalidAmount": "Gib einen gültigen Betrag ein.",
|
||||||
|
"errorSelectParticipant": "Wähle mindestens einen Teilnehmer zum Aufteilen aus."
|
||||||
|
},
|
||||||
|
"settings": {
|
||||||
|
"title": "Topf-Einstellungen",
|
||||||
|
"backToPot": "Zurück zum Topf",
|
||||||
|
"participants": "Teilnehmer",
|
||||||
|
"remove": "Entfernen",
|
||||||
|
"removing": "Wird entfernt…",
|
||||||
|
"removeConfirm": "{name} aus diesem Topf entfernen?",
|
||||||
|
"removeError": "{name} konnte nicht entfernt werden. Möglicherweise sind noch Ausgaben oder Zahlungen erfasst.",
|
||||||
|
"noParticipants": "Noch niemand in diesem Topf.",
|
||||||
|
"addParticipant": "Teilnehmer hinzufügen",
|
||||||
|
"nameLabel": "Name",
|
||||||
|
"add": "Hinzufügen",
|
||||||
|
"adding": "Wird hinzugefügt…"
|
||||||
|
},
|
||||||
|
"setup": {
|
||||||
|
"title": "Restliche Gruppe hinzufügen",
|
||||||
|
"subtitle": "Füge jetzt die Namen aller anderen hinzu oder überspringe diesen Schritt und füge sie später über die Einstellungen hinzu.",
|
||||||
|
"placeholder": "Name des Teilnehmers",
|
||||||
|
"addAnother": "+ Weitere Person",
|
||||||
|
"skip": "Überspringen",
|
||||||
|
"continue": "Weiter",
|
||||||
|
"saving": "Wird gespeichert…"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
{
|
||||||
|
"common": {
|
||||||
|
"cancel": "Cancel",
|
||||||
|
"save": "Save",
|
||||||
|
"saving": "Saving…",
|
||||||
|
"unknown": "Unknown"
|
||||||
|
},
|
||||||
|
"nameForm": {
|
||||||
|
"defaultTitle": "What's your name?",
|
||||||
|
"placeholder": "Your name",
|
||||||
|
"continue": "Continue"
|
||||||
|
},
|
||||||
|
"home": {
|
||||||
|
"title": "Splitt the Bill",
|
||||||
|
"subtitle": "Track shared costs with friends, the easy way.",
|
||||||
|
"yourPots": "Your Pots",
|
||||||
|
"greeting": "Hi {name}! Create a new Pot to start splitting costs.",
|
||||||
|
"potNameLabel": "Pot name",
|
||||||
|
"potNamePlaceholder": "Weekend in Lisbon",
|
||||||
|
"currencyLabel": "Currency",
|
||||||
|
"createPot": "Create Pot",
|
||||||
|
"creating": "Creating…",
|
||||||
|
"createError": "Could not create the Pot. Please try again."
|
||||||
|
},
|
||||||
|
"pot": {
|
||||||
|
"notFound": "This Pot couldn't be found.",
|
||||||
|
"goHome": "Go home",
|
||||||
|
"whatIsYourName": "What's your name?",
|
||||||
|
"allPots": "All Pots",
|
||||||
|
"copyLink": "Copy link",
|
||||||
|
"linkCopied": "Copied!",
|
||||||
|
"settingsLabel": "Pot settings",
|
||||||
|
"notInPot": "You're not in this Pot's participant list yet.",
|
||||||
|
"addMyself": "Add myself as {name}",
|
||||||
|
"tabPeople": "People & balances",
|
||||||
|
"tabExpenses": "Expenses"
|
||||||
|
},
|
||||||
|
"balances": {
|
||||||
|
"empty": "No one's in this Pot yet. Add people from the settings page.",
|
||||||
|
"settledUp": "settled up",
|
||||||
|
"paymentLink": "Payment link",
|
||||||
|
"paymentLinkLabelFor": "Payment link for {name}",
|
||||||
|
"paymentLinkPlaceholder": "https://paypal.me/yourname",
|
||||||
|
"invalidLink": "Enter a valid link starting with http:// or https://.",
|
||||||
|
"suggestedPayments": "Suggested payments",
|
||||||
|
"allSettled": "Everyone is settled up.",
|
||||||
|
"payNow": "Pay now",
|
||||||
|
"markAsPaid": "Mark as paid",
|
||||||
|
"marking": "Marking…"
|
||||||
|
},
|
||||||
|
"expenses": {
|
||||||
|
"empty": "No expenses yet. Add the first one below.",
|
||||||
|
"addExpense": "+ Add expense",
|
||||||
|
"paidBy": "paid by {name}",
|
||||||
|
"paymentDescription": "{payer} paid {recipient}",
|
||||||
|
"edit": "Edit",
|
||||||
|
"delete": "Delete",
|
||||||
|
"deleteConfirm": "Delete this expense?"
|
||||||
|
},
|
||||||
|
"expenseForm": {
|
||||||
|
"descriptionLabel": "Description",
|
||||||
|
"descriptionPlaceholder": "Dinner, taxi, groceries…",
|
||||||
|
"amountLabel": "Amount ({currency})",
|
||||||
|
"amountPlaceholder": "0.00",
|
||||||
|
"paidByLabel": "Paid by",
|
||||||
|
"splitEquallyLabel": "Split equally among",
|
||||||
|
"addExpense": "Add expense",
|
||||||
|
"saveChanges": "Save changes",
|
||||||
|
"errorDescriptionRequired": "Description is required.",
|
||||||
|
"errorInvalidAmount": "Enter a valid amount.",
|
||||||
|
"errorSelectParticipant": "Select at least one participant to split with."
|
||||||
|
},
|
||||||
|
"settings": {
|
||||||
|
"title": "Pot settings",
|
||||||
|
"backToPot": "Back to Pot",
|
||||||
|
"participants": "Participants",
|
||||||
|
"remove": "Remove",
|
||||||
|
"removing": "Removing…",
|
||||||
|
"removeConfirm": "Remove {name} from this Pot?",
|
||||||
|
"removeError": "Couldn't remove {name}. They may have expenses or payments recorded.",
|
||||||
|
"noParticipants": "No one's in this Pot yet.",
|
||||||
|
"addParticipant": "Add a participant",
|
||||||
|
"nameLabel": "Name",
|
||||||
|
"add": "Add",
|
||||||
|
"adding": "Adding…"
|
||||||
|
},
|
||||||
|
"setup": {
|
||||||
|
"title": "Add the rest of the group",
|
||||||
|
"subtitle": "Add everyone else's name now, or skip and add them later from settings.",
|
||||||
|
"placeholder": "Participant name",
|
||||||
|
"addAnother": "+ Add another",
|
||||||
|
"skip": "Skip",
|
||||||
|
"continue": "Continue",
|
||||||
|
"saving": "Saving…"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ import tailwindcss from '@tailwindcss/vite';
|
|||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
compatibilityDate: '2026-08-07',
|
compatibilityDate: '2026-08-07',
|
||||||
devtools: { enabled: true },
|
devtools: { enabled: true },
|
||||||
|
modules: ['@nuxtjs/i18n'],
|
||||||
css: ['~/assets/css/tailwind.css'],
|
css: ['~/assets/css/tailwind.css'],
|
||||||
vite: {
|
vite: {
|
||||||
plugins: [tailwindcss()],
|
plugins: [tailwindcss()],
|
||||||
@@ -14,4 +15,17 @@ export default defineNuxtConfig({
|
|||||||
authToken: '',
|
authToken: '',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
i18n: {
|
||||||
|
locales: [
|
||||||
|
{ code: 'en', name: 'English', file: 'en.json' },
|
||||||
|
{ code: 'de', name: 'Deutsch', file: 'de.json' },
|
||||||
|
],
|
||||||
|
defaultLocale: 'en',
|
||||||
|
strategy: 'no_prefix',
|
||||||
|
detectBrowserLanguage: {
|
||||||
|
useCookie: true,
|
||||||
|
cookieKey: 'locale',
|
||||||
|
redirectOn: 'root',
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
@@ -14,6 +14,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@libsql/client": "^0.17.4",
|
"@libsql/client": "^0.17.4",
|
||||||
|
"@nuxtjs/i18n": "^10.6.0",
|
||||||
"drizzle-orm": "^0.45.2",
|
"drizzle-orm": "^0.45.2",
|
||||||
"nanoid": "^6.0.1",
|
"nanoid": "^6.0.1",
|
||||||
"nuxt": "^4.5.2"
|
"nuxt": "^4.5.2"
|
||||||
|
|||||||
Generated
+2937
-4021
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user