added transalations for UI texts

This commit is contained in:
2026-02-14 07:34:04 +01:00
parent 3010a66d59
commit 9b2f2c4e91
24 changed files with 681 additions and 118 deletions

View File

@ -1,17 +1,19 @@
<script setup lang="ts">
import { computed, onMounted, ref, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { useI18n } from 'vue-i18n'
import DayMealCard from '@/components/today/DayMealCard.vue'
import DayTotalsCard from '@/components/today/DayTotalsCard.vue'
import { useDiaryStore } from '@/stores/diary'
import { useMealsStore } from '@/stores/meals'
import { MEAL_TYPES, MEAL_TYPE_LABELS_SK, type MealType } from '@/types/domain'
import { MEAL_TYPES, type MealType } from '@/types/domain'
import { todayISO } from '@/utils/date'
const route = useRoute()
const router = useRouter()
const diaryStore = useDiaryStore()
const mealsStore = useMealsStore()
const { t } = useI18n()
const isWorking = ref(false)
const selectedDate = ref(todayISO())
@ -21,6 +23,8 @@ const resolveDate = (): string => {
return dateFromRoute.length > 0 ? dateFromRoute : todayISO()
}
const mealTypeLabel = (mealType: MealType): string => t(`mealTypes.${mealType}`)
const reloadDay = async (date: string) => {
selectedDate.value = date
diaryStore.ensureCurrentDay(date)
@ -66,12 +70,12 @@ const dayTotals = computed(() => diaryStore.computedTotals)
<section class="page">
<div class="page-header">
<label class="filter-control">
<span>Dátum</span>
<span>{{ t('common.date') }}</span>
<input v-model="selectedDate" class="input-date" type="date" @change="onDateChange" />
</label>
</div>
<div v-if="isWorking || diaryStore.loading" class="card">Načítavam deň...</div>
<div v-if="isWorking || diaryStore.loading" class="card">{{ t('today.loadingDay') }}</div>
<template v-else>
<div class="grid-three">
@ -79,7 +83,7 @@ const dayTotals = computed(() => diaryStore.computedTotals)
v-for="mealType in MEAL_TYPES"
:key="mealType"
:meal-type="mealType"
:label="MEAL_TYPE_LABELS_SK[mealType]"
:label="mealTypeLabel(mealType)"
:meal-options="diaryStore.selectedMealOptions[mealType]"
:selected-meal-id="diaryStore.selectedMealId(mealType)"
:meal="dayMeals[mealType]"