-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
RTL language causes OSC to malfunction #4878
Comments
I will be posting a PR soon that corrects the problems. |
This commit will: - Change the MainWindowController.updateTimeLabel and PlaySliderCell.knobRect methods to take into account userInterfaceLayoutDirection - Change the get method of the PlaySliderLoopKnob x property to take into account userInterfaceLayoutDirection - Change the language-direction of many OSC icons from Fixed to Left to Right, Mirrors This corrects the problem where clicking the slider in the on screen controller did not position the knob under the cursor when a right to left language is configured. This also corrects other related OSC RTL problems.
@ShlomoCode Do you spot anything wrong in this screenshot?: I did some more testing and found dragging the floating OSC around is broken. I will add a fix for that once I figure out the proper fix. |
@low-batt It looks fine! 👏 |
I suggest waiting for me to fix the problem with moving the OSC in floating mode. I may be able to get that done tomorrow. My understanding is that the IINA project's position is that localization is a priority and must be done right. So please do point out anything you notice that is not correct even if it is minor. I am expecting this will be an iterative process. First priority is to fix anything that is actually malfunctioning due to RTL. |
@ShlomoCode I normally don't work on localization, so I'm still reading and learning, especially about RTL. This morning I'm thinking the orientation of media controls shown by the Quicktime Player and Safari we discussed in issue 4776 was not an oversight and was very deliberate. From the Apple Internationalization and Localization Guide:
Other articles about RTL agree. From the Mozilla post Building RTL-Aware Web Apps & Websites: Part 1:
From the Medium post Fundamentals of Right to Left UI Design for Middle Eastern Languages
From the Media Player Icons section of RTL Styling 101:
It goes on to show how the Spotify app looks identical in English and Arabic pointing out the playback icons are not flipped since they are universal icons. From the OneSky post Right-to-Left (RTL) Localization: What You Need To Know:
From WOMEN IN LOCALIZATION Three Considerations for RTL Languages Localization:
I'm thinking my proposed changes are incorrect and I need to make IINA match up with Quicktime and Safari and not reverse the media controls. |
@low-batt Interesting, I never thought about the hardware emulation thing in software. |
No problem. Investigating and rethinking is a normal part of development. I looked into this as I was worried about defending not matching up with Quicktime's behavior to the other developers. I will redo the PR to follow Apple's guidelines. In the meantime I had been looking into the problems with dragging the floating OSC and I now have a fix for that. I also found that resizing the playlist panel was broken as well and I have a fix for that too. Tuesday is busy for me, so I won't be posting an update today. I should be able to post a revised PR soon. |
This commit will: - Add initializers to TimeLabelOverflowedStackView, TimeLabelOverflowedView and TouchBarPlaySliderCell that set userInterfaceLayoutDirection to be leftToRight - Change MainWindowController.windowDidLoad to set oscFloatingTopView property userInterfaceLayoutDirection to be leftToRight - Change constraints from leading/trailing to left/right for several music player OSC components to prevent them from moving when a RTL language is used - Change MainWindowController methods mouseDown and mouseDragged to take into account the userInterfaceLayoutDirection setting during playlist resizing - Change ControlBarView.mouseDragged to take into account the userInterfaceLayoutDirection setting when repositioning the floating OSC - Rename the play property in the Constants struct to be blackRightPointingTriangle - Add a blackLeftPointingTriangle property to the Constants struct - Change PlaylistViewController.tableView to use a right or left arrow based on the userInterfaceLayoutDirection setting - Change the language-direction of the pip and volume related icons and the playlist icon from Fixed to Left to Right, Mirrors This adjusts IINA's behavior to match Apple's guidance that video controls and timeline indicators should not flip in a right-to-left language. Other controls, such as the volume control and the pip and playlist buttons are flipped for RTL languages. This also corrects problems dragging the floating OSC and resizing the playlist when a right to left language is configured.
I've updated PR #4879. These features should be working with RTL:
Try it out if you have time. A critical review is always welcomed. Of course there are still other RTL problems to solve. |
This commit will: - Add initializers to TimeLabelOverflowedStackView, TimeLabelOverflowedView and TouchBarPlaySliderCell that set userInterfaceLayoutDirection to be leftToRight - Change MainWindowController.windowDidLoad to set oscFloatingTopView property userInterfaceLayoutDirection to be leftToRight - Change constraints from leading/trailing to left/right for several music player OSC components to prevent them from moving when a RTL language is used - Change MainWindowController methods mouseDown and mouseDragged to take into account the userInterfaceLayoutDirection setting during playlist resizing - Change ControlBarView.mouseDragged to take into account the userInterfaceLayoutDirection setting when repositioning the floating OSC - Rename the play property in the Constants struct to be blackRightPointingTriangle - Add a blackLeftPointingTriangle property to the Constants struct - Change PlaylistViewController.tableView to use a right or left arrow based on the userInterfaceLayoutDirection setting - Change the language-direction of the pip and volume related icons and the playlist icon from Fixed to Left to Right, Mirrors This adjusts IINA's behavior to match Apple's guidance that video controls and timeline indicators should not flip in a right-to-left language. Other controls, such as the volume control and the pip and playlist buttons are flipped for RTL languages. This also corrects problems dragging the floating OSC and resizing the playlist when a right to left language is configured.
CleanShot.2024-04-19.at.01.46.36.mp4(If you want you can turn this comment into a new issue for OSD issues) |
On the full screen button icon I think we stick with not flipping it. I had searched around and did not find a consistent standard. I will defer to the senior developers as to whether the IINA icon should be changed to be more like the Apple button. Let's treat the OSD as a separate issue. I can't believe I missed the reversed buttons. That must be fixed. I will revise the PR tomorrow. I suspect I broke that when trying to clean up all the extraneous changes Xcode added to the XIB. |
Why actualy the order of the customizable buttons reverses in the IINA OSC? |
Thanks for opening the OSD issue. I will tackle that once we are satisfied with the PR for this issue. My thinking on the list of customizable buttons is that they do not fall under the "video controls and timeline indicators" exception. So they should flip, just like the audio controls. The counter argument is that Apple did not reorder the two Quicktime buttons. So I am a little uncertain. One inconsistency on Apple's part. Quicktime flips the pip icon, so I made IINA's icon also flip. But in the pip window the pip icon to exit is not flipped. Seems incorrect to me. Makes me unsure as to how close we should follow Apple's example. What are your thoughts? |
This commit will: - Add initializers to TimeLabelOverflowedStackView, TimeLabelOverflowedView and TouchBarPlaySliderCell that set userInterfaceLayoutDirection to be leftToRight - Change MainWindowController.windowDidLoad to set the userInterfaceLayoutDirection property of fragControlView and oscFloatingTopView to be leftToRight - Change constraints from leading/trailing to left/right for several OSC components to prevent them from moving when a RTL language is used - Change MainWindowController methods mouseDown and mouseDragged to take into account the userInterfaceLayoutDirection setting during playlist resizing - Change ControlBarView.mouseDragged to take into account the userInterfaceLayoutDirection setting when repositioning the floating OSC - Rename the play property in the Constants struct to be blackRightPointingTriangle - Add a blackLeftPointingTriangle property to the Constants struct - Change PlaylistViewController.tableView to use a right or left arrow based on the userInterfaceLayoutDirection setting - Change the language-direction of the pip and volume related icons and the playlist icon from Fixed to Left to Right, Mirrors This adjusts IINA's behavior to match Apple's guidance that video controls and timeline indicators should not flip in a right-to-left language. Other controls, such as the volume control and the pip and playlist buttons are flipped for RTL languages. This also corrects problems dragging the floating OSC and resizing the playlist when a right to left language is configured.
I've updated PR #4879 with fixes for speed buttons. I did not change the behavior of the customizable buttons. I'm waiting to hear your thoughts. I'm still unsure on what the correct behavior should be, but still thinking they should flip like the audio controls as the these buttons are not video controls. |
But a true inversion should be of the entire layout (ie the group of customizable buttons will be on the left side of the window), not just the order within the group. |
True. I did not do that because Apple didn't do that with the audio controls. They left them on the left side of their OSC and reordered within the audio group. And yes I am confused by this. |
This commit will: - Add initializers to TimeLabelOverflowedStackView, TimeLabelOverflowedView and TouchBarPlaySliderCell that set userInterfaceLayoutDirection to be leftToRight - Change MainWindowController.windowDidLoad to set the userInterfaceLayoutDirection property of fragControlView and oscFloatingTopView to be leftToRight - Change constraints from leading/trailing to left/right for several OSC components to prevent them from moving when a RTL language is used - Change MainWindowController methods mouseDown and mouseDragged to take into account the userInterfaceLayoutDirection setting during playlist resizing - Change ControlBarView.mouseDragged to take into account the userInterfaceLayoutDirection setting when repositioning the floating OSC - Rename the play property in the Constants struct to be blackRightPointingTriangle - Add a blackLeftPointingTriangle property to the Constants struct - Change PlaylistViewController.tableView to use a right or left arrow based on the userInterfaceLayoutDirection setting - Change the language-direction of the pip and volume related icons and the playlist icon from Fixed to Left to Right, Mirrors This adjusts IINA's behavior to match Apple's guidance that video controls and timeline indicators should not flip in a right-to-left language. Other controls, such as the volume control and the pip and playlist buttons are flipped for RTL languages. This also corrects problems dragging the floating OSC and resizing the playlist when a right to left language is configured.
System and IINA version:
Expected behavior:
The on screen controller works properly with right to left languages such as Arabic and Hebrew.
Actual behavior:
Currently IINA does not support any right to left languages. However PR #4922 enables Hebrew. If you build IINA with that pull request and set Hebrew as the language then the slider in the OSC malfunctions. When you click on the slider the knob does not move to where the cursor is. The A-B Loop knobs can not be dragged. If you hover over the slider the thumbnail preview shown is not for the correct position in the video. Some images on the OSC point in the wrong direction.
These problems were reported by @ShlomoCode in issue #4776. As that issue reports quite a few RTL related problems I have created this issue that focuses on the OSC problem due to the malfunctioning behavior of the slider.
Steps to reproduce:
Product
menu open theScheme
menu and selectEdit Scheme…
Options
tabApp Language
settingRight-to-Left Pseudolanguage
near the end of the listOr you can build with PR #4922 and set your language to Hebrew.
mpv does not support localization.
How often does this happen?
Every time.
The text was updated successfully, but these errors were encountered: