timeago.dart icon indicating copy to clipboard operation
timeago.dart copied to clipboard

dynamically change language

Open thorizer opened this issue 3 years ago • 3 comments

I have an app that supports multiple languages , the user can change language anytime. can timeago retranslate date strings after resetting a new locale ?

thorizer avatar Sep 29 '22 16:09 thorizer

@thorizer I have a similar need for the app I'm working on. A bit of googling landed me on this issue.

Were you able to use this package in the manner you required at the time? Did you go for another package instead? Rolled out your own implementation?

It would be great if you could shed some light on your experience with this package

jagged3dge avatar Feb 16 '23 18:02 jagged3dge

@jagged3dge you can initialize multiple locals or custom one with a name, and then switch local with a state management like bloc depending on the language selected. you can also keep the state of the language selected with bloc

thorizer avatar Feb 16 '23 21:02 thorizer

Thank you for responding. This does indeed clarify my doubt. I appreciate the time you've taken to respond.

Happy Fluttering!

jagged3dge avatar Feb 16 '23 22:02 jagged3dge