-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
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
Fix translation of messages with dot at the end #181
Conversation
@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:
I found that it is partially fixed in extractMessageDomain:
The only problem is if $id (message) is empty because symfony translator returns empty string:
Maybe I just add condition to extractMessageDomain() that dot should not be last character? |
Co-authored-by: Jáchym Toušek <enumag@gmail.com>
* Fix translation of messages with dot at the end * Fixed mixed indentations * Fixed syntax error in test * Rerun travis * Fix Closure::fromCallable + coding standards * Dot cannot be at last position * Update src/Translator.php Co-authored-by: Jáchym Toušek <enumag@gmail.com> Co-authored-by: Jáchym Toušek <enumag@gmail.com>
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.