Closed lulco closed 3 years ago
@enumag any chance this could be merge to near release?
I'm reluctant to fix this. Because then one might expect that any message will work but from what I gather a message with a dot in the middle will split into domain and message anyway, right? Unless this worked before and was broken later then I'd leave it as is I think.
Everything you mentioned works:
Hello.World
works also Hello world.
I found that it is partially fixed in extractMessageDomain:
if (strpos($message, '.') !== FALSE && strpos($message, ' ') === FALSE) {
The only problem is if $id (message) is empty because symfony translator returns empty string:
if ('' === $id = (string) $id) {
return '';
}
Maybe I just add condition to extractMessageDomain() that dot should not be last character?
If you have some strings like:
Hello. Hello world.
(with dot at the end), whole message is marked as domain, and id is empty, which leads to translation these messages as empty strings.