Start the setup process start in the language that the iPhone is set to
Based on user feedback
The current version of Soundscape starts the setup process in English when the app is first installed. Then the user could change the language in the middle of the setup. I'd like to have the setup process start in the language that the iPhone is set to, but I feel that the language question to choose another language should not be eliminated in case the user is bilingual. The app should default to English only if the phone is already set to English or if the iPhone is set to a language not supported by Soundscape.
Also, the Soundscape Language screen is missing from the U.S. English version of the App Setup in the help documentation but it's there in the U.K. English version.
I'll look into this
It seems like depending on the types of languages the user chooses the language won't update. This may be because of the region the languages are from and whether or not those specific types of a certain language are in our list of languages. For example if I put Spanish U.S. as my default language in the simulator, this won't be picked up and will start the app in english. However, if I use Spanish (Spain) it will change the startup language.
Here's the logic that sometimes skips the language selection during app setup: https://github.com/soundscape-community/soundscape/blob/b48232d630a3fb923f4ebf57fe3cdf3b1ab6dfc1/apps/ios/GuideDogs/Code/Visual%20UI/Views/Onboarding/OnboardingWelcomeView.swift#L22-L26
So the user is presented with language selection only if the device locale and app locale don't match. I'm not sure what that means in practice.
I'm going to look into this!
I think I want to start tackling this issue!
Is this patch supposed to fix the case where you can use a language variant and it should work in the same language even if a different variant is the only one available? For example, if your phone is set to Spanish U.S., you'll get the Spain Spanish language because that's the only Spanish version available. Or if your phone is set to English Australia, it changes to the first English variation, most likely U.S.
exactly. At the moment it only uses the phone language if the language and region both match. It should fall back to the same language with a different region if available.
In theory this may introduce a new bug where it starts in the appropriate language but the wrong region, even when that region is already supported. If that happens, I can let that bug slide. It's better to start in the correct language during setup. The user can change the region later in settings.
Just to clarify before I attempt a fix, the current behaviour according to the code is:
- The app sets the locale (language and region) to the first supported entry in the user's preferred Locales. This is an exact match, both language and region, so where the region doesn't match it defaults to English.
- if the current locale set above doesn't match the device locale exactly, the language selection screen is shown during onboarding.
- after a language is selected in that screen or later in Soundscape settings, that locale is always used and the device locale is ignored.
So it looks like the only thing that needs to change is that the welcome screen should be shown in one of the user's preferred languages, even if the region is different. Does that sound reasonable?
The matching logic is in static var firstSupportedLocale: Locale? {
I think that should be fine. Thanks.