-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Closed
Description
Laravel Version
11.30.0
PHP Version
8.3.13
Database Driver & Version
Not relevant
Description
Hello!
The recent change to the trans_choice function replacements (see PR #53331) broke replacements for the count placeholder.
When using the trans_choice function and trying to specify a replacement for :count, it is no longer applied. This worked fine before the PR mentioned above was merged.
Thanks for your consideration
Steps To Reproduce
To use the same example as the PR linked above, consider the following translation:
return [
'greeting' => '{0} Hello|[1,*] Hello, you have :count unread messages'
];If you try to specify a replacement for :count, it will not be used, and it will simply inject the count provided as the second parameter instead. The following code:
$count = 2;
trans_choice('general.greeting', $count, ['count' => '<strong>'.$count.'</strong>']);used to result in the following:
Hello, you have <strong>2</strong> unread messagesand now instead results in:
Hello, you have 2 unread messagesMetadata
Metadata
Assignees
Labels
No labels