My Windows11 language is english but my regional settings is set to danish.
When I run the below code ‘en-GB’ is returned. I expected ‘da-DK’ to be returned.
function getUserLocale() {
const intl = window.Intl;
if (intl !== undefined) {
return intl.NumberFormat().resolvedOptions().locale;
}
// Old standard.
return navigator.language ?? "en-US";
}