Skip to content

Instantly share code, notes, and snippets.

@BenRichter
Created August 16, 2016 12:33
Show Gist options
  • Save BenRichter/51c35d8056a0a081bfb4fb91cd90bf01 to your computer and use it in GitHub Desktop.
Save BenRichter/51c35d8056a0a081bfb4fb91cd90bf01 to your computer and use it in GitHub Desktop.
Find replace old Twig translation tags with new
Find: \{% trans %\}([\w\.-]+)\{% endtrans %\}
Replace: {{ '$1'|trans }}
Find: \{% trans from \'(\w*)\' %\}([\w\.-]+)\{% endtrans %\}
Replace: {{ '$2'|trans({}, '$1') }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment