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

Fix how dates are displayed in RTL languages #13461

Merged
merged 3 commits into from Aug 27, 2023

Conversation

shermansiu
Copy link
Contributor

Fixes #11569.

Before:
LiChess RTL i18n Before

After:
LiChess RTL i18n After

@shermansiu shermansiu changed the title Fix rtl dates Fix how dates are displayed in RTL languages Aug 25, 2023
Copy link
Collaborator

@ornicar ornicar left a comment

Choose a reason for hiding this comment

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

can it not be done using CSS, like all our current support for RTL?

app/templating/DateHelper.scala Outdated Show resolved Hide resolved
@shermansiu
Copy link
Contributor Author

can it not be done using CSS, like all our current support for RTL?

Using CSS was the first thing I tried (e.g. direction: rtl), but unfortunately, that didn't work, whether the style was added to the time tag itself or the parent span tag.

Ultimately, the problem is that the generated text mixes LTR (i.e. the Western Arabic numerals) and RTL characters.

@shermansiu
Copy link
Contributor Author

shermansiu commented Aug 26, 2023

I've made the requested changes!

@ornicar ornicar merged commit f5122e8 into lichess-org:master Aug 27, 2023
3 checks passed
@shermansiu shermansiu deleted the fix-rtl-dates branch August 27, 2023 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Date formatting directionality
2 participants