Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f35996d

Browse files
committed
bug #24514 [TwigBridge] replace parameters in dummy identity translator (xabbuh)
This PR was merged into the 3.4 branch. Discussion ---------- [TwigBridge] replace parameters in dummy identity translator | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #24358 (comment) | License | MIT | Doc PR | Commits ------- 2c9c3d8 replace parameters in dummy identity translator
2 parents 0f5e38c + 2c9c3d8 commit f35996d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Bridge/Twig/Extension/TranslationExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function getTranslationNodeVisitor()
9595
public function trans($message, array $arguments = array(), $domain = null, $locale = null)
9696
{
9797
if (null === $this->translator) {
98-
return $message;
98+
return strtr($message, $arguments);
9999
}
100100

101101
return $this->translator->trans($message, $arguments, $domain, $locale);
@@ -104,7 +104,7 @@ public function trans($message, array $arguments = array(), $domain = null, $loc
104104
public function transchoice($message, $count, array $arguments = array(), $domain = null, $locale = null)
105105
{
106106
if (null === $this->translator) {
107-
return $message;
107+
return strtr($message, $arguments);
108108
}
109109

110110
return $this->translator->transChoice($message, $count, array_merge(array('%count%' => $count), $arguments), $domain, $locale);

0 commit comments

Comments
 (0)