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

Use context lang as primary default for service #638

Conversation

mahziyar-es
Copy link
Contributor

When using I18nService, if the context lang is not passed to the service options, it will always fallback to the fallback language, even though the context lang is accessible automatically in I18nService.

So in order to prevent passing the lang manually to the I18nService options, I used the I18nContext.current().lang which is the lang resolved by resolvers, as the primary default for the translate method inside I18nService.

If the context current lang does not exist, it will use the fallback lang as default.

@coveralls
Copy link

Coverage Status

coverage: 90.869% (+0.03%) from 90.844%
when pulling 169a7d9 on mahziyar-es:use-context-lang-as-primary-default-for-service
into ad3f68f on toonvanstrijp:main.

@rubiin rubiin merged commit e0f3398 into toonvanstrijp:main Jun 5, 2024
3 checks 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.

3 participants