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.
coverage: 90.869% (+0.03%) from 90.844%
when pulling 169a7d9c82a7d5d71a83222665bab1d5ebcfde0d on mahziyar-es:use-context-lang-as-primary-default-for-service
into ad3f68f47bfce23967b41727e4c679580d0ebb49 on toonvanstrijp:main.
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.