Skip to content

Commit a7f0d66

Browse files
committed
✨ (i18n) patch page lang attribute since it's static (still not perfect, see suitenumerique/ui-kit#177)
1 parent 3129606 commit a7f0d66

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

client/src/i18n.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ i18n.dateFns = {
3232
};
3333

3434
i18n.on('languageChanged', () => {
35+
// will update `lang` attribute on `<html>` since `index.html` is a static public file
36+
document.documentElement.lang = new Intl.Locale(i18n.resolvedLanguage).language;
37+
3538
setDefaultLocale(i18n.resolvedLanguage);
3639
});
3740

0 commit comments

Comments
 (0)