xiaoyifang / goldendict-ng

The Next Generation GoldenDict
https://xiaoyifang.github.io/goldendict-ng/
Other
1.46k stars 79 forks source link

Can someone share me a screenshot of Arabic(or any RTL language) browser ui interface ,like chrome or firefox? #1632

Closed xiaoyifang closed 2 days ago

xiaoyifang commented 5 days ago

Can someone share me a screenshot of Arabic(or any RTL language) browser ui interface ,like chrome or firefox?

I want to check the layout of Forward/Back button in the browser.

shenlebantongying commented 5 days ago

The left/right relationship of forward/backward is unchanged, but the position of the forward/backward combo is moved to another side of the topbar.

Arabic: image

Normal: image

https://addons.mozilla.org/firefox/addon/العربية-language-pack/

xiaoyifang commented 5 days ago

https://github.com/xiaoyifang/goldendict-ng/blob/2053511856a9b7c591f26ad927601fe985ee2997/src/ui/mainwindow.cc#L880-L884

then I think this piece of code can be removed.

shenlebantongying commented 5 days ago

Actually, no.

I checked it again, the backward is on the right side after switching to Arabic language (but they look the same. I said, "left/right relationship of forward/backward is unchanged" because they still look like <- -> rather than -> <- :sweat_smile: ).

https://ux.stackexchange.com/questions/55127/do-arabic-web-browsers-have-the-back-forward-buttons-reversed

Change chrome://flags/#force-ui-direction to RTL in chrome shows the same result (functionality of left right arrows <- -> will be swapped.).

shenlebantongying commented 5 days ago

In the current GD, this piece of code won't be triggered on Linux in anyway.

The whole app level layout direction is never set. No idea what the "auto" means (using LC_ALL=ar doesn't work and setting the language doesn't work, no idea if it depends on desktop environment's language settings.). https://doc.qt.io/qt-6/qguiapplication.html#layoutDirection-prop

https://github.com/xiaoyifang/goldendict-ng/blob/2053511856a9b7c591f26ad927601fe985ee2997/src/ui/mainwindow.cc#L880-L884


Unrelated, but force setting RTL via qApp->setLayoutDirection(RTL) looks like this :sweat_smile:

xiaoyifang commented 5 days ago

I checked it again, the backward is on the right side after switching to Arabic language (but they look the same. I said, "left/right relationship of forward/backward is unchanged" because they still look like <- -> rather than -> <- 😅 ).

the above code will make the button appear as -> <- .(If worked.) which should be controlled by layout direction.

If layout is concerned,all the buttons should be rearranged (through layout direction etc, or toolbar->layout->direction). Only change the Forward/Backward Button is not enough.

Based on above ,the code is still nonsense.

xiaoyifang commented 5 days ago

Unrelated, but force setting RTL via qApp->setLayoutDirection(RTL) looks like this 😅

what about qApp->setLayoutDirection(Auto) and then change the interface language to arabic/persian image

shenlebantongying commented 4 days ago

Based on above ,the code is still nonsense.

The code is needed when it triggers because buttons will be added from right to left if the whole app is RTL layout as shown in the forced layout screenshot https://github.com/xiaoyifang/goldendict-ng/issues/1632#issuecomment-2208110215 . Don't remove it.

However, I don't find a way to trigger the whole application RTL layout.

what about qApp->setLayoutDirection(Auto) and then change the interface language to arabic/persian

On Linux, the layout doesn't change to RTL (which is what browsers do) like Qt's doc says.

xiaoyifang commented 4 days ago

The code is needed when it triggers because buttons will be added from right to left if the whole app is RTL layout as shown in the forced layout screenshot #1632 (comment) . Don't remove it.

got your idea

xiaoyifang commented 4 days ago

image the screen seems mirrored. I have a little doubt that ,the Forward/Back button will be mirrored too.(which do not need to set the image explictly).