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

Translation string with more than two options #11

Closed LiaraAlis closed 5 years ago

LiaraAlis commented 5 years ago

Hi,

I have this string: {1} 1 Meeting|[0,2,*] :cnt Meetings This doesn't work with this library for the option 0, 2, * (1 works) but perfect with laravel.

My workaround is to use this: {1} 1 Meeting|:cnt Meetings

But I think it would be great if the library does the same as laravel itself.

Otherwise big thanks for this great package. :)

Best regards, Alexander

iamgergo commented 5 years ago

@LiaraAlis Hi,

Thanks! Unfortunately, this translation string is invalid. But sure, it works with Laravel! Please note, based on the documentation, your translation should look like this:

{0} 0 Meetings|{1} 1 Meeting|[2,*] :cnt Meetings

But I will fix this in the JS as well! So it should not cause any problem! Thanks!

iamgergo commented 5 years ago

@LiaraAlis So, I fixed the problem.

This is a nice fallback, so I'm very thankful for the suggestion. I release a small tag, so you may update the package and reimport script.

Let me know if it's bugged or something else! Thanks a lot!

LiaraAlis commented 5 years ago

Thank you for the fix. It's working. :)