Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Add translation for product slogan (#2554)

Thomas Kaul379c651ce07a
diff --git a/apps/api/src/middlewares/html-template.middleware.ts b/apps/api/src/middlewares/html-template.middleware.ts
index f0358eca6c..24b8cf01bb 100644
--- a/apps/api/src/middlewares/html-template.middleware.ts
+++ b/apps/api/src/middlewares/html-template.middleware.ts
@@ -12,13 +12,12 @@ import { DATE_FORMAT, interpolate } from '@ghostfolio/common/helper';
import { format } from 'date-fns';
import { NextFunction, Request, Response } from 'express';
-const title = 'Ghostfolio – Open Source Wealth Management Software';
-const titleShort = 'Ghostfolio';
-
const i18nService = new I18nService();
let indexHtmlMap: { [languageCode: string]: string } = {};
+const title = 'Ghostfolio';
+
try {
indexHtmlMap = SUPPORTED_LANGUAGE_CODES.reduce(
(map, languageCode) => ({
@@ -35,47 +34,47 @@ try {
const locales = {
'/de/blog/2023/01/ghostfolio-auf-sackgeld-vorgestellt': {
featureGraphicPath: 'assets/images/blog/ghostfolio-x-sackgeld.png',
- title: `Ghostfolio auf Sackgeld.com vorgestellt - ${titleShort}`
+ title: `Ghostfolio auf Sackgeld.com vorgestellt - ${title}`
},
'/en/blog/2022/08/500-stars-on-github': {
featureGraphicPath: 'assets/images/blog/500-stars-on-github.jpg',
- title: `500 Stars - ${titleShort}`
+ title: `500 Stars - ${title}`
},
'/en/blog/2022/10/hacktoberfest-2022': {
featureGraphicPath: 'assets/images/blog/hacktoberfest-2022.png',
- title: `Hacktoberfest 2022 - ${titleShort}`
+ title: `Hacktoberfest 2022 - ${title}`
},
'/en/blog/2022/12/the-importance-of-tracking-your-personal-finances': {
featureGraphicPath: 'assets/images/blog/20221226.jpg',
- title: `The importance of tracking your personal finances - ${titleShort}`
+ title: `The importance of tracking your personal finances - ${title}`
},
'/en/blog/2023/02/ghostfolio-meets-umbrel': {
featureGraphicPath: 'assets/images/blog/ghostfolio-x-umbrel.png',
- title: `Ghostfolio meets Umbrel - ${titleShort}`
+ title: `Ghostfolio meets Umbrel - ${title}`
},
'/en/blog/2023/03/ghostfolio-reaches-1000-stars-on-github': {
featureGraphicPath: 'assets/images/blog/1000-stars-on-github.jpg',
- title: `Ghostfolio reaches 1’000 Stars on GitHub - ${titleShort}`
+ title: `Ghostfolio reaches 1’000 Stars on GitHub - ${title}`
},
'/en/blog/2023/05/unlock-your-financial-potential-with-ghostfolio': {
featureGraphicPath: 'assets/images/blog/20230520.jpg',
- title: `Unlock your Financial Potential with Ghostfolio - ${titleShort}`
+ title: `Unlock your Financial Potential with Ghostfolio - ${title}`
},
'/en/blog/2023/07/exploring-the-path-to-fire': {
featureGraphicPath: 'assets/images/blog/20230701.jpg',
- title: `Exploring the Path to FIRE - ${titleShort}`
+ title: `Exploring the Path to FIRE - ${title}`
},
'/en/blog/2023/08/ghostfolio-joins-oss-friends': {
featureGraphicPath: 'assets/images/blog/ghostfolio-joins-oss-friends.png',
- title: `Ghostfolio joins OSS Friends - ${titleShort}`
+ title: `Ghostfolio joins OSS Friends - ${title}`
},
'/en/blog/2023/09/ghostfolio-2': {
featureGraphicPath: 'assets/images/blog/ghostfolio-2.jpg',
- title: `Announcing Ghostfolio 2.0 - ${titleShort}`
+ title: `Announcing Ghostfolio 2.0 - ${title}`
},
'/en/blog/2023/09/hacktoberfest-2023': {
featureGraphicPath: 'assets/images/blog/hacktoberfest-2023.png',
- title: `Hacktoberfest 2023 - ${titleShort}`
+ title: `Hacktoberfest 2023 - ${title}`
}
};
@@ -128,7 +127,12 @@ export const HtmlTemplateMiddleware = async (
}),
featureGraphicPath:
locales[path]?.featureGraphicPath ?? 'assets/cover.png',
- title: locales[path]?.title ?? title
+ title:
+ locales[path]?.title ??
+ `${title} – ${i18nService.getTranslation({
+ languageCode,
+ id: 'slogan'
+ })}`
});
return response.send(indexHtml);
diff --git a/apps/client/src/app/pages/i18n/i18n-page.html b/apps/client/src/app/pages/i18n/i18n-page.html
index 1ace8e2972..eb9dc64af6 100644
--- a/apps/client/src/app/pages/i18n/i18n-page.html
+++ b/apps/client/src/app/pages/i18n/i18n-page.html
@@ -5,6 +5,7 @@
Ghostfolio is a personal finance dashboard to keep track of your assets
like stocks, ETFs or cryptocurrencies across multiple platforms.
</li>
+ <li i18n="@@slogan">Open Source Wealth Management Software</li>
</ul>
</div>
</div>
diff --git a/apps/client/src/locales/messages.de.xlf b/apps/client/src/locales/messages.de.xlf
index 5f20705fe0..9361997963 100644
--- a/apps/client/src/locales/messages.de.xlf
+++ b/apps/client/src/locales/messages.de.xlf
@@ -10927,6 +10927,14 @@
<context context-type="linenumber">377</context>
</context-group>
</trans-unit>
+ <trans-unit id="slogan" datatype="html">
+ <source>Open Source Wealth Management Software</source>
+ <target state="translated">Open Source Software für die Vermögensverwaltung</target>
+ <context-group purpose="location">
+ <context context-type="sourcefile">apps/client/src/app/pages/i18n/i18n-page.html</context>
+ <context context-type="linenumber">8</context>
+ </context-group>
+ </trans-unit>
</body>
</file>
</xliff>
diff --git a/apps/client/src/locales/messages.es.xlf b/apps/client/src/locales/messages.es.xlf
index 7cfb1e1d84..6bded38589 100644
--- a/apps/client/src/locales/messages.es.xlf
+++ b/apps/client/src/locales/messages.es.xlf
@@ -10925,6 +10925,14 @@
<context context-type="linenumber">377</context>
</context-group>
</trans-unit>
+ <trans-unit id="slogan" datatype="html">
+ <source>Open Source Wealth Management Software</source>
+ <target state="new">Open Source Wealth Management Software</target>
+ <context-group purpose="location">
+ <context context-type="sourcefile">apps/client/src/app/pages/i18n/i18n-page.html</context>
+ <context context-type="linenumber">8</context>
+ </context-group>
+ </trans-unit>
</body>
</file>
</xliff>
diff --git a/apps/client/src/locales/messages.fr.xlf b/apps/client/src/locales/messages.fr.xlf
index 06235673c8..a08331a1cf 100644
--- a/apps/client/src/locales/messages.fr.xlf
+++ b/apps/client/src/locales/messages.fr.xlf
@@ -10924,6 +10924,14 @@
<context context-type="linenumber">377</context>
</context-group>
</trans-unit>
+ <trans-unit id="slogan" datatype="html">
+ <source>Open Source Wealth Management Software</source>
+ <target state="new">Open Source Wealth Management Software</target>
+ <context-group purpose="location">
+ <context context-type="sourcefile">apps/client/src/app/pages/i18n/i18n-page.html</context>
+ <context context-type="linenumber">8</context>
+ </context-group>
+ </trans-unit>
</body>
</file>
</xliff>
diff --git a/apps/client/src/locales/messages.it.xlf b/apps/client/src/locales/messages.it.xlf
index 9e64e2f11b..109ce7b865 100644
--- a/apps/client/src/locales/messages.it.xlf
+++ b/apps/client/src/locales/messages.it.xlf
@@ -10925,6 +10925,14 @@
<context context-type="linenumber">377</context>
</context-group>
</trans-unit>
+ <trans-unit id="slogan" datatype="html">
+ <source>Open Source Wealth Management Software</source>
+ <target state="new">Open Source Wealth Management Software</target>
+ <context-group purpose="location">
+ <context context-type="sourcefile">apps/client/src/app/pages/i18n/i18n-page.html</context>
+ <context context-type="linenumber">8</context>
+ </context-group>
+ </trans-unit>
</body>
</file>
</xliff>
diff --git a/apps/client/src/locales/messages.nl.xlf b/apps/client/src/locales/messages.nl.xlf
index 43f865db6c..6282b17feb 100644
--- a/apps/client/src/locales/messages.nl.xlf
+++ b/apps/client/src/locales/messages.nl.xlf
@@ -10924,6 +10924,14 @@
<context context-type="linenumber">377</context>
</context-group>
</trans-unit>
+ <trans-unit id="slogan" datatype="html">
+ <source>Open Source Wealth Management Software</source>
+ <target state="new">Open Source Wealth Management Software</target>
+ <context-group purpose="location">
+ <context context-type="sourcefile">apps/client/src/app/pages/i18n/i18n-page.html</context>
+ <context context-type="linenumber">8</context>
+ </context-group>
+ </trans-unit>
</body>
</file>
</xliff>
diff --git a/apps/client/src/locales/messages.pt.xlf b/apps/client/src/locales/messages.pt.xlf
index eb902fd6d4..c9695f7fb3 100644
--- a/apps/client/src/locales/messages.pt.xlf
+++ b/apps/client/src/locales/messages.pt.xlf
@@ -10924,6 +10924,14 @@
<context context-type="linenumber">377</context>
</context-group>
</trans-unit>
+ <trans-unit id="slogan" datatype="html">
+ <source>Open Source Wealth Management Software</source>
+ <target state="new">Open Source Wealth Management Software</target>
+ <context-group purpose="location">
+ <context context-type="sourcefile">apps/client/src/app/pages/i18n/i18n-page.html</context>
+ <context context-type="linenumber">8</context>
+ </context-group>
+ </trans-unit>
</body>
</file>
</xliff>
diff --git a/apps/client/src/locales/messages.tr.xlf b/apps/client/src/locales/messages.tr.xlf
index 83a2a892f2..fa18a47b14 100644
--- a/apps/client/src/locales/messages.tr.xlf
+++ b/apps/client/src/locales/messages.tr.xlf
@@ -10924,6 +10924,14 @@
<context context-type="linenumber">377</context>
</context-group>
</trans-unit>
+ <trans-unit id="slogan" datatype="html">
+ <source>Open Source Wealth Management Software</source>
+ <target state="new">Open Source Wealth Management Software</target>
+ <context-group purpose="location">
+ <context context-type="sourcefile">apps/client/src/app/pages/i18n/i18n-page.html</context>
+ <context context-type="linenumber">8</context>
+ </context-group>
+ </trans-unit>
</body>
</file>
</xliff>
diff --git a/apps/client/src/locales/messages.xlf b/apps/client/src/locales/messages.xlf
index a2a294d3d6..9133cd9bf7 100644
--- a/apps/client/src/locales/messages.xlf
+++ b/apps/client/src/locales/messages.xlf
@@ -10350,6 +10350,13 @@
<context context-type="linenumber">377</context>
</context-group>
</trans-unit>
+ <trans-unit id="slogan" datatype="html">
+ <source>Open Source Wealth Management Software</source>
+ <context-group purpose="location">
+ <context context-type="sourcefile">apps/client/src/app/pages/i18n/i18n-page.html</context>
+ <context context-type="linenumber">8</context>
+ </context-group>
+ </trans-unit>
</body>
</file>
</xliff>