From 774d4dacb6f226191bfe0e3ca9658b09f2217cc3 Mon Sep 17 00:00:00 2001 From: Pihkaal Date: Thu, 26 Feb 2026 19:55:24 +0100 Subject: [PATCH] feat(i18n): remove title in contact and i18nize the page titles --- app/app.vue | 3 +-- app/pages/gallery.vue | 3 ++- i18n/locales/en.json | 11 ++++++++++- i18n/locales/fr.json | 11 ++++++++++- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/app/app.vue b/app/app.vue index 7bba2c5..ceece8f 100644 --- a/app/app.vue +++ b/app/app.vue @@ -4,8 +4,7 @@ const { locale } = useI18n(); const app = useAppStore(); const pageTitle = computed(() => { if (!app.booted) return "Pihkaal"; - const name = app.screen.charAt(0).toUpperCase() + app.screen.slice(1); - return `${name} - Pihkaal`; + return `${$t(`screens.${app.screen}`)} - Pihkaal`; }); useHead({ diff --git a/app/pages/gallery.vue b/app/pages/gallery.vue index 9f745cc..ef0a12e 100644 --- a/app/pages/gallery.vue +++ b/app/pages/gallery.vue @@ -4,8 +4,9 @@ import type { InternalApi } from "nitropack/types"; import { promiseTimeout, useElementSize } from "@vueuse/core"; import gsap from "gsap"; +const { t } = useI18n(); useHead({ - title: "Gallery - Pihkaal", + title: computed(() => `${t("screens.gallery")} - Pihkaal`), }); const { data: images } = await useAsyncData( diff --git a/i18n/locales/en.json b/i18n/locales/en.json index d05fc90..1423d86 100644 --- a/i18n/locales/en.json +++ b/i18n/locales/en.json @@ -1,4 +1,13 @@ { + "screens": { + "home": "Home", + "contact": "Contact", + "projects": "Projects", + "settings": "Settings", + "gallery": "Gallery", + "achievements": "Achievements", + "credits": "Credits" + }, "lagModal": { "title": "Performance issues detected", "body": "Your device seems to be struggling with 3D rendering. Switch to 2D mode for a smoother experience.", @@ -180,7 +189,7 @@ } }, "contact": { - "title": "Choose a Chat Room to join.", + "title": "", "actions": { "open": "Open", "copy": "Copy", diff --git a/i18n/locales/fr.json b/i18n/locales/fr.json index e898c62..6e14cea 100644 --- a/i18n/locales/fr.json +++ b/i18n/locales/fr.json @@ -1,4 +1,13 @@ { + "screens": { + "home": "Accueil", + "contact": "Contact", + "projects": "Projets", + "settings": "Paramètres", + "gallery": "Galerie", + "achievements": "Succès", + "credits": "Crédits" + }, "lagModal": { "title": "Problèmes de performances détectés", "body": "Votre appareil semble avoir du mal avec le rendu 3D. Passez en mode 2D pour une expérience plus fluide.", @@ -180,7 +189,7 @@ } }, "contact": { - "title": "Choisissez un salon de discussion.", + "title": "", "actions": { "open": "Ouvrir", "copy": "Copier",