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

Fix localization fallback behaviour #163

Merged
merged 3 commits into from
Dec 28, 2024

Conversation

mattesmohr
Copy link
Member

@mattesmohr mattesmohr commented Dec 27, 2024

This pull request adds an additional fallback check to the rendering for the localization. Currently, the only check is whether the localization is initialized, which can result in a false positive because the Vapor provider initializes it during configuration. To address this, another check has been introduced to determine if the localization is intended for use, based on the configuration setter.

app.htmlkit.localization.set(source:)
app.htmlkit.localization.set(locale:)

It also prevents the default locale from being overridden. Currently, the default locale gets overridden by the client's accept language header through the provider, but the environment locale is the value that should actually be overridden instead.

@mattesmohr mattesmohr marked this pull request as ready for review December 28, 2024 12:56
@mattesmohr mattesmohr merged commit e0a2c3e into main Dec 28, 2024
1 check passed
@mattesmohr mattesmohr deleted the fix-localization-fallback-behavior branch December 28, 2024 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant