Skip to content

Commit f96c3c9

Browse files
pan0xchonghuangdc
authored andcommitted
fix(projects): ensure HTML lang attribute is updated when setting locale
1 parent a37949f commit f96c3c9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/locales/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ export const $t = i18n.global.t as App.I18n.$T;
2323

2424
export function setLocale(locale: App.I18n.LangType) {
2525
i18n.global.locale.value = locale;
26+
27+
document?.querySelector('html')?.setAttribute('lang', locale);
2628
}
2729

2830
export function getLocale(): App.I18n.LangType {

0 commit comments

Comments
 (0)