Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Culture and UICulture by JQuery

I am wondring if it is possible to get Culture and UICulture of the client form Javascript.

Thanks

like image 807
user217648 Avatar asked Jan 26 '26 16:01

user217648


1 Answers

There is No Way to do That directly by using Jquery, however if you are using .NET framework you can set Culture and UICulture in public properties and read them from Jquery.

in your CS file:

public string GetCurrentCulture
        {
            get
            {
                return System.Threading.Thread.CurrentThread.CurrentCulture.DisplayName;
            }
        }

And from HTML:

var CurrentCulture = '';
$(document).ready(function () {
    CurrentCulture = '<%= this.GetCurrentCulture %>';
});
like image 110
Yasser El-Ekhnawy Avatar answered Jan 29 '26 06:01

Yasser El-Ekhnawy