Skip to content
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

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

Closed
xiaoyifang opened this issue Jul 3, 2024 · 9 comments · Fixed by #1645

Comments

@xiaoyifang
Copy link
Owner

xiaoyifang commented Jul 3, 2024

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
Copy link
Collaborator

shenlebantongying commented Jul 4, 2024

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
Copy link
Owner Author

if ( layoutDirection() == Qt::RightToLeft ) {
// Adjust button icons for Right-To-Left layout
navBack->setIcon( QIcon( ":/icons/next.svg" ) );
navForward->setIcon( QIcon( ":/icons/previous.svg" ) );
}

then I think this piece of code can be removed.

@shenlebantongying
Copy link
Collaborator

shenlebantongying commented Jul 4, 2024

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 -> <- 😅 ).

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
Copy link
Collaborator

shenlebantongying commented Jul 4, 2024

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

if ( layoutDirection() == Qt::RightToLeft ) {
// Adjust button icons for Right-To-Left layout
navBack->setIcon( QIcon( ":/icons/next.svg" ) );
navForward->setIcon( QIcon( ":/icons/previous.svg" ) );
}


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

@xiaoyifang
Copy link
Owner Author

xiaoyifang commented Jul 4, 2024

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
Copy link
Owner Author

xiaoyifang commented Jul 4, 2024

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
Copy link
Collaborator

shenlebantongying commented Jul 4, 2024

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 #1632 (comment) . 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
Copy link
Owner Author

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
Copy link
Owner Author

xiaoyifang commented Jul 5, 2024

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).

@xiaoyifang xiaoyifang linked a pull request Jul 6, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants