Question

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?

Was it helpful?

Solution

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:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top