You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which Transloco package(s) will this feature affect?
Transloco, MessageFormat
Is your feature request related to a problem? Please describe
No response
Describe the solution you'd like
I want to have the possibility to declare global variables, which can be used in select translations with MessageFormat.
For example, I want to have a translation like this: { "mySelectRule": "{myVar, select, val1 {Value 1} val2 {Value 2} other {Other Value}}" }
And use it without having to declare params in each use in the template: {{ 'mySelectRule' | transloco }}
I'd like to set this param in a service or component class for each translation as a global param, e.g.: this.translocoService.setGlobalParam('myVar', 'val2')
Currently, I have to pass this value each time, even though it is often the same value: {{ 'mySelectRule' | transloco : {myVar: 'val2'} }}
This can be very useful, e.g., with user gender, because a lot of content can depend on this value.
Describe alternatives you've considered
Alternatively, it would be nice to be able to create an interceptor that could modify parameters before translation(something like headers in http interceptor)
Additional context
No response
I would like to make a pull request for this feature
No
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Which Transloco package(s) will this feature affect?
Transloco, MessageFormat
Is your feature request related to a problem? Please describe
No response
Describe the solution you'd like
I want to have the possibility to declare global variables, which can be used in select translations with MessageFormat.
For example, I want to have a translation like this:
{ "mySelectRule": "{myVar, select, val1 {Value 1} val2 {Value 2} other {Other Value}}" }
And use it without having to declare params in each use in the template:
{{ 'mySelectRule' | transloco }}
I'd like to set this param in a service or component class for each translation as a global param, e.g.:
this.translocoService.setGlobalParam('myVar', 'val2')
Currently, I have to pass this value each time, even though it is often the same value:
{{ 'mySelectRule' | transloco : {myVar: 'val2'} }}
This can be very useful, e.g., with user gender, because a lot of content can depend on this value.
Describe alternatives you've considered
Additional context
No response
I would like to make a pull request for this feature
No
The text was updated successfully, but these errors were encountered: