syncDocumentLocale function

Module @runic-artifex/views in @runic-artifex/views 0.23.0

function syncDocumentLocale(options?: DocumentLocaleOptions): () => void;

Sets lang and dir of the page's root element to the language that text references are shown in (textLocale, textDirection), now and after every language switch, until the returned function is called. While the page has no text locale, the element keeps the attributes it has, such as <html lang="en">. Call it once in the browser, for example in main.ts after configureTranslatedText; without a document it does nothing.