I need to get culture string from browser's language.
I thought about getting it from javascript like this:
var userLang = navigator.language || navigator.userLanguage;
but it gives me only first part of culture info that i would get from .NET:
Thread.CurrentThread.CurrentCulture.Name;
So javascript gives me "de" or "pl" instead of "de-DE" or "pl-PL" like in .NET. Is there a way to get the "full info" ?
try this
<script>
var cultureInfo = '@System.Globalization.CultureInfo.CurrentCulture.Name';
</script>