core icon indicating copy to clipboard operation
core copied to clipboard

Configuration: defaultLanguage in TranslateModule.forRoot as a Provider

Open dbl81 opened this issue 3 months ago • 1 comments

Current behavior

One of the configuration parameter for the TranslateModule.forRoot is the defaultLanguage parameter. Now it is a string value.

Expected behavior

Transform the defaultLanguage parameter into a provider so we can assign to it a value using for example a Factory.

What is the motivation / use case for changing the behavior?

In my application the value of the defaultLanguage is the result of a algorithm implemented by a function. Now I set the defaultLanguage in the main app component logic, but I think it's not a good practice to have initialization parameters in two different places, the main app component logic and the TranslateModule.forRoot.

Thank you.

How do you think that we should implement this?

dbl81 avatar Mar 22 '24 16:03 dbl81