Translate home page

This commit is contained in:
2025-08-05 23:30:13 +02:00
parent 5b56809bac
commit dc42258010
6 changed files with 259 additions and 212 deletions
+39 -29
View File
@@ -13,7 +13,9 @@ watch(loggedIn, () => refresh());
<div v-if="data">
<div v-if="data.own !== null">
<h2 class="my-4 text-2xl font-bold">Joined hunts:</h2>
<h2 class="my-4 text-2xl font-bold">
{{ $t('page.home.joined_hunts') }}
</h2>
<div class="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3">
<VaCard
v-for="hunt in data.own"
@@ -33,43 +35,49 @@ watch(loggedIn, () => refresh());
{{ hunt.description }}
<VaDivider />
<div class="flex flex-col gap-2">
<p>{{ hunt._count.quests }} Quests</p>
<p>{{ $t('page.home.n_quests', hunt._count.quests) }}</p>
<p v-if="hunt.start">
Start:
{{
$d(hunt.start, {
dateStyle: 'medium',
timeStyle: 'medium'
$t('page.home.start', {
start: $d(hunt.start, {
dateStyle: 'medium',
timeStyle: 'medium'
})
})
}}
</p>
<p v-if="hunt.end">
End:
{{
$d(hunt.end, {
dateStyle: 'medium',
timeStyle: 'medium'
$t('page.home.end', {
start: $d(hunt.end, {
dateStyle: 'medium',
timeStyle: 'medium'
})
})
}}
</p>
<p>{{ hunt._count.teams }} teams joined!</p>
<p>{{ $t('page.home.n_teams_joined', hunt._count.teams) }}</p>
</div>
</VaCardContent>
</VaCard>
<VaCard v-if="data.own.length <= 0">
<VaCardTitle>No hunt joined yet</VaCardTitle>
<VaCardContent>Click on a hunt below and join them!</VaCardContent>
<VaCardTitle>{{ $t('page.home.no_hunt_joined') }}</VaCardTitle>
<VaCardContent>{{
$t('page.home.click_hunt_below_to_join')
}}</VaCardContent>
</VaCard>
</div>
</div>
<div v-else>
<VaButton color="info" icon="login" :to="$localePath(`/login`)"
>Login first</VaButton
>
<VaButton color="info" icon="login" :to="$localePath(`/login`)">{{
$t('page.home.login_first')
}}</VaButton>
</div>
<div class="mt-8">
<VaDivider />
<h2 class="my-4 text-2xl font-bold">Open to join hunts:</h2>
<h2 class="my-4 text-2xl font-bold">
{{ $t('page.home.open_to_join') }}
</h2>
<div class="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3">
<VaCard
v-for="hunt in data.others"
@@ -87,32 +95,34 @@ watch(loggedIn, () => refresh());
{{ hunt.description }}
<VaDivider />
<div class="flex flex-col gap-2">
<p>{{ hunt._count.quests }} Quests</p>
<p>{{ $t('page.home.n_quests', hunt._count.quests) }}</p>
<p v-if="hunt.start">
Start:
{{
$d(hunt.start, {
dateStyle: 'medium',
timeStyle: 'medium'
$t('page.home.start', {
start: $d(hunt.start, {
dateStyle: 'medium',
timeStyle: 'medium'
})
})
}}
</p>
<p v-if="hunt.end">
End:
{{
$d(hunt.end, {
dateStyle: 'medium',
timeStyle: 'medium'
$t('page.home.end', {
start: $d(hunt.end, {
dateStyle: 'medium',
timeStyle: 'medium'
})
})
}}
</p>
<p>{{ hunt._count.teams }} teams joined!</p>
<p>{{ $t('page.home.n_teams_joined', hunt._count.teams) }}</p>
</div>
</VaCardContent>
</VaCard>
<VaCard v-if="data.others.length <= 0">
<VaCardTitle>No hunt created yet</VaCardTitle>
<VaCardContent>New hunts will appear soon!</VaCardContent>
<VaCardTitle>{{ $t('page.home.no_hunt_created') }}</VaCardTitle>
<VaCardContent>{{ $t('page.home.new_hunts_soon') }}</VaCardContent>
</VaCard>
</div>
</div>