337
Views
6
Comments
Solved
Get Locale Client-side
Question

Is there any way to get the information about the locale ("EN-en", "ES-es") on client-side?




2018-10-29 08-31-03
João Marques
 
MVP
Solution

If you want to get the language of the browser, you can also achieve that very easily with Javascript. See more on this post.

2021-06-02 20-50-04
Márcio Carvalho

Sorry, just to understand. You want to get the time of the client, is that?

Regards,

Márcio

UserImage.jpg
Pier Paolo Annis

Hi Marcio,

thanks for your answer

I need the location of the client, not the time.


2018-10-29 08-31-03
João Marques
 
MVP

Hi Pier,


Yes, there is the built-in function GetCurrentLocale(), like on the image below:




Kind Regards,
João

UserImage.jpg
Pier Paolo Annis

Hi João, 

thanks for your answer.

GetCurrentLocale() is running on the server so it's giving you the server's location, but I need the client's location.

2018-10-29 08-31-03
João Marques
 
MVP

Hi Pier,


You have this action both client and server side. Look for instance, this example, where I'm calling it on a client action:

2018-10-29 08-31-03
João Marques
 
MVP
Solution

If you want to get the language of the browser, you can also achieve that very easily with Javascript. See more on this post.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.