Skip to content

Display which template files are processed and what the final command is - #53

Open
drzraf wants to merge 2 commits into
umpirsky:masterfrom
drzraf:debug
Open

Display which template files are processed and what the final command is#53
drzraf wants to merge 2 commits into
umpirsky:masterfrom
drzraf:debug

Conversation

@drzraf

@drzraf drzraf commented Dec 9, 2016

Copy link
Copy Markdown

Useful debugging information when parsing stranges twig templates (like those containing unrecognized extensions)

@drzraf

drzraf commented Dec 9, 2016

Copy link
Copy Markdown
Author

Happens that any STDERR output (assumed from xgettext) is interpreted as a failure by poedit.
Dunno if poedit accept distinct "warning/notice" levels from xgettext.
Prefixing lines by "xgettext: notice: " did not do the trick.
Dunno

@umpirsky

Copy link
Copy Markdown
Owner

Thanks @drzraf.

How are this debug printed? Are they visible in Poedit?

@drzraf

drzraf commented Dec 11, 2016

Copy link
Copy Markdown
Author

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/...

@drzraf

drzraf commented Jul 20, 2018

Copy link
Copy Markdown
Author

ping?
Is the project really dead?

@umpirsky

Copy link
Copy Markdown
Owner

It's not dead, people use it. So it lives.

Comment thread twig-gettext-extractor Outdated
$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")

Copy link
Copy Markdown
Owner

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.

@umpirsky

Copy link
Copy Markdown
Owner

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!

@drzraf

drzraf commented Jul 20, 2018

Copy link
Copy Markdown
Author

Addressed (but see #60...)

@umpirsky

Copy link
Copy Markdown
Owner

Yes, this is obsolete in favor of #60.

drzraf pushed a commit to drzraf/Twig-Gettext-Extractor that referenced this pull request Jul 20, 2018
drzraf pushed a commit to drzraf/Twig-Gettext-Extractor that referenced this pull request Jul 20, 2018
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants