feat(client/rtl): set lang to body as well

This commit is contained in:
Elian Doran 2025-10-08 18:04:57 +03:00
parent 1e78dd8296
commit 42b1dcebcd
No known key found for this signature in database

View File

@ -33,7 +33,7 @@ export default class RootContainer extends FlexContainer<BasicWidget> {
this.#setMotion(options.is("motionEnabled"));
this.#setShadows(options.is("shadowsEnabled"));
this.#setBackdropEffects(options.is("backdropEffectsEnabled"));
this.#setRightToLeft(options.get("locale"));
this.#setLocaleAndDirection(options.get("locale"));
return super.render();
}
@ -71,8 +71,9 @@ export default class RootContainer extends FlexContainer<BasicWidget> {
document.body.classList.toggle("backdrop-effects-disabled", !enabled);
}
#setRightToLeft(locale: string) {
#setLocaleAndDirection(locale: string) {
const correspondingLocale = LOCALES.find(l => l.id === locale);
document.body.lang = locale;
document.body.dir = correspondingLocale?.rtl ? "rtl" : "ltr";
}
}