✨ 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

+18 -13
View File
@@ -12,6 +12,7 @@ const props = defineProps<{
const emit = defineEmits<{ settled: []; updated: [] }>();
const { t } = useI18n();
const { lastLink, rememberLink } = usePaymentLinkCache();
const showSettlements = ref(false);
@@ -22,7 +23,9 @@ const editError = ref('');
const savingLink = ref(false);
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) {
@@ -51,7 +54,7 @@ function cancelEdit() {
async function saveEdit(participant: ParticipantView) {
const trimmed = editValue.value.trim();
if (trimmed && !isValidPaymentLink(trimmed)) {
editError.value = 'Enter a valid link starting with http:// or https://.';
editError.value = t('balances.invalidLink');
return;
}
savingLink.value = true;
@@ -93,7 +96,7 @@ async function markSettled(settlement: SettlementView) {
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"
>
No one's in this Pot yet. Add people from the settings page.
{{ t('balances.empty') }}
</p>
<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"
@click.stop
>
Payment link
{{ t('balances.paymentLink') }}
</a>
<span
class="text-sm font-semibold"
@@ -145,7 +148,7 @@ async function markSettled(settlement: SettlementView) {
}"
>
<template v-if="(netBalances[participant.id] ?? 0) === 0">
settled up
{{ t('balances.settledUp') }}
</template>
<template v-else>
{{ (netBalances[participant.id] ?? 0) > 0 ? '+' : '−'
@@ -167,13 +170,13 @@ async function markSettled(settlement: SettlementView) {
<label
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>
<div class="flex gap-2">
<input
v-model="editValue"
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"
@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"
@click="saveEdit(participant)"
>
{{ savingLink ? 'Saving…' : 'Save' }}
{{ savingLink ? t('common.saving') : t('common.save') }}
</button>
<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"
@click="cancelEdit"
>
Cancel
{{ t('common.cancel') }}
</button>
</div>
<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"
@click="showSettlements = !showSettlements"
>
<span>Suggested payments</span>
<span>{{ t('balances.suggestedPayments') }}</span>
<svg
class="h-4 w-4 shrink-0 transition-transform"
:class="{ 'rotate-180': showSettlements }"
@@ -225,7 +228,7 @@ async function markSettled(settlement: SettlementView) {
v-if="showSettlements && settlements.length === 0"
class="text-sm text-stone-500 dark:text-stone-400"
>
Everyone is settled up.
{{ t('balances.allSettled') }}
</p>
<ul v-else-if="showSettlements" class="space-y-2">
<li
@@ -283,7 +286,7 @@ async function markSettled(settlement: SettlementView) {
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"
>
Pay now
{{ t('balances.payNow') }}
</a>
<button
type="button"
@@ -292,7 +295,9 @@ async function markSettled(settlement: SettlementView) {
@click="markSettled(settlement)"
>
{{
settlingKey === keyOf(settlement) ? 'Marking…' : 'Mark as paid'
settlingKey === keyOf(settlement)
? t('balances.marking')
: t('balances.markAsPaid')
}}
</button>
</div>