i18n: Make captions autodetect text direction #2540
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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,
Expected:
After this change, note the dot in the subtitle that now is moved to the correct place,
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.