Lang.choice not working correctly
zgabievi opened this issue · 4 comments
zgabievi commented
en/site.php
'views_count' => '{0} No Views|{1} :count View|[2,Inf] :count Views'
JS Console
Lang.choice('site.views_count', 0, {'count': 0})
Output: "0 View"
Lang.choice('site.views_count', 1, {'count': 1})
Output: "No Views"
Lang.choice('site.views_count', 2, {'count': 2})
Output: "2 View"
rmariuzzo commented
I have reproduced this issue successfully with the info you provided @zgabievi. I'm working on a fix to be hot released.
rmariuzzo commented
I have released a hot fix on https://github.com/rmariuzzo/Lang.js repository: https://github.com/rmariuzzo/Lang.js/releases/tag/v1.1.4
I will update this one shortly.
rmariuzzo commented
Released: https://github.com/rmariuzzo/Laravel-JS-Localization/releases/tag/v1.3.3
Happy coding @zgabievi !
zgabievi commented
Nice work! 👌 Thanks