Did you check this:
'apples' => '{0} There are none|[1,19] There are some|[20,Inf] There are many',
from the documentation? (http://laravel.com/docs/localization)
I have but I was trying to use the first example they have in the documentation:
'apples' => 'There is one apple|There are many apples',
echo Lang::choice('apples', 10);
I have pretty much exactly the same thing as the first example in the documentation:
'customer' => 'customer|customers';
$num_customers = count($customer_array);
echo Lang::choice('customer', $num_customers);
And it works fine as long as $num_customers < 20. As soon as it becomes larger, that's when the error shows up without changing anything other than that $num_customers.
I'm trying to keep it simpler than using :
'customer' => '[0,1] customer|[2,Inf] customers',
Never mind. I have figured it out. I was trying to translate it into Ro and apparently there's different pluralization rules for 'ro' for numbers such as 101, 102, ... 119, 201, 202... 219... etc... and that's what was causing the issue.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community