We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi there,
First of all, thanks for your repository! Great trick to extract the translations from our twig files.
While we are updating our translation files, we encountered this error. Can you help with a fix?
Thanks, Petervw
PHP Fatal error: Uncaught Twig_Error_Syntax: Unexpected token "punctuation" of value "|" ("name" expected) .... in phar:///usr/local/bin/twig-gettext-extractor/vendor/twig/twig/lib/Twig/TokenStream.php:87
#0 phar:///usr/local/bin/twig-gettext-extractor/vendor/twig/twig/lib/Twig/ExpressionParser.php(449): Twig_TokenStream->expect(5) #1 phar:///usr/local/bin/twig-gettext-extractor/vendor/twig/twig/lib/Twig/ExpressionParser.php(443): Twig_ExpressionParser->parseFilterExpressionRaw(Object(Twig_Node_Expression_Constant)) #2 phar:///usr/local/bin/twig-gettext-extractor/vendor/twig/twig/lib/Twig/ExpressionParser.php(302): Twig_ExpressionParser->parseFilterExpression(Object(Twig_Node_Expression_Constant)) #3 phar:///usr/local/bin/twig-gettext-extractor/vendor/twig/twig/lib/Twig/ExpressionParser.php(194): Twig_ExpressionParser->parsePostfixExpression(Object(Twig_Node_Expression_Constant)) #4 phar:///usr/local/ in phar:///usr/local/bin/twig-gettext-extractor/vendor/twig/twig/lib/Twig/TokenStream.php on line 87
{% if form.api_key == '' || form.button_text == '' %} <div class="alert alert-info">
The text was updated successfully, but these errors were encountered:
Does it happens with:
{% if form.api_key == '' or form.button_text == '' %} <div class="alert alert-info">
❓
Sorry, something went wrong.
@umpirsky, yes your code example is a good workaround. Note that OR doesn't work.
OR
What do you think of a || implementation? Twig supports this syntax.
||
It is a bug, sure, that's why I keep it open, we should fix it. Just wanted to know if there is a workaround. Thanks for reporting!
No branches or pull requests
Hi there,
First of all, thanks for your repository! Great trick to extract the translations from our twig files.
While we are updating our translation files, we encountered this error. Can you help with a fix?
Thanks,
Petervw
PHP Fatal error: Uncaught Twig_Error_Syntax: Unexpected token "punctuation" of value "|" ("name" expected)
....
in phar:///usr/local/bin/twig-gettext-extractor/vendor/twig/twig/lib/Twig/TokenStream.php:87
Stack trace:
#0 phar:///usr/local/bin/twig-gettext-extractor/vendor/twig/twig/lib/Twig/ExpressionParser.php(449): Twig_TokenStream->expect(5)
#1 phar:///usr/local/bin/twig-gettext-extractor/vendor/twig/twig/lib/Twig/ExpressionParser.php(443): Twig_ExpressionParser->parseFilterExpressionRaw(Object(Twig_Node_Expression_Constant))
#2 phar:///usr/local/bin/twig-gettext-extractor/vendor/twig/twig/lib/Twig/ExpressionParser.php(302): Twig_ExpressionParser->parseFilterExpression(Object(Twig_Node_Expression_Constant))
#3 phar:///usr/local/bin/twig-gettext-extractor/vendor/twig/twig/lib/Twig/ExpressionParser.php(194): Twig_ExpressionParser->parsePostfixExpression(Object(Twig_Node_Expression_Constant))
#4 phar:///usr/local/ in phar:///usr/local/bin/twig-gettext-extractor/vendor/twig/twig/lib/Twig/TokenStream.php on line 87
Code example (the pipes are on line 4):
The text was updated successfully, but these errors were encountered: