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

i18n: Make captions autodetect text direction #2540

Merged
merged 1 commit into from
Nov 17, 2022

Conversation

ebraminio
Copy link
Contributor

@ebraminio ebraminio commented Oct 8, 2022

This uses browser mechanism for detecting appropiate direction for text, dir=auto.

Link to related issue (if applicable)

Fixes #2043

Summary of proposed changes

This uses dir="auto" so subtitles written in RTL scripts (Persian, Arabic, Hebrew and etc) can be displayed better when used in plyr.

Steps to reproduce:

Have a RTL text subtitle with full sentence, having "اینگونه درست است." in a subtitle file.

Actual:

Before this change, see the dot that should've been in left most place in the subtitle sentence,

image

Expected:

After this change, note the dot in the subtitle that now is moved to the correct place,

image

Generally use of dir=auto in such scenarios is very common, for example see this very GitHub page source and find dir=auto that is used all over the user content to enhance the display of user text that can be in different language even in GitHub. I added the thing in Gitlab also here years ago before GitHub's adoption with the improvement and now as plyr was used by someone that needed this fix am applying the approach here also.

image

This uses browser mechanism for detecting appropiate direction for text, dir=auto.
Copy link
Owner

@sampotts sampotts left a comment

Choose a reason for hiding this comment

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

Awesome. Thank you!

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.

Wrong text direction for right-to-left captions
2 participants