We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 107eb36 commit e1a5314Copy full SHA for e1a5314
src/index.ts
@@ -88,7 +88,8 @@ export function getActiveLanguage(): string {
88
*/
89
function setLanguage({ lang, messages }: LanguageInterface): string {
90
if (! isServer) {
91
- document.querySelector('html').setAttribute('lang', lang)
+ // When setting the HTML lang attribute, hyphen must be use instead of underscore.
92
+ document.documentElement.setAttribute("lang", lang.replace('_', '-'));
93
}
94
95
options.lang = lang;
0 commit comments