Calling for a Volt/Swig template parser for xgettext strings

I need a template parser for yanking out gettext strings from both Volt and Swig templates.

In my Phalcon based Webird system I'm using Volt for server templates and Handlebars for front templates. The reason that I'm using Handlebars templates is that it is very difficult to find an xgettext template parser that is capable of pulling out strings in plural form and the Handlebars ecosystem is more mature in this way.

So I think that it would be amazing to be able to write templates in the same syntax for both the server and front end and Swig is much more modern than Handlebars in regards to its packaging.

Here is a good starting point if someone would like to do it with nodejs;

The generalized wrapper: xgettext-template

The Handlebars implementation: xgettext-handlebars

So you can see that it is very little code in the Handlebars wrapper since the heavy liftiing is being done by the parser. I'd do it myself but its not my forte.

Well my head is pretty full with this project and I can't write all of the tools myself. My idea about this is to combine the superior Nodejs (with webpack) front end environment with the superior Phalcon back end environment. The localization strings are already well shared between the browser and server and the idea is that you can create tech with PHP and JS and have it integrate well. Perhaps you would want to use Volt views for a more Admin type interface to save R&D time and your app uses some fancy JS tech that takes 20x longer to develop. So then the templates would be the same and I'm trying to standardize constants and helpers in as much as possible so that they are mostly compatible between both environments.

Additionally, one kind of current bummer is that the Volt templates must be compiled into PHP before the strings can be extracted with xgettext. Its not terrible, but could be better.

So that is my plan and if you are capable of writing a Swig/Volt xgettext implementation in less time than it takes to read my long (mostly irrelevant) words then please get on top of that.



46.9k
edited Nov '14

The github issue: NFR - Swig template parser



46.9k

Progress is being made as a collaboration between two xgettext projects: project overlap / parser separation.