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

training_timer: Use regular colon as time divider #23

Closed
wants to merge 0 commits into from

Conversation

yoseforb
Copy link
Contributor

Use „:” (U+003A) instead of „∶” (U+2236). This will fix the reversed time in RTL languages.

See
https://gitlab.gnome.org/Teams/Websites/developer.gnome.org-hig/-/issues/127 for more information.

@yoseforb
Copy link
Contributor Author

Every Unicode character has a Bidirectional Class that determines how the character behaves in mixed left-to-right and right-to-left text, affecting its interaction with surrounding characters and overall text direction.

U+003A (Colon ":"), with Bidi Class CS (Common Separator), is designed for numeric separation and maintains correct order in both LTR and RTL contexts.

U+2236 (Ratio Symbol "∶"), with Bidi Class ON (Other Neutral), is suitable for mathematical uses like screen ratios (e.g., 16∶9), but can cause time strings to display incorrectly in RTL contexts.

As long as U+2236's Bidi Class is not CS, the correct thing is just to use U+003A instead of U+2236 for time format.

@mfep
Copy link
Owner

mfep commented Sep 16, 2024

Hi @yoseforb! Thank you for the translation, and this PR is also much appreciated. It would be good to enable Exercise Timer for translations in RTL languages.

With that said, I'm not sure if this changeset indeed fixes the problem, but I might just miss the point. Please educate me a bit more on what look is expected with this changeset. I've tried the app with flatpak run --env=LANG=he_IL.UTF-8 xyz.safeworlds.hiit.Devel, and I don't see too much difference between using the ratio symbol and using a semicolon. See the screenshots below:

Ratio symbol:
Screenshot from 2024-09-16 20-11-27

Semicolon:
Screenshot from 2024-09-16 20-09-14

As you can see, in both cases, the minute counter is on right, while the second counter is on left. Is this the correct appearance in this locale, or would it be the other way? Assuming the latter, and assuming that the semicolon is supposed to set the text to the left-to-right flow, I think it doesn't work, since the semicolon is in a separate label.

@yoseforb
Copy link
Contributor Author

You are right, I don't know how I missed it.

The problem is that you use here in a box with three different labels, so we need to align the box that contain all of the three labels to be ltr also in RTL.

We need to add set_direction: gtk::TextDirection::Ltr, to fix this.

The colon issue is always the right thing to do, it just not fix this bug in this case.

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 this pull request may close these issues.

2 participants