-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display which template files are processed and what the final command is #53
base: master
Are you sure you want to change the base?
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-gettext-extractor
Outdated
@@ -25,6 +25,7 @@ if (file_exists($a = __DIR__ . '/../../autoload.php')) { | |||
$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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)