Answers for "twig trans"

0

twig trans

# Definte default translation domain for twig file
{% trans_default_domain 'app' %}

# Translate string
{% trans %}Hello User{% endtrans %}

# Translate string with variables
{% trans with {'%name%': 'Fabien'} from 'app' %}Hello %name%{% endtrans %}

# Translate string using alternate domain and no variables
{{ translated.string.here |trans({}, 'alternate') }}
Posted by: Guest on May-19-2020

Browse Popular Code Answers by Language