1

I'm using the TranslationServiceProvider from Silex (micro framework build based on symfony2 components). I now translate stuff in my view like this:

<h1>{{ 'psttoday'|trans }}</h1>

The psttoday is a tag that I use. The translations are stored in yml files. Is there a way that I can just set {{ 'psttodo'|trans }} and then run a script and write the tags to my database or some other file?

nielsv
  • 6,540
  • 35
  • 111
  • 215

1 Answers1

1

Do you want to extract all strings that have the |trans filter attached?

Have a look at that answer:
How to generate translation file (.po, .xliff, .yml,...) from a Symfony2/Silex project?

They propose:

Also this Bundle has a extractor task:

Community
  • 1
  • 1
ivoba
  • 5,780
  • 5
  • 48
  • 55