import { getLanguageDefinition, type AppLanguage } from "./registry";

export function syncDocumentLanguage(lang: AppLanguage) {
  if (typeof document === "undefined") return;
  const def = getLanguageDefinition(lang);
  document.documentElement.lang = def.htmlLang;
  document.documentElement.dir = def.direction;
  document.documentElement.dataset.locale = lang;
}
