Laravel-JS-Localization icon indicating copy to clipboard operation
Laravel-JS-Localization copied to clipboard

functions should return constant itself when it not defined

Open 1dnmr opened this issue 7 years ago • 2 comments

Hello,

This is really critical issue, If you forget define a constant (or made typo) all js code on the page can't stop working because of error "not found". Functions Lang.get(), Lang.choise() etc should check whether constant is defined and return it if not. Not Error! This is like Laravel trans() and trans_choice() functions works.

Please fix asap.

Thank you

1dnmr avatar May 11 '18 05:05 1dnmr

Hey @1dnmr! Can you add a snippet so I can reproduce. I believe that any key not found, will just restun the same key, instead of throwing an error.

rmariuzzo avatar May 11 '18 14:05 rmariuzzo

Hi @rmariuzzo ! I think I understand this issue wrong. Js error occurs if I make typo in constants name( Unfortunately it leads to stop execution of other js.

1dnmr avatar May 29 '18 14:05 1dnmr