rmariuzzo/Laravel-JS-Localization

Lang.choice not working correctly

zgabievi opened this issue · 4 comments

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"

I have reproduced this issue successfully with the info you provided @zgabievi. I'm working on a fix to be hot released.

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.

Nice work! 👌 Thanks