Bug 475043 - Problem with Bidi text
Summary: Problem with Bidi text
Status: RESOLVED FIXED
Alias: None
Product: Tokodon
Classification: Applications
Component: general (show other bugs)
Version: 23.08.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords: rtl
Depends on:
Blocks:
 
Reported: 2023-09-30 10:56 UTC by Sohrab Behdani
Modified: 2024-01-24 16:25 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 24.02
Sentry Crash Report:


Attachments
Issue screenshot (45.87 KB, image/jpeg)
2023-09-30 10:56 UTC, Sohrab Behdani
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sohrab Behdani 2023-09-30 10:56:37 UTC
Created attachment 161969 [details]
Issue screenshot

SUMMARY
***
Hello, there is a problem with tokodon when showing bidi text. when it starts with LTR languages such as english and then somthing like persian it became all LTR and vise versa.

i had attached a screenshot for this issue
***

Plasma 5.27.8 on Arch Linux
Comment 1 Joshua Goins 2023-10-02 11:42:15 UTC
Confirmed, I'll see if this is something we can fix on our end
Comment 2 Joshua Goins 2023-10-03 20:56:54 UTC
So I managed to fix this, but making it mixed with LTR  languages like English is going to be difficult for now (but not unsolvable)...

What's the better solution here: keep it LTR if it detects English or keep it RTL with English also being shifted? If it's the latter, I can submit my fix :)
Comment 3 Sohrab Behdani 2023-10-05 08:54:01 UTC
(In reply to Joshua Goins from comment #2)
> So I managed to fix this, but making it mixed with LTR  languages like
> English is going to be difficult for now (but not unsolvable)...
> 
> What's the better solution here: keep it LTR if it detects English or keep
> it RTL with English also being shifted? If it's the latter, I can submit my
> fix :)

thanks, but in my language we use some foreign words from other languages and our toots could be a mixture of persian and english words.
in markdown we use direction = auto to make things stay in their position.

i guess it could help you too.
Comment 4 Joshua Goins 2023-11-08 20:01:40 UTC
After talking to some other people about it, I have a solution but it won't be implemented anytime soon. It would chop up the paragraphs so that rtl text wouldn't be mixed with ltr text, similar to how it looks on websites and markdown.
Comment 5 Bug Janitor Service 2024-01-24 05:11:37 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/tokodon/-/merge_requests/462
Comment 6 Janet Blackquill 2024-01-24 16:03:23 UTC
Git commit 3d6f5ff58604978e4d85d201078c69bc3acd900b by Janet Blackquill.
Committed on 24/01/2024 at 17:03.
Pushed by jblackquill into branch 'release/24.02'.

PostContent: assorted bidirectionality fixes

- turn mentions into bidirectional isolates which makes them work nicer inline in RtL
- split apart <br/> into text blocks, which allows each line to have its own direction like other platforms render them
(cherry picked from commit 80eb1b3e35a3dfa60deff6a53a2ad53f9536a396)

M  +2    -0    src/CMakeLists.txt
M  +1    -6    src/content/ui/StatusDelegate/PostContent.qml
M  +1    -1    src/utils/clipboard.cpp
A  +75   -0    src/utils/textpreprocessing.cpp     [License: LGPL(v2.0+)]
A  +25   -0    src/utils/textpreprocessing.h     [License: LGPL(v2.0+)]

https://invent.kde.org/network/tokodon/-/commit/3d6f5ff58604978e4d85d201078c69bc3acd900b