mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2026-03-02 22:57:11 -05:00
Add BiDi support #1798
Labels
No labels
Component: Accessibility
Component: Administration
Component: Auth
Component: CLI
Component: Channels
Component: Chapters
Component: Comments
Component: Custom Markdown
Component: Docker 🐳
Component: Documentation 📚
Component: Email
Component: Embed
Component: Federation 🎡
Component: Import/Export
Component: Live
Component: Metadata
Component: Mobile
Component: Moderation :godmode:
Component: Notifications
Component: Object storage
Component: Observability
Component: PeerTube Plugin 📦
Component: Player ⏯️
Component: Playlist
Component: Recommendation
Component: Redundancy
Component: Registration
Component: Runners
Component: SEO
Component: Search
Component: Security
Component: Stats
Component: Studio
Component: Studio
Component: Subscriptions
Component: Subtitles 💬
Component: Transcoding
Component: Upload
Component: Video Import
Component: i18n 🔡
Priority: High
Priority: Low
Priority: Roadmap
Status: Blocked ✋
Status: In Progress 🔜
Status: To Reproduce
Status: Waiting for answer
Template not filled
Type: Bug 🐛
Type: Discussion 💭
Type: Discussion 💭
Type: Duplicate ➿
Type: Feature Request ✨
Type: Maintenance 👷♀️
Type: Performance
Type: Question
UI
good first issue
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/PeerTube#1798
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ahangarha on GitHub (Sep 6, 2019).
What happened?
Peertube is LTR friendly. So if you post something in RTL scripts, it behaves wrongly
What do you expect to happen instead?
SImple: it should be both LTR and RTL friendly.
Steps to reproduce:
Just post something in Persian/Arabic/Urdu etc. Especially it is horrible if it be a mixed LTR and RTL in the text. you may check this post to see an example
Additional information
My suggestion is to add bidi support to the UI. This way, regardless of the default text direction, texts will find the right direction based on the first character of the line/paragraph.
I myself have experience of adding bidi support. So you may assign this to me.
@Chocobozzz commented on GitHub (Nov 29, 2019):
I'm sorry I don't know RTL languages, so I'm not sure what I have to do here. Do you have some hints or resources on how we could add RTL support in PeerTube? Or maybe you have already started such work?
@ahangarha commented on GitHub (Nov 30, 2019):
The simplest way is to add
dir="auto"attribute to all the elements may contain texts which might be in different languages. I haven't checked the source code, otherwise I myself would suggest to give the task to me.If needed, I can check for it
@ahangarha commented on GitHub (May 16, 2020):
I have made a very simple Firefox extension called Add Bidi Support which does what I proposed here.
I share some screenshot of how effectively it solves the problem:
@ahangarha commented on GitHub (May 20, 2021):
Any update in this regard?
@Chocobozzz commented on GitHub (May 25, 2021):
Hello,
Not yet but I want to work on it this year, adding the
dirattribute to thebodytag, and using custom SASS functions to set the appropriatemargin-right/margin-leftto elements depending on the direction (similar to what bootstrap 5 does). Since it's the first time I'll work on this kind of subject, it will take some time :)@ahangarha commented on GitHub (May 26, 2021):
Adding
dirtobodywont solve the issue. Regardless of the overall direction of the page (which should be dependent on UI language), there are mixed content on Fediverse. So it should be handled on each entry level.Moreover I would suggest to use
margin-inlineandpadding-inlinewithstart|endinstead ofleft|rightto address bidirectional functionality. That includestext-alignas well.@Chocobozzz commented on GitHub (May 27, 2021):
I'm not sure to understand. Are you explaining that we should detect the language in a HTML element to know if it should be displayed to the according direction?
@ahangarha commented on GitHub (May 27, 2021):
Yes. If you see the screenshot I shared above, in a timeline or search result or even in a channel, one may have videos with both English and Persian text. English titles should render with LTR direction and Persian titles should render with RTL. This applies to description, tags, channel name, etc. This mean each element that contains text which can be either RTL or LTR, should determine the direction of the text and accordingly render it in right direction.
There are different ways to achieve this. One is to apply
dir="auto"to the element. The other is to addunicode-bidi: plaintextstyle to the element which works but is not recommended. The first approach is used by many projects including Gitlab. In either cases, we should avoid using absolute values ofleft|rightfor text alignment, padding and margin and border unless.@Chocobozzz commented on GitHub (Jun 8, 2021):
Hello,
I implemented bidi support in
github.com/Chocobozzz/PeerTube@27bc958674You can try the changes on https://peertube2.cpy.re/ar:
I decided to not mix RTL and LTR directions depending on element languages to not break the layout. It seems that youtube also respects this behaviour.
There's still have some CSS inconsistencies because of some libraries we use (bootstrap 4 for example), but it should not hurt too much. There's also a bug with the bootstrap dropdown when there is a scrollbar, we reported it in https://github.com/ng-bootstrap/ng-bootstrap/issues/3495
@ahangarha commented on GitHub (Jun 8, 2021):
See. Peertube (like any other social media platform or messengers) hosts videos from different languages. Channel name, Video title, video description, tags, etc can not only have text in different languages but also can have mixed text. Not all people see videos on peertube while being logged in. So they cannot choose language. Even if they do this, they see problems in text direction specially if there be a mixed text.
Having RTL support is good but it is different from supporting Bidirectional text. If you share your concern regarding layout, I might be able to help to fix them in the best possible way.
Social media is not where we can control the language people share content. The platform should be enough flexible to handle it. Trust me! I along with millions of other people are suffering from this issue. So lets work together and fix this issue. It might take some time but it should be resolved.
Since the issue is not resolved, I request to keep it open. The mentioned commit
27bc958doesn't address the issue raised here. it is RTL support not bidi support.@ahangarha commented on GitHub (Jun 8, 2021):
Thank you @Chocobozzz. I really appreciate it.