Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using a fixed locale as a workaround for issues with number formatting when adding layers #251

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions grails-app/conf/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions grails-app/conf/spring/resources.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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))
}
}