Simple, ease-to-use and flexible package for the Laravel web framework. Allows you to use localized messages of the Laravel webapp (see `resources/lang` directory) in your Javascript code.
These changes are using string functions like toUpperCase() without using toString() on the value first which results in passing numeric values as translation parameters to be broken.
For example, using the following code results in a TypeError: i.toUpperCase is not a function error:
Lang.get('general.number_of_rows', {number: 10})
I would suggest adding toString() before using any string functions to make the JS library backward compatible.
The
applyReplacements
function inresources/js/localization.js
has some minor changes in the following commit:https://github.com/andywer/laravel-js-localization/commit/2ca47feb8c341bbaae5280fdc8aa16e8232627b2#diff-a3095dfb9ac91acd2bb0a74831fa7c7d
These changes are using string functions like
toUpperCase()
without usingtoString()
on the value first which results in passing numeric values as translation parameters to be broken.For example, using the following code results in a
TypeError: i.toUpperCase is not a function
error:Lang.get('general.number_of_rows', {number: 10})
I would suggest adding
toString()
before using any string functions to make the JS library backward compatible.