You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use trans_choice and use straight line symbol (|) in the parameters, it causes the sentence structure to be messed up. It seems that Laravel first places the parameters in the sentences and then selects the sentence based on the number parameter in trans_choice. While the correct way is to first select the correct sentence in terms of number, then replace the parameters.
Steps To Reproduce
home.php file:
return [
'greeting' => '{0} Hello :name|[1,*] Hello :name, you have :count unread messages'
];
As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.
If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.
Laravel Version
11.29
PHP Version
8.1
Database Driver & Version
No response
Description
When I use
trans_choice
and use straight line symbol (|) in the parameters, it causes the sentence structure to be messed up. It seems that Laravel first places the parameters in the sentences and then selects the sentence based on the number parameter intrans_choice
. While the correct way is to first select the correct sentence in terms of number, then replace the parameters.Steps To Reproduce
home.php
file:Usage:
Above code must result in
Hello Alex | Moi
, But it results toHello Alex
.The text was updated successfully, but these errors were encountered: