Skip to content

feat: Add LocaleAffinityBiCalculator#23

Merged
ericfjosne merged 11 commits intomainfrom
feat-Add-locale-affinity-bi-calculator
Jun 18, 2025
Merged

feat: Add LocaleAffinityBiCalculator#23
ericfjosne merged 11 commits intomainfrom
feat-Add-locale-affinity-bi-calculator

Conversation

@ericfjosne
Copy link
Copy Markdown
Collaborator

@ericfjosne ericfjosne commented Jun 18, 2025

At the moment, locale join operations based on locale affinity require to understand and implement reference locale-based operations.

This is not ideal and can be abstracted away fully by offering a LocaleAffinityBiCalculator interface, which exposes the following method:

LocaleAffinityResult calculate(@Nullable final String languageTag1, @Nullable final String languageTag2);

We will still make use of the related reference locale-based helpers under the hood to perform the actual calculation, but at least users of the library won't ever have to deal with it, and are offered a simpler interface to achieve the same result.

This PR also includes a bug fix for an issue that was detected during tests, relating to locale affinity calculation involving Bosnian and Croatian.

@ericfjosne ericfjosne force-pushed the feat-Add-locale-affinity-bi-calculator branch from d57310c to 9e137f9 Compare June 18, 2025 10:27
@ericfjosne ericfjosne requested a review from aabramov-pc June 18, 2025 13:20
Copy link
Copy Markdown
Collaborator

@aabramov-pc aabramov-pc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ericfjosne ericfjosne merged commit aa68db1 into main Jun 18, 2025
1 check passed
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.

2 participants