Implementing Language Selection in an Existing Chat System: Seeking Advice #579
Unanswered
Taurinz359
asked this question in
Q&A
Replies: 1 comment 3 replies
-
hi @Taurinz359 , could you elaborate this?
I think this could be a way to handle your needs, can't get the limitation introduced by the try catch block if you are overriding the handle method, simply handle the missing language with your code and don't call the parent::handle() method after sending your language request response |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone,
I'm facing a challenge with expanding the functionality of our chat system by adding a language field. Currently, I have a legacy project where users are already registered and active. My task is to ensure that the entry point of the chat system checks whether the user has set a language preference. If not, it should prompt them with a keyboard to select their preferred language and not proceed further until a language is chosen.
I've attempted to override the inherited handle method, but due to its encapsulation within a try-catch block, the pipeline continues execution instead of halting. Additionally, I've considered using middleware, but this approach results in duplicate database queries when creating a new user, which is not desirable.
Could anyone provide guidance on how to approach this situation effectively? Your insights and suggestions would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions