From 03dd8da049bd670502991ca2580d1780b6e644d9 Mon Sep 17 00:00:00 2001 From: Fritz Hoeing Date: Fri, 13 Jan 2023 13:35:03 +0100 Subject: [PATCH] fix: passing locale props to geostyler --- src/bootstrap.tsx | 19 ++++++++++++++++--- .../StylingDrawer/StylingComponent/index.tsx | 12 ++++++++---- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/bootstrap.tsx b/src/bootstrap.tsx index ca2f7081c..07a1f014e 100644 --- a/src/bootstrap.tsx +++ b/src/bootstrap.tsx @@ -12,6 +12,9 @@ import enGB from 'antd/lib/locale/en_GB'; import ClientConfiguration from 'clientConfig'; import Color from 'color'; +import { + locale as GsLocale +} from 'geostyler'; import Keycloak from 'keycloak-js'; @@ -110,11 +113,21 @@ const parser = new SHOGunApplicationUtil({ const getConfigLang = (lang: string) => { switch (lang) { case 'en': - return enGB; + return { + ...enGB, + ...GsLocale.en_US + }; + case 'de': - return deDE; + return { + ...deDE, + ...GsLocale.de_DE + }; default: - return enGB; + return { + ...enGB, + ...GsLocale.en_US + }; } }; diff --git a/src/components/ToolMenu/Draw/StylingDrawer/StylingComponent/index.tsx b/src/components/ToolMenu/Draw/StylingDrawer/StylingComponent/index.tsx index 7f6e3b496..8e3b7ca17 100644 --- a/src/components/ToolMenu/Draw/StylingDrawer/StylingComponent/index.tsx +++ b/src/components/ToolMenu/Draw/StylingDrawer/StylingComponent/index.tsx @@ -5,15 +5,18 @@ import { useState } from 'react'; -import OlParser from 'geostyler-openlayers-parser'; - import { - Style as GsStyle -} from 'geostyler-style'; + locale as locale +} from 'geostyler'; import CardStyle, { CardStyleProps } from 'geostyler/dist/Component/CardStyle/CardStyle'; +import OlParser from 'geostyler-openlayers-parser'; + +import { + Style as GsStyle +} from 'geostyler-style'; import OlFeature from 'ol/Feature'; @@ -181,6 +184,7 @@ export const StylingComponent: React.FC = ({ return (