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

trim whitespaces #10

Closed LiaraAlis closed 5 years ago

LiaraAlis commented 5 years ago

It would be better to trim whitespaces at the beginning and end of the string. Related to the laravel documentation, my string looks like this: '{1} 1 inaktives Meeting|[0,2,*] :cnt inaktive Meetings There is always a whitespace between the number and the text like in the official laravel documentation. This whitespace is removed if laravel provides the translated string. With this library the whitespace remains.

Laravel results in: "1 inaktives Meeting" This library results in: " 1 inaktives Meeting"

This could be a problem if I would add brackets or other content directly before or after the string.

iamgergo commented 5 years ago

@LiaraAlis Hey!

Yes, that's a good suggestion. Soon I'll ship a patch that fixes this.

Thanks!