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

RTL language causes overlapping in subtitle settings #4888

Open
1 task done
low-batt opened this issue Apr 23, 2024 · 10 comments · May be fixed by #4889
Open
1 task done

RTL language causes overlapping in subtitle settings #4888

low-batt opened this issue Apr 23, 2024 · 10 comments · May be fixed by #4889

Comments

@low-batt
Copy link
Contributor

low-batt commented Apr 23, 2024

System and IINA version:

Expected behavior:
UI components do not overlap 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 color wells on the Subtitle tab of IINA's settings overlap the labels for the control. Also, if on the UI tab in the On Screen Display section the Display time and battery info when in full screen setting is enabled then the text giving the battery state overlaps with the battery icon.

These problems were reported by @ShlomoCode in issue #4776. As that issue reports quite a few RTL related problems I have created this issue to focus just on these two problems.

Steps to reproduce:

  • Open the IINA project in Xcode
  • Under the Product menu open the Scheme menu and select Edit Scheme…
  • Click on the Options tab
  • Scroll down to the App Language setting
  • In the pull down select Right-to-Left Pseudolanguage near the end of the list
  • Start IINA running under Xcode
  • Click on Settings… under the IINA menu
  • The settings panel appears
  • On the left side of the panel click on Subtitle
  • Notice in the Text Subtitles section the labels overlapping with the color wells.

Or you can build with PR #4922 and set your language to Hebrew.

  • MPV does not have this problem.

mpv does not support localization.

How often does this happen?
Every time.

@low-batt low-batt self-assigned this Apr 23, 2024
low-batt added a commit that referenced this issue Apr 23, 2024
This commit will:
- Correct the constraints in PrefSubViewController.xib
- Change the language-direction of the battery icon from Fixed to Left
  to Right, Mirrors

This corrects a problem with color wells overlapping their labels on the
Subtitle tab of IINA's settings. This also changes the battery icon
shown in full screen mode to flip in a RTL language correcting another
overlapping problem.
@low-batt low-batt linked a pull request Apr 23, 2024 that will close this issue
2 tasks
@low-batt low-batt linked a pull request Apr 23, 2024 that will close this issue
2 tasks
@ShlomoCode
Copy link

The battery icon is now in the right direction, but now its boundary line looks blurry
CleanShot 2024-04-23 at 20 49 56@2x
When I change the language specific to the application in the system settings to English, the icon is sharp (MBP 2021 built-in screen)
Is it the same for you?

@ShlomoCode
Copy link

ShlomoCode commented Apr 23, 2024

The orientation of the right half of the color picker button should be reversed, so that the two halves together form an ellipse (like group-toggle)
CleanShot 2024-04-23 at 20 47 10@2x

@ShlomoCode
Copy link

There also seems to be some overlap in the video and audio tabs (in the sidebar)
CleanShot 2024-04-23 at 21 13 49@2x

@low-batt
Copy link
Contributor Author

Tuesday is a busy day for me, but I will be responding to these problems.

There is definitely something wrong with the quick settings sidebar as I get constraint warning when I open it. The labels for the icons do look too close together.

A noticed another problem in the subtitle panel. Look for the word force in the Hebrew screenshot in my comment here. That is not a translation error, that is an IINA localization defect. I will be fixing that as well.

@ShlomoCode
Copy link

ShlomoCode commented Apr 24, 2024

I dived into the color picker again and I think that the 2 parts of the button should also be replaced, i.e. "mirror" of the English version -
If in LTR it is like this and the flow is from left to right

CleanShot 2024-04-25 at 01 41 45@2x

In RTL it should simply be a mirror - like the "valid" in this image:

CleanShot 2024-04-25 at 01 33 53@2x

@low-batt
Copy link
Contributor Author

Yes. I agree. The entire color well should be flipped as shown in the one labled "valid".

IINA uses a NSColorWell and when running under macOS Ventura or later the expanded style is used. I'm still trying to track down what is causing it to not flip as expected. I wrote a tiny test program and that worked fine. So it is something about how it is used in IINA that is causing it to malfunction. I will continue to investigate.

low-batt added a commit that referenced this issue Apr 25, 2024
This commit will:
- Correct the constraints in PrefSubViewController.xib
- Change the Mirror setting to Never on the color wells in the XIB
- Change the language-direction of the battery icon from Fixed to Left
  to Right, Mirrors

This corrects a problem with color wells overlapping their labels on the
Subtitle tab of IINA's settings. This also changes the battery icon
shown in full screen mode to flip in a RTL language correcting another
overlapping problem.
@ShlomoCode
Copy link

ShlomoCode commented May 5, 2024

There is definitely something wrong with the quick settings sidebar as I get constraint warning when I open it. The labels for the icons do look too close together.

Just a little reminder. I worry this small detail may have slipped through the cracks with everything going on :)

@low-batt
Copy link
Contributor Author

The constraint warnings seen with the quick settings panel when the layout is reversed proved to be due to the problems with the speed slider labels. The fix for that problem corrected the constraint warnings.

@ShlomoCode
Copy link

The constraint warnings seen with the quick settings panel when the layout is reversed proved to be due to the problems with the speed slider labels. The fix for that problem corrected the constraint warnings.

I built now with #4919 + #4922, and still the labels are too close to the icons.
I don't know how to check if there is a constraint warning, but the problem is still there.
I opened an issue #4925 for it.

@low-batt
Copy link
Contributor Author

I will have a look at #4925 tomorrow. Thanks for entering the issue.

Constraint warnings happen when constraints conflict so badly that layout is forced to intentionally break constraints. When that happens there will rather large warnings in the Xcode console. Of course objects can be miss-aligned without any constraint warnings.

To make it very obvious when constraint warnings occur run this command in terminal:

defaults write com.colliderli.iina NSConstraintBasedLayoutVisualizeMutuallyExclusiveConstraints true

With that setting you will get a purple box around the window as seen here:
purple

To turn this debugging tool off delete the setting or set it to false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants