Added more translations to meta and delete modals

This commit is contained in:
Alexis
2024-09-02 20:07:01 +02:00
parent 6d66b599cf
commit 85c661eda5
7 changed files with 86 additions and 43 deletions

View File

@@ -1,12 +1,18 @@
<script lang="ts" setup>
useHead({
title: "TTTools — Calendriers de JDR",
titleTemplate: null
})
</script>
<template>
<main class="p-8">
<Head>
<Title>
TTTools {{ $t('head.title') }}
</Title>
<Meta name="description" :content="$t('head.description')" />
</Head>
<Heading>TTTools</Heading>
</main>
</template>

View File

@@ -23,27 +23,25 @@ const { data: catData, pending: catPending } = await useLazyFetch("/api/calendar
const cal = computed<Calendar>(() => calendarData?.value?.data as Calendar)
const categories = computed<Category[]>(() => catData?.value?.data as Category[])
if (cal.value) {
useHead({
title: cal.value.name
})
}
watch(cal, (n) => {
useHead({
title: n.name
})
})
</script>
<template>
<div v-if="calPending || catPending" class="h-full w-full grid place-items-center">
<Head>
<Title>{{ $t("entity.calendar.nameSingular") }}</Title>
</Head>
<div class="grid gap-2 justify-items-center opacity-50">
<p>Chargement du calendrier</p>
<PhCircleNotch size="50" class="animate-spin"/>
</div>
</div>
<Calendar v-else-if="cal && categories" :calendar-data="cal" :categories />
<div v-else-if="cal && categories" class="h-full w-full">
<Head>
<Title>{{ cal.name }}</Title>
</Head>
<Calendar :calendar-data="cal" :categories />
</div>
</template>

View File

@@ -2,10 +2,6 @@
import type { RealtimeChannel } from "@supabase/supabase-js"
import type { World } from "~/models/World";
useHead({
title: "Mondes"
})
const supabase = useSupabaseClient()
const { data: res } = await useFetch("/api/worlds/query")
@@ -85,12 +81,16 @@ onUnmounted(() => {
</script>
<template>
<main class="p-8 after:fill-red-400">
<main class="p-8 after:fill-red-400">
<Head>
<Title>{{ $t("entity.world.namePlural") }}</Title>
</Head>
<Heading>{{ user?.user_metadata.full_name }}</Heading>
<section v-if="worlds" class="mt-4">
<h2 class="mb-4 text-lg font-bold">
Mondes
{{ $t('entity.world.namePlural') }}
</h2>
<ul class="grid lg:grid-cols-2 gap-2">

View File

@@ -12,20 +12,6 @@ const { data: res, pending } = await useFetch("/api/worlds/query", { query: { id
const world = ref<World>(res.value?.data as World)
if (world.value) {
useHead({
title: world.value.name
})
}
watch(world, (n) => {
if (n) {
useHead({
title: n.name
})
}
}, { deep: true })
definePageMeta({
middleware: ["auth-guard"]
})
@@ -116,9 +102,17 @@ function hideDeleteModal() {
<template>
<main class="p-8">
<template v-if="pending">
<Head>
<Title>{{ $t("entity.world.namePlural") }}</Title>
</Head>
<Heading>Chargement...</Heading>
</template>
<template v-else-if="world">
<Head>
<Title>{{ world.name }}</Title>
</Head>
<header class="lg:w-1/2 mb-8">
<Spacing>
<Heading>{{ world.name }}</Heading>
@@ -130,7 +124,9 @@ function hideDeleteModal() {
<section>
<Spacing size="lg">
<div class="flex items-center gap-3">
<Heading>Calendriers</Heading>
<Heading>
{{ $t('entity.calendar.namePlural') }}
</Heading>
<UiTooltipProvider :delay-duration="250">
<UiTooltip>
@@ -140,7 +136,9 @@ function hideDeleteModal() {
</UiButton>
</UiTooltipTrigger>
<UiTooltipContent :side-offset="10">
<p>Ajouter un calendrier</p>
<p>
{{ $t('entity.calendar.addSingle') }}
</p>
</UiTooltipContent>
</UiTooltip>
</UiTooltipProvider>
@@ -168,7 +166,7 @@ function hideDeleteModal() {
</ul>
<template v-else>
<p class="pl-6 opacity-75 italic">
Aucun calendrier pour ce monde
{{ $t('entity.calendar.notFoundForWorld') }}
</p>
</template>
</Spacing>