Added more translations to meta and delete modals
This commit is contained in:
1
app.vue
1
app.vue
@@ -9,7 +9,6 @@ useHead({
|
|||||||
{ name: "charset", content: "UTF-8" },
|
{ name: "charset", content: "UTF-8" },
|
||||||
{ name: "viewport", content: "width=device-width, initial-scale=1.0" },
|
{ name: "viewport", content: "width=device-width, initial-scale=1.0" },
|
||||||
{ name: "author", content: "Alexis Pelé" },
|
{ name: "author", content: "Alexis Pelé" },
|
||||||
{ name: "description", content: "Tools destined to players and game master, helping them visualize their worlds better." },
|
|
||||||
{ name: "generator", content: "Nuxt" },
|
{ name: "generator", content: "Nuxt" },
|
||||||
{ name: "msapplication-TileColor", content: "00aba9" },
|
{ name: "msapplication-TileColor", content: "00aba9" },
|
||||||
{ name: "theme-color", content: "00aba9" },
|
{ name: "theme-color", content: "00aba9" },
|
||||||
|
|||||||
@@ -53,10 +53,12 @@ function handleClosing() {
|
|||||||
@interact-outside="handleClosing"
|
@interact-outside="handleClosing"
|
||||||
@pointer-down-outside="handleClosing"
|
@pointer-down-outside="handleClosing"
|
||||||
>
|
>
|
||||||
<UiAlertDialogTitle> Êtes-vous sûr de supprimer ce calendrier ?</UiAlertDialogTitle>
|
<UiAlertDialogTitle>
|
||||||
|
{{ $t('entity.calendar.deleteDialog.title') }}
|
||||||
|
</UiAlertDialogTitle>
|
||||||
|
|
||||||
<UiAlertDialogDescription>
|
<UiAlertDialogDescription>
|
||||||
Les évènements ne seront plus accessibles et vous ne pourrez plus récupérer les données !
|
{{ $t('entity.calendar.deleteDialog.subtitle') }}
|
||||||
</UiAlertDialogDescription>
|
</UiAlertDialogDescription>
|
||||||
|
|
||||||
<form @submit.prevent="handleAction">
|
<form @submit.prevent="handleAction">
|
||||||
@@ -70,13 +72,13 @@ function handleClosing() {
|
|||||||
|
|
||||||
<footer class="flex gap-2 justify-between">
|
<footer class="flex gap-2 justify-between">
|
||||||
<UiButton type="button" size="sm" variant="outline" @click="handleClosing">
|
<UiButton type="button" size="sm" variant="outline" @click="handleClosing">
|
||||||
Retour
|
{{ $t('ui.action.back') }}
|
||||||
</UiButton>
|
</UiButton>
|
||||||
|
|
||||||
<div class="flex gap-2 justify-end">
|
<div class="flex gap-2 justify-end">
|
||||||
<Transition name="fade-delay">
|
<Transition name="fade-delay">
|
||||||
<UiButton v-if="isLoading" type="button" size="sm" variant="destructive">
|
<UiButton v-if="isLoading" type="button" size="sm" variant="destructive">
|
||||||
Annuler
|
{{ $t('ui.action.cancel') }}
|
||||||
</UiButton>
|
</UiButton>
|
||||||
</Transition>
|
</Transition>
|
||||||
|
|
||||||
@@ -85,7 +87,7 @@ function handleClosing() {
|
|||||||
<PhCircleNotch v-if="isLoading" size="20" class="animate-spin"/>
|
<PhCircleNotch v-if="isLoading" size="20" class="animate-spin"/>
|
||||||
</Transition>
|
</Transition>
|
||||||
|
|
||||||
Supprimer "{{ calendar?.name }}"
|
{{ $t('entity.deleteOne', { entity: calendar?.name }) }}
|
||||||
</UiButton>
|
</UiButton>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -3,7 +3,16 @@ export default defineI18nConfig(() => ({
|
|||||||
locale: "fr",
|
locale: "fr",
|
||||||
messages: {
|
messages: {
|
||||||
en: {
|
en: {
|
||||||
|
head: {
|
||||||
|
title: "Fantasy calendars for TTRPGs",
|
||||||
|
description: "Tools for players and game masters to help them visualize fantasy worlds better."
|
||||||
|
},
|
||||||
ui: {
|
ui: {
|
||||||
|
action: {
|
||||||
|
back: "Back",
|
||||||
|
cancel: "Cancel",
|
||||||
|
save: "Save"
|
||||||
|
},
|
||||||
greeting: "Connected as {user}",
|
greeting: "Connected as {user}",
|
||||||
sidebarMenu: {
|
sidebarMenu: {
|
||||||
appearance: "Appearance",
|
appearance: "Appearance",
|
||||||
@@ -18,14 +27,34 @@ export default defineI18nConfig(() => ({
|
|||||||
system: "System",
|
system: "System",
|
||||||
},
|
},
|
||||||
entity: {
|
entity: {
|
||||||
|
deleteOne: "Delete \"{entity}\"",
|
||||||
world: {
|
world: {
|
||||||
nameSingular: "World",
|
nameSingular: "World",
|
||||||
namePlural: "Worlds",
|
namePlural: "Worlds",
|
||||||
|
},
|
||||||
|
calendar: {
|
||||||
|
nameSingular: "Calendar",
|
||||||
|
namePlural: "Calendars",
|
||||||
|
addSingle: "Add a calendar",
|
||||||
|
notFoundForWorld: "No calendar for this world… yet !",
|
||||||
|
deleteDialog: {
|
||||||
|
title: "Are you sure you want to delete this calendar ?",
|
||||||
|
subtitle: "Its events won't be accessible anymore and you won't be able to retrieve the deleted data !",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fr: {
|
fr: {
|
||||||
|
head: {
|
||||||
|
title: "Calendriers fantasies pour JDR",
|
||||||
|
description: "Outils destinés aux joueurs et maîtres de jeux pour visualiser plus facilement leurs univers."
|
||||||
|
},
|
||||||
ui: {
|
ui: {
|
||||||
|
action: {
|
||||||
|
back: "Retour",
|
||||||
|
cancel: "Annuler",
|
||||||
|
save: "Sauvegarder"
|
||||||
|
},
|
||||||
greeting: "Connecté en tant que {user}",
|
greeting: "Connecté en tant que {user}",
|
||||||
sidebarMenu: {
|
sidebarMenu: {
|
||||||
appearance: "Apparence",
|
appearance: "Apparence",
|
||||||
@@ -40,9 +69,20 @@ export default defineI18nConfig(() => ({
|
|||||||
system: "Système",
|
system: "Système",
|
||||||
},
|
},
|
||||||
entity: {
|
entity: {
|
||||||
|
deleteOne: "Supprimer \"{entity}\"",
|
||||||
world: {
|
world: {
|
||||||
nameSingular: "Monde",
|
nameSingular: "Monde",
|
||||||
namePlural: "Mondes",
|
namePlural: "Mondes",
|
||||||
|
},
|
||||||
|
calendar: {
|
||||||
|
nameSingular: "Calendriers",
|
||||||
|
namePlural: "Calendrier",
|
||||||
|
addSingle: "Ajouter un calendrier",
|
||||||
|
notFoundForWorld: "Aucun calendrier pour ce monde… pour l'instant !",
|
||||||
|
deleteDialog: {
|
||||||
|
title: "Êtes-vous sûr de supprimer ce calendrier ?",
|
||||||
|
subtitle: "Les évènements ne seront plus accessibles et vous ne pourrez plus récupérer les données !",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,18 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
useHead({
|
useHead({
|
||||||
title: "TTTools — Calendriers de JDR",
|
|
||||||
titleTemplate: null
|
titleTemplate: null
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<main class="p-8">
|
<main class="p-8">
|
||||||
|
<Head>
|
||||||
|
<Title>
|
||||||
|
TTTools — {{ $t('head.title') }}
|
||||||
|
</Title>
|
||||||
|
<Meta name="description" :content="$t('head.description')" />
|
||||||
|
</Head>
|
||||||
|
|
||||||
<Heading>TTTools</Heading>
|
<Heading>TTTools</Heading>
|
||||||
</main>
|
</main>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -23,27 +23,25 @@ const { data: catData, pending: catPending } = await useLazyFetch("/api/calendar
|
|||||||
|
|
||||||
const cal = computed<Calendar>(() => calendarData?.value?.data as Calendar)
|
const cal = computed<Calendar>(() => calendarData?.value?.data as Calendar)
|
||||||
const categories = computed<Category[]>(() => catData?.value?.data as Category[])
|
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>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="calPending || catPending" class="h-full w-full grid place-items-center">
|
<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">
|
<div class="grid gap-2 justify-items-center opacity-50">
|
||||||
<p>Chargement du calendrier</p>
|
<p>Chargement du calendrier</p>
|
||||||
<PhCircleNotch size="50" class="animate-spin"/>
|
<PhCircleNotch size="50" class="animate-spin"/>
|
||||||
</div>
|
</div>
|
||||||
</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>
|
</template>
|
||||||
|
|||||||
@@ -2,10 +2,6 @@
|
|||||||
import type { RealtimeChannel } from "@supabase/supabase-js"
|
import type { RealtimeChannel } from "@supabase/supabase-js"
|
||||||
import type { World } from "~/models/World";
|
import type { World } from "~/models/World";
|
||||||
|
|
||||||
useHead({
|
|
||||||
title: "Mondes"
|
|
||||||
})
|
|
||||||
|
|
||||||
const supabase = useSupabaseClient()
|
const supabase = useSupabaseClient()
|
||||||
|
|
||||||
const { data: res } = await useFetch("/api/worlds/query")
|
const { data: res } = await useFetch("/api/worlds/query")
|
||||||
@@ -86,11 +82,15 @@ onUnmounted(() => {
|
|||||||
|
|
||||||
<template>
|
<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>
|
<Heading>{{ user?.user_metadata.full_name }}</Heading>
|
||||||
|
|
||||||
<section v-if="worlds" class="mt-4">
|
<section v-if="worlds" class="mt-4">
|
||||||
<h2 class="mb-4 text-lg font-bold">
|
<h2 class="mb-4 text-lg font-bold">
|
||||||
Mondes
|
{{ $t('entity.world.namePlural') }}
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<ul class="grid lg:grid-cols-2 gap-2">
|
<ul class="grid lg:grid-cols-2 gap-2">
|
||||||
|
|||||||
@@ -12,20 +12,6 @@ const { data: res, pending } = await useFetch("/api/worlds/query", { query: { id
|
|||||||
|
|
||||||
const world = ref<World>(res.value?.data as World)
|
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({
|
definePageMeta({
|
||||||
middleware: ["auth-guard"]
|
middleware: ["auth-guard"]
|
||||||
})
|
})
|
||||||
@@ -116,9 +102,17 @@ function hideDeleteModal() {
|
|||||||
<template>
|
<template>
|
||||||
<main class="p-8">
|
<main class="p-8">
|
||||||
<template v-if="pending">
|
<template v-if="pending">
|
||||||
|
<Head>
|
||||||
|
<Title>{{ $t("entity.world.namePlural") }}</Title>
|
||||||
|
</Head>
|
||||||
|
|
||||||
<Heading>Chargement...</Heading>
|
<Heading>Chargement...</Heading>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="world">
|
<template v-else-if="world">
|
||||||
|
<Head>
|
||||||
|
<Title>{{ world.name }}</Title>
|
||||||
|
</Head>
|
||||||
|
|
||||||
<header class="lg:w-1/2 mb-8">
|
<header class="lg:w-1/2 mb-8">
|
||||||
<Spacing>
|
<Spacing>
|
||||||
<Heading>{{ world.name }}</Heading>
|
<Heading>{{ world.name }}</Heading>
|
||||||
@@ -130,7 +124,9 @@ function hideDeleteModal() {
|
|||||||
<section>
|
<section>
|
||||||
<Spacing size="lg">
|
<Spacing size="lg">
|
||||||
<div class="flex items-center gap-3">
|
<div class="flex items-center gap-3">
|
||||||
<Heading>Calendriers</Heading>
|
<Heading>
|
||||||
|
{{ $t('entity.calendar.namePlural') }}
|
||||||
|
</Heading>
|
||||||
|
|
||||||
<UiTooltipProvider :delay-duration="250">
|
<UiTooltipProvider :delay-duration="250">
|
||||||
<UiTooltip>
|
<UiTooltip>
|
||||||
@@ -140,7 +136,9 @@ function hideDeleteModal() {
|
|||||||
</UiButton>
|
</UiButton>
|
||||||
</UiTooltipTrigger>
|
</UiTooltipTrigger>
|
||||||
<UiTooltipContent :side-offset="10">
|
<UiTooltipContent :side-offset="10">
|
||||||
<p>Ajouter un calendrier</p>
|
<p>
|
||||||
|
{{ $t('entity.calendar.addSingle') }}
|
||||||
|
</p>
|
||||||
</UiTooltipContent>
|
</UiTooltipContent>
|
||||||
</UiTooltip>
|
</UiTooltip>
|
||||||
</UiTooltipProvider>
|
</UiTooltipProvider>
|
||||||
@@ -168,7 +166,7 @@ function hideDeleteModal() {
|
|||||||
</ul>
|
</ul>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<p class="pl-6 opacity-75 italic">
|
<p class="pl-6 opacity-75 italic">
|
||||||
Aucun calendrier pour ce monde
|
{{ $t('entity.calendar.notFoundForWorld') }}
|
||||||
</p>
|
</p>
|
||||||
</template>
|
</template>
|
||||||
</Spacing>
|
</Spacing>
|
||||||
|
|||||||
Reference in New Issue
Block a user