Skip to content

Commit aa7350f

Browse files
Merge branch '5.3' into 5.4
* 5.3: Fix skip condition for INTL [Messenger] Fix `ErrorDetailsStamp` denormalization [Translation] Extract translatable content on twig set Simplify code Fix composer.json versions Fix composer.json versions Remove redundant license info [HttpFoundation] Fix isNotModified determination logic Fix Url Validator false positives [Translation] Reverse fallback locales [FrameworkBundle] Fall back to default configuration in debug:config and consistently resolve parameter values notifier smsapi - fixed checking whether message is sent allow null for framework.translator.default_path improve failure messages of the CrawlerSelectorTextContains constraint
2 parents 114c81c + 503e12a commit aa7350f

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

NodeVisitor/TranslationNodeVisitor.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,10 @@ protected function doEnterNode(Node $node, Environment $env): Node
6969
$this->getReadDomainFromArguments($node->getNode('arguments'), 1),
7070
];
7171
} elseif (
72-
$node instanceof FilterExpression &&
73-
'trans' === $node->getNode('filter')->getAttribute('value') &&
74-
$node->getNode('node') instanceof FunctionExpression &&
75-
't' === $node->getNode('node')->getAttribute('name')
72+
$node instanceof FunctionExpression &&
73+
't' === $node->getAttribute('name')
7674
) {
77-
$nodeArguments = $node->getNode('node')->getNode('arguments');
75+
$nodeArguments = $node->getNode('arguments');
7876

7977
if ($nodeArguments->getIterator()->current() instanceof ConstantExpression) {
8078
$this->messages[] = [

Tests/Translation/TwigExtractorTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public function getExtractData()
6666
['{% set foo = "new key" | trans %}', ['new key' => 'messages']],
6767
['{{ 1 ? "new key" | trans : "another key" | trans }}', ['new key' => 'messages', 'another key' => 'messages']],
6868
['{{ t("new key") | trans() }}', ['new key' => 'messages']],
69+
['{% set foo = t("new key") %}', ['new key' => 'messages']],
6970
['{{ t("new key", {}, "domain") | trans() }}', ['new key' => 'domain']],
7071
['{{ 1 ? t("new key") | trans : t("another key") | trans }}', ['new key' => 'messages', 'another key' => 'messages']],
7172

0 commit comments

Comments
 (0)