umpirsky / Twig-Gettext-Extractor

The Twig Gettext Extractor is Poedit friendly tool which extracts translations from twig templates.
MIT License
113 stars 32 forks source link

Conflict with debug functions #14

Closed kbtz closed 10 years ago

kbtz commented 10 years ago

Uses of debug functions like {{ dump foo }} breaks the extractor. @umpirsky May I can patch it to ignore these functions if you can point me where exactly it's handled.

Cheers.

umpirsky commented 10 years ago

@cvsguimaraes Can you please describe how it breaks? Give exception trace for example.

kbtz commented 10 years ago

Generated when updating the catalog with Poedit: http://pastebin.com/ZiMQZLKu

umpirsky commented 10 years ago

Please take a look at https://github.com/umpirsky/Twig-Gettext-Extractor/issues/7 it's similar. You should register Twig_Extension_Debug in https://github.com/umpirsky/Twig-Gettext-Extractor/blob/master/twig-gettext-extractor#L41

kbtz commented 10 years ago

It's conflicting with custom functions as well: http://pastebin.com/J4u1hAn7

Let's try to implement an definitive solution for this? The easiest approach IMHO, is to add an option to register somewhere these functions/filters names.

Are you too busy these days?!

kbtz commented 10 years ago

Damn button...

umpirsky commented 10 years ago

What is wrong with registering them in https://github.com/umpirsky/Twig-Gettext-Extractor/blob/master/twig-gettext-extractor#L41?

You can copy this script to your project /bin dir and customize it by registering your extensions.

kbtz commented 10 years ago

mmmmm

Nothing wrong at all. Now I understand, meh, sorry; I think this deserves a section in the README...

Anyway, thanks a lot buddy!

umpirsky commented 10 years ago

:+1: