Skip to content

Conversation

@edewit
Copy link
Contributor

@edewit edewit commented Jul 1, 2024

part of: #29974

Signed-off-by: Erik Jan de Wit [email protected]

part of: keycloak#29974

Signed-off-by: Erik Jan de Wit <[email protected]>
@edewit edewit requested a review from a team as a code owner July 1, 2024 10:30
@edewit edewit self-assigned this Jul 1, 2024
}
});
if (RTL_LOCALES.includes(this.#me.locale)) {
document.getElementsByTagName("html")[0].setAttribute("dir", "rtl");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the preferred locale is already known when index.ftl is rendered, so you could also handle this at the template level.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not true atm, we could introduce it in the template though, but why would that be better?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you are right, we only have this for the account console, but not the admin console. The benefit would be that it would be present on initial render, so the browser knows everything about the locale right away.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, but it's almost instant as this will get triggered once the user is logged in

Copy link
Contributor

@jonkoops jonkoops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, let's work on handling this consistently in all themes as a follow up.

@edewit edewit merged commit b215e64 into keycloak:main Jul 23, 2024
stianst pushed a commit to stianst/keycloak that referenced this pull request Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants