From 8ad670ecdef2830b98693cd5310bf873f790b056 Mon Sep 17 00:00:00 2001 From: Florian Esser Date: Thu, 31 Oct 2024 20:15:59 +0100 Subject: [PATCH] feat(i18n): add workaround for translating tagline --- docusaurus.config.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/docusaurus.config.js b/docusaurus.config.js index 41f71570f..43a9906b2 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -4,10 +4,25 @@ const lightCodeTheme = require('prism-react-renderer/themes/github'); const darkCodeTheme = require('prism-react-renderer/themes/dracula'); +const getCurrentLocale = () => process.env.DOCUSAURUS_CURRENT_LOCALE ?? 'en'; + +/** + * Workaround for https://github.com/facebook/docusaurus/issues/4542 + */ +const getTagline = () => { + switch (getCurrentLocale()) { + case 'de': + return 'Eine der führenden Plattformen für Geodatentransformation'; + case 'en': + default: + return 'One of the world\'s leading platforms for spatial data transformation'; + } +}; + /** @type {import('@docusaurus/types').Config} */ const config = { title: 'hale»connect', - tagline: 'One of the world\'s leading platforms for Geodata Transformations', + tagline: getTagline(), url: 'https://help.wetransform.to', baseUrl: '/', onBrokenLinks: 'throw',