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
Add support for right-to-left text directionality #8262
Comments
Can you provide what exactly has to be done? What happens when you enter Hebrew or Arabic content in Friendica? |
Here is some guide for styling Wordpress, but the actions taken are not WP specific. |
I have a suggestion. You just add I have a firefox addon called add bidi support which applies this attribute to almost all elements. It is not supposed to work perfectly in all circumstances (due to different architecture of html in different websites, but it demonstrate how this approach would work. I am not sure if I can do this on friendica as I have not seen the source code. So let me know if you can do it or not. |
This doesn't bring support for bidirectional text. This enforces RTL direction which would be problematic if you want to see LTR text. So this is not solution. On social media, we are dealing with situation in which people with different languages want to interact with each other. So the platform should be able to handle both RTL and LTR at the same time. It would be fine if the overall direction of page be either of LTR or RTL (perhaps based on selected interface language) but it shouldn't lead to wrong direction for individual texts. RTL should be seen RTL and LTR should be seen LTR. |
Thanks for the hint with |
I am not sure about one thing. This approach also works in some scenarios. Just add these stylesheets: .wall-item-body, .wall-item-body *, .media-heading {
unicode-bidi: plaintext;
} It needs to be set with more care as it can displace some other things such as RTL titles of a post fetched from RSS. But rest, it works fine |
Any update in this regard? |
Not yet, do you have a federated social media account that we could follow with RTL content to check our implementation? |
I am on mastodon: https://mas.to/@ahangarha/ But also you can check some twitter subscription with some Persian hashtags like If needed, I can share some mixed text I sometimes use to check bidi support on different apps. |
Thank you. The way I see it, there are two separate aspect of this, the UI and the content. The UI needs a full translation and then several tweaks on every page to make sure it feels right for RTL readers. For the content, it seems easier since only post bodies and profile information need to be correctly displayed. I believe the |
That would be a good start. There are few other things we need to keep in mind. One is when a post starts with a username (like mentioning a person) mentions should be in |
Thank you for the hint, I didn't know about this tag. so all display names should be wrapped with this tag. |
Yes. It might be possible to add And lets work with content first. Regardless of UI direction, content should show up in right direction. UI can be handled later. |
I have not tried to wrap things in I can make some test these days to see how would this approach work. I am not sure if myself can run a local installation of Friendica to test. I will do it with sample texts. |
Question for you: in the column where we show in order:
If the name and information are RTL, should the address also be RTL? Using Using |
Yes. this is how it should look like. It should apply direction based on the first strong character. What is rendered in this image, is the exact expected result. |
I added the
Could you please provide sample displays for these cases? |
I just don't know how we can work on this together since I don't have enough technical knowledge to run local env. |
There is another important issue: there shouldn't be any hard alignment (left|right) at least for such contents. padding, margin, text-align and border should use |
Friendica doesn't display usernames for mentions, it displays display names, which can be RTL. Example with your display name:
But this is only relevant if we have asymmetrical paddings/margins, right? And I don't think we have many absolute |
In this case (display name), it should be isolated so that the direction of rest of the text would be be determined by the main part of the post. You sample text is shown properly. |
Ok, I think the user-submitted content part is covered thanks to your precious technical hints. It wasn't much to add, but I would have needed a lot of time to figure out what to add. Thank you! |
Is there any instance deployed directly from dev branch? So I test. |
@ahangarha In several days (when I consider it stable enough), I will switch squeet.me to dev. |
Then I make an account there for test. I already have account on venera.social but I rarely post on that. |
@ahangarha this weekend I updated squeet.me. |
Today I checked squeet.me. Individual posts and conversations are fine but indexes (like search, posts,...) are not. Addressed in #10270 |
Well done! Just I notice two issues:
Addressed in #10278 |
Also the post creation form needs to support bidi. Addressed in #10278 |
Should I report all issues regarding bidi here? |
Absolutely, it would be way too noisy in separate issues. I'll look into your most recent reports later. |
The mentions seems not to work as expected either, in a RTL post the at-sign ends up at the end of the username like this: Wrong: |
Unfortunately I wasn't able to use |
It is fine to add The Addressed in friendica/friendica-addons#1118 |
It is at least in shape. Though it would be ideal if it can show the # and the other sign in reverse order in RTL hashtags. but I would say it is fine for now. I think we don't need to go for this much fine tuning at this stage at least. The priority is to make the UI work for RTL content. These details can be fine tuned later. |
Thank you, I included the hash-mark in the |
Is this still an issue? Or should the expansion of the RTL support be another ticket? |
Do you experience any issue? On some instances such as venera.social it is already working. I can say it is working fine. |
So we can close this ticket? |
I think so. If there be any issue, one can open a new issue. |
I recently saw a reshared post with RTL text. In frio the text of the reshared content was overlapping the little network icon and link to source icon. |
A screenshot and/or a link would be welcome. |
Yes. The problem is to find it again. |
Ha! Found one. :-) Username and date of post are inserted on the right side. But it should be on the left side. Steps to reproduce:
I only used the preview function to reproduce the issue. But the same happens with the submitted share. |
Ok, but lets close this ticket never the less, new issues with the RTL support should get their own tickets. |
With #10849 the Arabic translation of the strings used in the web UI of Friendica arrives in the repository as it now covers more then 50% of all strings used. Guess the RTL support campaign enters the next step. |
Add support for posting RTL texts in languages such as Arabic and Hebrew.
Please report any incorrect display in this issue.
The text was updated successfully, but these errors were encountered: