With the `translate` modifier, it's possible to search for matching values and replace them. 

translate

{{$text|translate:'<original value>,<new value>'}}

Examples

translate optin (Y/N)

{{customer|translate:'Y,Yes,N,No' field='optin'}}

Output:

  • Y: Yes
  • N: No

translate gender

{{customer|htmlentities|translate:'MAN,Man,WOMAN,Female,FAMILY,Family,UNKNOWN,Uknown,NONBINARY,No gender' field='gender'}}

Outcome:

  • MAN: Man
  • WOMAN: Female
  • FAMILY: Family
  • UNKNOWN: Unkown
  • NONBINARY: No gender

translate within a text

{{"Apple, cherry, banana"|translate:'banana,pepper'}}


Output:

"Appel, cherry, pepper"