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 e23229d..d3009ed 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,10 @@ beans = { if (!application.config.security.cas.enabled && !application.config.security.oidc.enabled) { noSSOStrategy(NoSSOStrategy) {} } + + 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)) + } }