Use composition for translation

This commit is contained in:
2025-08-14 19:56:49 +02:00
parent 900414727f
commit 24f933fbaa
12 changed files with 111 additions and 99 deletions
+11 -4
View File
@@ -5,7 +5,7 @@ import { useTitleStore } from '~/stores/title';
const app = useNuxtApp();
const { loggedIn } = useUserSession();
const localePath = useLocalePath();
const { t } = useI18n();
const { t, d } = useI18n();
const { name, id } = app.$slugData.huntSlug!;
@@ -43,6 +43,12 @@ async function invite() {
<template>
<h1 class="text-2xl">
{{ data?.name || name }}
<VaButton
icon="replay"
@click="refresh"
:disabled="pending"
title="Refresh"
/>
<VaButtonGroup v-if="data?.isMember">
<VaButton
color="danger"
@@ -78,7 +84,7 @@ async function invite() {
<p v-if="data.start">
Start:
{{
$d(data.start, {
d(data.start, {
dateStyle: 'medium',
timeStyle: 'medium'
})
@@ -87,7 +93,7 @@ async function invite() {
<p v-if="data.end">
End:
{{
$d(data.end, {
d(data.end, {
dateStyle: 'medium',
timeStyle: 'medium'
})
@@ -176,6 +182,7 @@ async function invite() {
<VaCardActions v-if="data.isMember">
<VaButton
color="danger"
:icon="(quest.unreviewed || 0) > 0 ? 'priority_high' : undefined"
:to="$localePath(`/hunt/${sluggy(data)}/${sluggy(quest)}/admin`)"
>Admin ({{ quest.unreviewed || 0 }} unreviewed)</VaButton
>
@@ -192,7 +199,7 @@ async function invite() {
</div>
<div v-if="error">
<h1 class="mt-8 text-3xl">{{ $t(parseError(error)) }}</h1>
<h1 class="mt-8 text-3xl">{{ t(parseError(error)) }}</h1>
<VaButton icon="arrow_back" :to="$localePath(`/`)">Back home</VaButton>
</div>
</template>