export function resolveLocaleForElement(element: HTMLElement): string {
  const fromDataset = (element.dataset.crtodayLocale || '').trim();
  if (fromDataset !== '') {
    return fromDataset;
  }

  const docLang = (document.documentElement.lang || '').trim();
  if (docLang !== '') {
    return docLang;
  }

  return navigator.language || 'en-US';
}
