Translate dynamic variable that is an array in twig or using t()
I think it's better to split the content in translatable parts:
  &lt;p&gt;{% trans %}The variables are{% endtrans %}
    {% for i in array %}
      {% trans %}{{ i.number }} times {{ i.name }}{% endtrans %},
    {% endfor %}
    , {% trans %}and {{ last.number }} number of {{ last.name }}{% endtrans %}
  .&lt;/p&gt;

Haven't tested this so I'm not sure if it works. Also, you could use trans as a filter, check this question.