With the `translate` modifier, it's possible to search for matching values and replace them.
With the `translate` modifier, it's possible to search for matching values and replace them.
translate
{{$text|translate:'<original value>,<new value>'}}
translate optin (Y/N)
{{customer|translate:'Y,Yes,N,No' field='optin'}}
Output:
translate gender
{{customer|htmlentities|translate:'MAN,Man,WOMAN,Female,FAMILY,Family,UNKNOWN,Uknown,NONBINARY,No gender' field='gender'}}
Outcome:
translate within a text
{{"Apple, cherry, banana"|translate:'banana,pepper'}}
Output:
"Appel, cherry, pepper"