✨ add german translation
This commit is contained in:
15 files changed
+3282
-4101
No files matched your search
@@ -20,6 +20,8 @@ const emit = defineEmits<{
|
||||
cancel: [];
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const description = ref(props.editing?.description ?? '');
|
||||
const amount = ref(
|
||||
props.editing ? fromCents(props.editing.amountCents).toString() : '',
|
||||
@@ -45,15 +47,15 @@ function onSubmit() {
|
||||
const amountCents = toCents(Number(amount.value));
|
||||
|
||||
if (!description.value.trim()) {
|
||||
error.value = 'Description is required.';
|
||||
error.value = t('expenseForm.errorDescriptionRequired');
|
||||
return;
|
||||
}
|
||||
if (!Number.isFinite(amountCents) || amountCents <= 0) {
|
||||
error.value = 'Enter a valid amount.';
|
||||
error.value = t('expenseForm.errorInvalidAmount');
|
||||
return;
|
||||
}
|
||||
if (selectedIds.value.length === 0) {
|
||||
error.value = 'Select at least one participant to split with.';
|
||||
error.value = t('expenseForm.errorSelectParticipant');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -75,7 +77,7 @@ function onSubmit() {
|
||||
<label
|
||||
for="description"
|
||||
class="block text-sm font-medium text-stone-700 dark:text-stone-300"
|
||||
>Description</label
|
||||
>{{ t('expenseForm.descriptionLabel') }}</label
|
||||
>
|
||||
<input
|
||||
id="description"
|
||||
@@ -83,7 +85,7 @@ function onSubmit() {
|
||||
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="Dinner, taxi, groceries…"
|
||||
:placeholder="t('expenseForm.descriptionPlaceholder')"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -92,7 +94,7 @@ function onSubmit() {
|
||||
for="amount"
|
||||
class="block text-sm font-medium text-stone-700 dark:text-stone-300"
|
||||
>
|
||||
Amount ({{ currency }})
|
||||
{{ t('expenseForm.amountLabel', { currency }) }}
|
||||
</label>
|
||||
<input
|
||||
id="amount"
|
||||
@@ -102,7 +104,7 @@ function onSubmit() {
|
||||
min="0.01"
|
||||
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="0.00"
|
||||
:placeholder="t('expenseForm.amountPlaceholder')"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -110,7 +112,7 @@ function onSubmit() {
|
||||
<label
|
||||
for="payer"
|
||||
class="block text-sm font-medium text-stone-700 dark:text-stone-300"
|
||||
>Paid by</label
|
||||
>{{ t('expenseForm.paidByLabel') }}</label
|
||||
>
|
||||
<select
|
||||
id="payer"
|
||||
@@ -128,8 +130,9 @@ function onSubmit() {
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span class="block text-sm font-medium text-stone-700 dark:text-stone-300"
|
||||
>Split equally among</span
|
||||
<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">
|
||||
<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"
|
||||
@click="emit('cancel')"
|
||||
>
|
||||
Cancel
|
||||
{{ t('common.cancel') }}
|
||||
</button>
|
||||
<button
|
||||
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"
|
||||
>
|
||||
{{ editing ? 'Save changes' : 'Add expense' }}
|
||||
{{
|
||||
editing ? t('expenseForm.saveChanges') : t('expenseForm.addExpense')
|
||||
}}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
Reference in new issue
Block a user