From c12d5a7dfc5d067bab4a5f5725fd6d3dd391cfa2 Mon Sep 17 00:00:00 2001 From: elweyn Date: Tue, 26 Mar 2024 10:01:55 +0100 Subject: [PATCH] Change default title to i18n.global.t('title') --- presenter/.env.dist | 1 - presenter/renderer/utils.ts | 3 ++- presenter/src/env.test.ts | 1 - presenter/src/env.ts | 1 - 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/presenter/.env.dist b/presenter/.env.dist index c70cbf337a..43fb1f185c 100644 --- a/presenter/.env.dist +++ b/presenter/.env.dist @@ -17,4 +17,3 @@ PUBLIC_ENV__ENDPOINTS__GRAPHQL_URI=http://localhost:4000/ PUBLIC_ENV__META__BASE_URL="http://localhost:3000" PUBLIC_ENV__META__DEFAULT_AUTHOR="DreamMall Verlag GbR" PUBLIC_ENV__META__DEFAULT_DESCRIPTION="Deine Reichweite Erweitern Alle Möglichkeiten Miteinander Ausschöpfen Lebensqualität Leben" -PUBLIC_ENV__META__DEFAULT_TITLE="DreamMall" diff --git a/presenter/renderer/utils.ts b/presenter/renderer/utils.ts index 72833d5e31..2c0297ba51 100644 --- a/presenter/renderer/utils.ts +++ b/presenter/renderer/utils.ts @@ -1,5 +1,6 @@ import { PageContext } from 'vike/types' +import i18n from '#plugins/i18n' import { META } from '#src/env' function getTitle(pageContext: PageContext) { @@ -7,7 +8,7 @@ function getTitle(pageContext: PageContext) { const val = pageContext.config.title if (typeof val === 'string') return val if (typeof val === 'function') return String(val(pageContext)) - return META.DEFAULT_TITLE + return i18n.global.t('title') } function getDescription(pageContext: PageContext) { const val = pageContext.config.description diff --git a/presenter/src/env.test.ts b/presenter/src/env.test.ts index 8d5ccadf7f..f681c3832b 100644 --- a/presenter/src/env.test.ts +++ b/presenter/src/env.test.ts @@ -9,7 +9,6 @@ describe('env', () => { DEFAULT_AUTHOR: 'DreamMall Verlag GbR', DEFAULT_DESCRIPTION: 'Deine Reichweite Erweitern Alle Möglichkeiten Miteinander Ausschöpfen Lebensqualität Leben', - DEFAULT_TITLE: 'DreamMall', }) }) }) diff --git a/presenter/src/env.ts b/presenter/src/env.ts index 52124b7ead..7a0d9f3257 100644 --- a/presenter/src/env.ts +++ b/presenter/src/env.ts @@ -24,7 +24,6 @@ const META = { 'DreamMall Verlag GbR') as string, DEFAULT_DESCRIPTION: (import.meta.env.PUBLIC_ENV__META__DEFAULT_DESCRIPTION ?? 'Deine Reichweite Erweitern Alle Möglichkeiten Miteinander Ausschöpfen Lebensqualität Leben') as string, - DEFAULT_TITLE: (import.meta.env.PUBLIC_ENV__META__DEFAULT_TITLE ?? 'DreamMall') as string, } export { AUTH, ENDPOINTS, META }