Display which template files are processed and what the final command is - #53
Display which template files are processed and what the final command is#53drzraf wants to merge 2 commits into
Conversation
|
Happens that any STDERR output (assumed from xgettext) is interpreted as a failure by poedit. |
|
Thanks @drzraf. How are this debug printed? Are they visible in Poedit? |
|
Yes; AFAICT any output on stderr from the internal xgettext process is interpreted as an error, but poedit sources would need to be checked to know if it understand of some pattern for warning/notices/... |
|
ping? |
|
It's not dead, people use it. So it lives. |
| $twig = new Twig_Environment(new Twig\Gettext\Loader\Filesystem(DIRECTORY_SEPARATOR), [ | ||
| 'cache' => implode(DIRECTORY_SEPARATOR, [sys_get_temp_dir(), 'cache', uniqid()]), | ||
| 'auto_reload' => true, | ||
| 'debug' => getenv("DEBUG") |
There was a problem hiding this comment.
Let's use 'debug' => getenv('TWIG_GETTEXT_EXTRACTOR_DEBUG') here.
|
Sorry for the delay, I'd like to merge this after env var name change. I'd like to avoid collision with other env vars. Thanks! |
|
Addressed (but see #60...) |
|
Yes, this is obsolete in favor of #60. |
* This commit uses symfony-console for manage arguments specific to Twig-Gettext-Extractor which used to be broken. * The $input is also passed to the extractor for possible futur use (eg: handling --debug) * Better Twig loaded. Twig Environment use a ChainLoader which is initialized according to file/paths passed to the command line. * It's possible to add a template directory the Twig-way and compile for one (or multiple templates). * The list of Twig templates to compile can now be passed through stdin, using --files stdin * Twig_SimpleFilter is fixed. true is not an accepted value anymore. Empty value callback avoid the cryptic Twig error: `Function 1() does not exist` * A --require flag is added to add custom PHP code before compilation. * Using the above, a brigde with WordPress+Timber is added. It loads Timber Twig extensions and add a couple of WordPress specific parameters to xgettext. * integrate umpirsky#53 (debugging)
Useful debugging information when parsing stranges twig templates (like those containing unrecognized extensions)