Make text direction RTL for languages like Arabic and Persian // add dir='auto' to all html body elements? #12
Replies: 6 comments
-
wonderful! welcome @itsmohmans & thank you
|
Beta Was this translation helpful? Give feedback.
-
I see the same problem on Reddit, Discord, and Notion. I came across this article which suggests settings the HTML attribute
So this is another option besides using the CSS property |
Beta Was this translation helpful? Give feedback.
-
(just clicked fork and wrote a (future) description https://github.com/code-for-charity/dir-auto-everywhere ) |
Beta Was this translation helpful? Give feedback.
-
That's great! Will it have a dedicated script for each site of the ones mentioned (YouTube, LinkedIn, Discord, GitHub, Notion.so), or will it be for more general use? |
Beta Was this translation helpful? Give feedback.
-
you could add some CSS to youtube with improvedTube at the ⋮ settings. but you can also add CSS to every website with our dark-mode extension (then you could walk your way down the top1million website http://s3-us-west-1.amazonaws.com/umbrella-static/top-1m.csv.zip) ( Maybe Bidi Algo will matter: i.e. While existing solution target specific parts of sites only, which might avoid unwanted effects. Yet those internal names can change sometimes for notion.so: https://github.com/obahareth/notion-rtl/blob/541aa4cd68b5d732f79232e1a842125dd8886c49/src/index.js#L11-L45 MIT code (free)
© from https://chrome.google.com/webstore/detail/hangouts-rtl-fixer/oohpklfcenaffjconedjebkaclkachmi
© from https://chrome.google.com/webstore/detail/rtl-fixer/mkeclhaiiffmeeokkomoameekkpiiecf |
Beta Was this translation helpful? Give feedback.
-
Regarding the first solution
The CSS property I think using the HTML attribute |
Beta Was this translation helpful? Give feedback.
-
⚬ PROBLEM:
In RTL-written languages like Arabic, the text content (video titles, comments, and video descriptions) has the default text direction set to LTR when YouTube's language is English or any other LTR language. This causes the Arabic text to be unreadable in most cases, especially when it's mixed with Latin characters.
⚬ SOLUTION:
The solution to this would be by setting the CSS style
direction: rtl
to the text elements mentioned above if they start with a character from an RTL-written language.⚬ ALTERNATIVES:
⚬ RELEVANCE / SCOPE:
This feature is beneficial to all YT users whose main language's script is RTL (A full list here).
⚬ "SIDE EFFECTS":
⚬ CONTEXT:
//
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions