Skip to content

Add a preferredLocales dependency - #468

Merged
stephencelis merged 6 commits into
pointfreeco:mainfrom
davdroman:feat/preferred-locales-dependency
Aug 21, 2026
Merged

stephencelis merged 6 commits into
pointfreeco:mainfrom
davdroman:feat/preferred-locales-dependency

Conversation

@davdroman

Copy link
Copy Markdown
Contributor

Adds @Dependency(\.preferredLocales) for ordered content-language preferences, distinct from the formatting-oriented locale dependency.

Discussed in #467.

davdroman and others added 2 commits August 21, 2026 13:11
Expose ordered content-language locales independently from the formatting locale. Evaluate preferred languages on each access and support deterministic test overrides.

@stephencelis stephencelis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! Made a few small tweaks.

@davdroman

Copy link
Copy Markdown
Contributor Author

@stephencelis interesting. I can't discern why an existential is preferable to a closure, seems overly ceremonious with no obvious pay-off. Has guidance around this changed recently? 🤔

I'm not against it btw, just genuinely curious.

@stephencelis

Copy link
Copy Markdown
Member

@davdroman Mainly provides better identity and memory/storage, though the existential is a wash when it comes to performance, not that this is a performance-critical path. I could try squashing the conformances into a single concrete type, though.

@stephencelis
stephencelis merged commit f84167a into pointfreeco:main Aug 21, 2026
13 of 14 checks passed
@davdroman
davdroman deleted the feat/preferred-locales-dependency branch August 25, 2026 08:07
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