From 26b1fd6572b7ad018ad9b601e6a9151920a1dd1f Mon Sep 17 00:00:00 2001
From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com>
Date: Mon, 29 May 2023 18:02:18 +0200
Subject: [PATCH] Feature/localize meta description (#2019)
* Add localized meta description
* Update changelog
---
CHANGELOG.md | 1 +
apps/api/src/app/frontend.middleware.ts | 20 ++++++++++++++++++++
apps/client/src/index.html | 5 +----
3 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8ebc2e6c..6d05a19a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Extended the testimonial section on the landing page
+- Added localized meta descriptions
- Added support for localized routes in Spanish (`es`)
### Changed
diff --git a/apps/api/src/app/frontend.middleware.ts b/apps/api/src/app/frontend.middleware.ts
index b028f799..5d355d19 100644
--- a/apps/api/src/app/frontend.middleware.ts
+++ b/apps/api/src/app/frontend.middleware.ts
@@ -19,6 +19,9 @@ export class FrontendMiddleware implements NestMiddleware {
public indexHtmlNl = '';
public indexHtmlPt = '';
+ private static readonly DEFAULT_DESCRIPTION =
+ 'Ghostfolio is a personal finance dashboard to keep track of your assets like stocks, ETFs or cryptocurrencies across multiple platforms.';
+
public constructor(
private readonly configurationService: ConfigurationService
) {
@@ -116,6 +119,8 @@ export class FrontendMiddleware implements NestMiddleware {
currentDate,
featureGraphicPath,
title,
+ description:
+ 'Mit dem Finanz-Dashboard Ghostfolio können Sie Ihr Vermögen in Form von Aktien, ETFs oder Kryptowährungen verteilt über mehrere Finanzinstitute überwachen.',
languageCode: 'de',
path: request.path,
rootUrl: this.configurationService.get('ROOT_URL')
@@ -127,6 +132,8 @@ export class FrontendMiddleware implements NestMiddleware {
currentDate,
featureGraphicPath,
title,
+ description:
+ 'Ghostfolio es un dashboard de finanzas personales para hacer un seguimiento de tus activos como acciones, ETFs o criptodivisas a través de múltiples plataformas.',
languageCode: 'es',
path: request.path,
rootUrl: this.configurationService.get('ROOT_URL')
@@ -135,7 +142,11 @@ export class FrontendMiddleware implements NestMiddleware {
} else if (request.path === '/fr' || request.path.startsWith('/fr/')) {
response.send(
this.interpolate(this.indexHtmlFr, {
+ currentDate,
featureGraphicPath,
+ title,
+ description:
+ 'Ghostfolio est un dashboard de finances personnelles qui permet de suivre vos actifs comme les actions, les ETF ou les crypto-monnaies sur plusieurs plateformes.',
languageCode: 'fr',
path: request.path,
rootUrl: this.configurationService.get('ROOT_URL')
@@ -147,6 +158,8 @@ export class FrontendMiddleware implements NestMiddleware {
currentDate,
featureGraphicPath,
title,
+ description:
+ 'Ghostfolio è un dashboard di finanza personale per tenere traccia delle vostre attività come azioni, ETF o criptovalute su più piattaforme.',
languageCode: 'it',
path: request.path,
rootUrl: this.configurationService.get('ROOT_URL')
@@ -158,6 +171,8 @@ export class FrontendMiddleware implements NestMiddleware {
currentDate,
featureGraphicPath,
title,
+ description:
+ 'Ghostfolio is een persoonlijk financieel dashboard om uw activa zoals aandelen, ETF’s of cryptocurrencies over meerdere platforms bij te houden.',
languageCode: 'nl',
path: request.path,
rootUrl: this.configurationService.get('ROOT_URL')
@@ -166,7 +181,11 @@ export class FrontendMiddleware implements NestMiddleware {
} else if (request.path === '/pt' || request.path.startsWith('/pt/')) {
response.send(
this.interpolate(this.indexHtmlPt, {
+ currentDate,
featureGraphicPath,
+ title,
+ description:
+ 'Ghostfolio é um dashboard de finanças pessoais para acompanhar os seus activos como acções, ETFs ou criptomoedas em múltiplas plataformas.',
languageCode: 'pt',
path: request.path,
rootUrl: this.configurationService.get('ROOT_URL')
@@ -178,6 +197,7 @@ export class FrontendMiddleware implements NestMiddleware {
currentDate,
featureGraphicPath,
title,
+ description: FrontendMiddleware.DEFAULT_DESCRIPTION,
languageCode: DEFAULT_LANGUAGE_CODE,
path: request.path,
rootUrl: this.configurationService.get('ROOT_URL')
diff --git a/apps/client/src/index.html b/apps/client/src/index.html
index d28bbf97..55120ec0 100644
--- a/apps/client/src/index.html
+++ b/apps/client/src/index.html
@@ -5,10 +5,7 @@
-
+