There are times you may need to use a different language in a specific part of the template, or in a particular component or module. This can be achieved in a similar way to the previous example, except here set the
TRANSLOCO_LANG provider either in lazy module providers list, the component providers or in the template.
Here's an example of setting it in a component's providers:
Using Angular's DI rules, this will ensure that the language in this component's template and all of its children's templates is
Alternatively, here is how to use it directly in the template:
Note that it will be used as the initial language. If you need it to be static, you can use the
Or in the template: