conedevelopment / i18n

Push your Laravel translations to the front-end and use them easily with JavaScript.
https://pineco.de/using-laravels-localization-js/
MIT License
129 stars 21 forks source link

Fix plural form selection #36

Closed marijnvdwerf closed 2 years ago

marijnvdwerf commented 2 years ago

(Haven't tested this code. Just wrote it in the GH editor)

marijnvdwerf commented 2 years ago

It passes all testcases in https://jsbin.com/wufuritoxe/2/edit?js,console,output now. But there's still some things I'm not too happy about. The condition stripping doesn't match the Laravel behavior, in that a source of first [IMPORTANT!] would result in first in JS, and first [IMPORTANT!] in PHP