schmittjoh / JMSTranslationBundle

Puts the Symfony2 Translation Component on steroids
http://jmsyst.com/bundles/JMSTranslationBundle
427 stars 291 forks source link

Fallback to 'messages' domain when domain is null in trans|transchoice methods #566

Closed deguif closed 2 years ago

deguif commented 2 years ago
Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes/no
Fixed tickets
License Apache2

Description

Currently when calling trans or transchoice and passing a domain argument set to null, it emits a warnings during the extraction.

Can only extract the translation domain from a scalar string, but got "PhpParser\Node\Expr\ConstFetch". Please refactor your code to make it extractable, or add the doc comment /** @Ignore */ to this code element (in xxx.php on line xx).

With this PR, it will instead fallback to the default domain messages.

goetas commented 2 years ago

thank you!