I’ve created an Event Handler where I make use of the
User Local to decide what should happen. It’s working fine for authenticated users, but obviously not for not authenticated users.
Is there any way to get the user locale of the user’s device resp. the user’s browser?
Do you use ui-builder for your app?
You can use this block to get user locale
Thanks, but how do I get the Client Locale to the backend (resp. my Event Handler), when using the Load Table objects block …
Do you need to use the client locale in the database query?
Not exactly in the query itself, but I need to modify the result in the After Find Event Handler based on the User resp. Client Locale.
Got it. In this case, the approach I’d recommend would look like this:
- Create an API service that would be responsible for retrieving the data from the database (it can be done with codeless)
- One of the arguments for the API service would be the
client locale. When the service retrieves the data from the database, it performs the required filtering of the data based on the locale parameter.
- Invoke the API service from your UI Builder page.
Hope this helps.
I had exactly the same approach in my mind.
Great to hear that the head of the Backendless experience would approach it the same way. Thanks again.