Translating variables with context in Twig templates
In Drupal 8, you can translate a string in a Twig file with a specified context in two ways :

{{ "Text to translate"|t({}, {'context' : 'Context name'}) }}


and

{% trans with {'context': 'Context name'} %}
    Text to translate
{% endtrans %}