Skip to content

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

Closed

Description

@marionbarker

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.

Activity

  1. marionbarker commented on Dec 21, 2023

    @marionbarker
    ContributorAuthor

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

  2. dabear commented on Dec 27, 2023

    @dabear
    Contributor

    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

  3. dabear commented on Dec 27, 2023

    @dabear
    Contributor

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

  4. marionbarker commented on Dec 28, 2023

    @marionbarker
    ContributorAuthor

    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

  5. billybooth commented on Dec 28, 2023

    @billybooth
    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.
    החלק כדי להכניס צינורית

  6. marionbarker commented on Dec 28, 2023

    @marionbarker
    ContributorAuthor

    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.

  7. dabear commented on Dec 29, 2023

    @dabear
    Contributor

    fixed upstream

  8. marionbarker commented on Dec 29, 2023

    @marionbarker
    ContributorAuthor
  9. marionbarker commented on Jan 4, 2024

    @marionbarker
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions