Open lunatigs opened 1 year ago
Please add more details like what values in this newLang
and why calling the two methods setLocale
setLanguageCode
one is enough
newLang always contains a 2 character, lowercase string, like de, en, fr, ...
i call both methods, cause they seem to do different things and i wanted to make sure the language is set properly (if only one is needed, why are there two methods anyway?)
Answering all this doesn't clear up, why those methods fail silently in the case of an error, instead of throwing an exception you can react to.
My app is using localize_and_translate: ^5.1.1 and has a dropdown that lets you change the language of the app, by doing
That's actually a basic example, of course i check if newLang is null or not. Just kept it small so you get the idea.
Problem now is, this works about 99% fine and the language does change right away, but sometimes the language just isn't loaded. I get no exception, try-catch shows nothing, the language just isn't loaded sometimes and then 'whatever'.tr() will show "whatever" instead of the translation it should show.
I would expect at least an exception so i have a chance to react, but right now users just end up with an untranslated app sometimes, which of course does create problems.