-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
Pluralization translations fail at ParsePlaceHolders due to array expectation with an int passed. #1090
Comments
I can't replicate this issue... I'll need more information about your env :
You're right the |
@lcharette
Server OS: Laravel Homestead (Ubuntu 18.04)
|
As discussed in chat, this issue is not present when no custom sprinkle are loaded. It's related to placeholder being used on a non array message. See https://chat.userfrosting.com/channel/support?msg=KG8JRYZTAPL8MjmYt |
Should be fixed with the release of i18n 4.4.1. It will default to |
Problem:
When using the default Userfrosting Twig translation function, passing an int as the second parameter to request a plural message results in a TypeError.
app/sprinkles/admin/templates/pages/dashboard.html.twig:77
{{ translate("USER", [2]) }}
Stack Trace:
Steps to Reproduce:
Userfrosting Version: 4.4
app/vendor/userfrosting/i18n/src/Translator.php:93
$message = $this->parsePlaceHolders($message, $placeholders);
in our case, $placeholders is an int, which is defined as allowed, but
parsePlaceHolders
expects an array as the parameter type.The text was updated successfully, but these errors were encountered: