laravel-js-localization
laravel-js-localization copied to clipboard
Lang.get("") returns whole object of translations
When adding an empty string to Lang.get(), it returns the whole translation object for your locale.
Would expect it to just return an empty string?
E.g. Lang.get("") => { key1: "foo" ... } (object)
Expected: Lang.get("") => "" (string)
I know there is code that checks if the first argument to Lang.get() is the key name for one of the translation files and returns that object, but I am not sure if this is the intended behaviour.
Simple fix/PR would probably just be a if (key === '') { return '' }. Can provide if bug is confirmed.