inaturalist / SeekReactNative

Seek v2, built with React Native for Android and iOS
https://www.inaturalist.org/pages/seek_app
MIT License
154 stars 26 forks source link

Seek's language setting is unstable #642

Open tiwane opened 1 year ago

tiwane commented 1 year ago

Describe the bug If Seek's language is different than the device's language, Seek's language will sometimes revert back to using the device's language.

To Reproduce Steps to reproduce the behavior:

  1. Set your device's language setting to something non-English. I used French. Other users have set their phones to Spanish or Chinese.
  2. Open up Seek. Set Seek's language to English
  3. Use Seek a bit. Close it.
  4. Wait a bit (like an hour) and re-open Seek.
  5. Seek uses your device's language.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

image

Smartphone (please complete the following information):

Additional context Add any other context about the problem here (i.e. what language are you using, do you have location settings turned on, did you have cell signal)

I'm not sure if this happens in situations where one's device is set to English and Seek is set to something non-English.

Mehver commented 7 months ago

same on:

katajanmarja commented 4 months ago

Similar general "settings application forgetting" behaviour observed also in Finnish on Android and iPhone, and for common names showing.

It seems on the Android it forgot the setting to show common names instead of scientific names whenever the camera is opened and a species identified. (I've been demoing this to several people recently and don't have all the phone specs.)

I'm able to reproduce this with:

Steps to reproduce with Lockdown Mode on:

  1. Put phone in Lockdown Mode (iOS settings > Privacy and Security > Lockdown Mode On (this is a reversible setting that can be turned off afterwards, but triggers a phone restart) to simplify debugging.
    • Note: My Device Language is English, so whenever I see the app convert to full English I know Seek forgot its language settings. Some of the localization text in Finnish is missing but this is not an artifact of that, since I see the localizations for the major UI elements when the app is speaking Finnish.
  2. Start Seek
  3. Go to Seek in-app settings and set UI language to Finnish (or any non-device-language).
    • Only the 'Set language to Finnish' part of the UI turns into Finnish when 'Done' is pressed. The UI refresh is incomplete.
    • Changing the language now to e.g. French again only changes that part of the UI. It's not language specific.
  4. Going back to main menu and opening the 'side menu', you can see that part of the UI in Finnish, while the main page may or may not be
  5. Start the camera to make an observation. (The camera UI is in Finnish.)
  6. Wait for at least a partial ID of something and take a picture. This UI for reacting to the picture (in my case 'replace photo?' but also 'you made a new observation!', that's just harder to reproduce) is now in English (but a Finnish localization exists, I've seen it in non-Lockdown mode reproduction path searching).
  7. Start the camera again. The app will now also have forgotten the setting for showing common names instead of scientific names.
  8. Close Seek (by the iOS 'swipe up' UI) and restart it - language is in Finnish again

My gut guess would be that this bug is directly related to https://github.com/inaturalist/SeekReactNative/issues/691 and has to do with UI text fetching calls not having a consistent access to some form of settings-reading object, reverting all localization-style function calls back to default settings after some kind of glitch happens and the settings 'object' or the pointer to it is lost. This is why restart clears it.

So I would generally say this is a 'settings are unstable' problem.

As for the trigger, camera picture saving in iOS will cause a system call to tweak picture storage settings (i.e. restricted photo access in iOS will ask at that point if you want to grant Seek access to more photos, so I can see it visits the permission system - even if it's reasonably pointless in that situation), and a security-related syscall to iOS may be theoretically what is triggering the glitch. Could be it triggers some kind of memory cleanup operation? I'm not sure how the Android reproduction works, I can try to experiment if needed but now I have a straightforward reproduction instruction hopefully.

One valuable workaround for settings instability if this is hard to fix would be to make the default setting for Seek to show common names instead of scientific names, because those are more 'regular user friendly' and alleviate the issue since device settings will be in the user's language generally and won't need the Seek settings, and many more scientific users can 'make do' with local names better than regular users can make do with scientific names.

(Though I must admit it's also been fun looking at silly scientific names in the proposals. I just can't see at all if Seek's guessing correctly.)

seek-setting-change1 Here after applying Finnish only the language button is updated, though usually it updates also the text immediately around it, but not text in the nearby setting.

stone-w4tch3r commented 3 months ago

Same here. Unfortunately, can't contribute any new info.

The system language is English, switched the application to my native one. From time to time the language resets back to English