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

Insert Cannula Slider does not work for languages that go right to left #2105

Closed
marionbarker opened this issue Dec 21, 2023 · 9 comments
Closed

Comments

@marionbarker
Copy link
Contributor

Describe the bug
A picture is worth a thousand words:
Insert Cannula screen for Hebrew

Screenshot 2023-12-21 at 14 03 06

To Reproduce
Steps to reproduce the behavior:

  1. Build dev branch (after cannula insertion was changed to a slider)
  2. Pair a pod and go to insertion screen
  3. The slider does not work correctly when the language goes from right to left

Expected behavior
Be able to slide the slider from left to right or right to left - not sure what best approach is.
Right now indicator is all the way to the right and a normal attempt to move it fails.

Based on a hint from the user who complained about this, if you touch the indicator near the left side of the circle and move as fast as possible to the right, you can get it to insert, but obviously - this is not the desired behavior.

Repeated for Arabic as well as Hebrew.

LoopKit/LoopWorkspace, commit 67a4b1f
rPi DASH simulator for testing.

@marionbarker
Copy link
Contributor Author

The PR for OmniBLE and OmniKit are added for cross reference.

@dabear
Copy link
Contributor

dabear commented Dec 27, 2023

reproduced this in a demoapp.
This app is standalone, and mocks the omnipod integration with swiftui and allows you to test this bug out without inserting an actual pod..

image

dabear/testslider3@0029e9d

image

@dabear
Copy link
Contributor

dabear commented Dec 27, 2023

reported it upstream here: no-comment/SlideButton#4

@marionbarker
Copy link
Contributor Author

marionbarker commented Dec 28, 2023

In zulipchat, (in addition to recommending that this be fixed in the upstream repository), it was proposed that instead of

.environment(\.layoutDirection, .leftToRight)

the "fix" should use

.flipsForRightToLeftLayoutDirection(true)

I tested that modification as shown in the graphic below.

We do not have translations for either Arabic or Hebrew for the words in the slider - so they show up as English letters written right to left for both those languages. The slider moves correctly from right to left and inserts the cannula (as tested with the rPi DASH simulator).

flips-left-for-right-true

@billybooth
Copy link
Contributor

This is probably not a perfect translation, but you might try plugging in some Hebrew text (below) to verify that it doesn't flip. My sense is that .flipsForRightToLeftLayoutDirection(true) mirror flips the entire container and might not be appropriate for an element that contains text.
החלק כדי להכניס צינורית

@marionbarker
Copy link
Contributor Author

marionbarker commented Dec 28, 2023

I added your Hebrew string to the translation by inserting these lines into LoopWorkspace/OmniBLE/OmniBLE/he.lproj/Localizable.strings:

/* Cannula insertion button text while ready to insert */
"Slide to Insert Cannula" = "החלק כדי להכניס צינורית";

Here is the result:

add-hebrew-flips-left-for-right-true

I agree that this is probably not the correct thing to do.

@dabear
Copy link
Contributor

dabear commented Dec 29, 2023

fixed upstream

@marionbarker
Copy link
Contributor Author

This LoopWorkspace PR pulls in the upstream fix.

@marionbarker
Copy link
Contributor Author

This was fixed when LoopKit/LoopWorkspace#103 was merged.

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

No branches or pull requests

3 participants