Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gutenboarding: Set lang/dir in browser #39491

Closed
sirreal opened this issue Feb 17, 2020 · 2 comments
Closed

Gutenboarding: Set lang/dir in browser #39491

sirreal opened this issue Feb 17, 2020 · 2 comments
Labels
[Goal] New Onboarding previously called Gutenboarding i18n [Type] Task

Comments

@sirreal
Copy link
Member

sirreal commented Feb 17, 2020

Part of #37665
Follow-up to #39410

lang and dir should be correctly set in Gutenboarding. See:

function setLocaleInDOM() {
const htmlLangAttribute = getHtmlLangAttribute();
const isRTL = i18n.isRtl();
document.documentElement.lang = htmlLangAttribute;
document.documentElement.dir = isRTL ? 'rtl' : 'ltr';
document.body.classList[ isRTL ? 'add' : 'remove' ]( 'rtl' );
switchWebpackCSS( isRTL );
}

@ramonjd
Copy link
Member

ramonjd commented Oct 19, 2020

@sirreal
Copy link
Member Author

sirreal commented Oct 19, 2020

Closing, this does seem to be resolved. I tested with routes like /new/es and /new/he as well as switching via the language picker.

@sirreal sirreal closed this as completed Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Goal] New Onboarding previously called Gutenboarding i18n [Type] Task
Projects
None yet
Development

No branches or pull requests

3 participants