From 05ae0d8570b8b68af62cb8d3862d5d790dd16b4d Mon Sep 17 00:00:00 2001 From: Stefan Van Dyck Date: Thu, 24 Oct 2024 13:20:38 +0200 Subject: [PATCH 1/2] inbo/vlaams-biodiversiteitsportaal#116: Always use english locale to prevent issues with number formatting in some others. --- grails-app/conf/spring/resources.groovy | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/grails-app/conf/spring/resources.groovy b/grails-app/conf/spring/resources.groovy index e23229d..a0f9a60 100644 --- a/grails-app/conf/spring/resources.groovy +++ b/grails-app/conf/spring/resources.groovy @@ -5,6 +5,7 @@ import au.org.ala.spatial.web.NoSSOStrategy import com.github.ziplet.filter.compression.CompressingFilter import org.springframework.boot.web.servlet.FilterRegistrationBean import org.springframework.core.Ordered +import org.springframework.web.servlet.i18n.FixedLocaleResolver beans = { compressionFilter(FilterRegistrationBean) { @@ -17,4 +18,8 @@ beans = { if (!application.config.security.cas.enabled && !application.config.security.oidc.enabled) { noSSOStrategy(NoSSOStrategy) {} } + + // Use fixed English locale, prevents issues with parsing of BBox decimal values in some locales + // https://github.com/AtlasOfLivingAustralia/spatial-service/issues/247 + localeResolver(FixedLocaleResolver, new Locale('en')) } From 842c360f656cf35b3d0eb43764855e95400a8370 Mon Sep 17 00:00:00 2001 From: Stefan Van Dyck Date: Thu, 24 Oct 2024 13:29:14 +0200 Subject: [PATCH 2/2] inbo/vlaams-biodiversiteitsportaal#116: Allow using a fixed locale to prevent issues with number formatting when adding layers. https://github.com/AtlasOfLivingAustralia/spatial-service/issues/247 --- grails-app/conf/application.yml | 2 ++ grails-app/conf/spring/resources.groovy | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/grails-app/conf/application.yml b/grails-app/conf/application.yml index 11d0d2c..28b9470 100644 --- a/grails-app/conf/application.yml +++ b/grails-app/conf/application.yml @@ -467,3 +467,5 @@ openapi: version: '@info.app.version@' cachetimeoutms: 4000 +# Allow setting a fixed locale to prevent number formatting issues: https://github.com/AtlasOfLivingAustralia/spatial-service/issues/247 +#useFixedLocale: en \ No newline at end of file diff --git a/grails-app/conf/spring/resources.groovy b/grails-app/conf/spring/resources.groovy index a0f9a60..d3009ed 100644 --- a/grails-app/conf/spring/resources.groovy +++ b/grails-app/conf/spring/resources.groovy @@ -19,7 +19,9 @@ beans = { noSSOStrategy(NoSSOStrategy) {} } - // Use fixed English locale, prevents issues with parsing of BBox decimal values in some locales - // https://github.com/AtlasOfLivingAustralia/spatial-service/issues/247 - localeResolver(FixedLocaleResolver, new Locale('en')) + if (grailsApplication.config.useFixedLocale) { + // Use fixed English locale, prevents issues with parsing of BBox decimal values in some locales + // https://github.com/AtlasOfLivingAustralia/spatial-service/issues/247 + localeResolver(FixedLocaleResolver, new Locale(grailsApplication.config.useFixedLocale)) + } }