Skip to content

fix: format query locations independently of the default locale - #383

Open
bardrop (bardrop) wants to merge 1 commit into
contentful:masterfrom
bardrop-oss:locale-independent-coordinates
Open

bardrop (bardrop) wants to merge 1 commit into
contentful:masterfrom
bardrop-oss:locale-independent-coordinates

Conversation

@bardrop

Copy link
Copy Markdown

Location, BoundingBox and BoundingCircle build the query value with String.format and the default locale. On a device with a decimal comma the coordinates cannot be told apart any more:

Locale.setDefault(Locale.GERMANY);
query.where("fields.bar", IsCloseTo, new Location(52.5, 13.4));
// fields.bar[near]=52,500000,13,400000

With an Arabic locale the digits can change too. The values are now formatted with Locale.ROOT.

The new test in AbsQueryTest fails without the change. ./mvnw -B test passes (240 tests). I added a line to the Unreleased section of the changelog.

@bardrop
bardrop (bardrop) requested a review from a team as a code owner November 24, 2026 06:43

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant