Localized iOS App - Obtain Device Language (not App Language)

I have an localized iOS App from which I want to obtain the device language (not the app language). The following sample app is localized in English and German. The current app language is German.

Here I want to obtain english, since that's the device language (see next screenshot).

Device Language Settings:

App Language Settings: (shouldn't be considered for obtaining device language)

Is there any API I could use to retrieve the device language?

To obtain the device language is a product management requirement to derive next steps in the app localization process.

Code of sample App:

struct ContentView: View {
    
    var body: some View {
        Form {
            Text("Hello, world")
            Text("Locale.preferredLanguages:\n\(Locale.preferredLanguages.joined(separator: ", "))")
            Text("Locale.current:\n\(Locale.current.language.languageCode?.identifier ?? "")")
        }
    }
}

Note: I have asked this question on Stack Overflow too (see here)

Replies

Do you test on device or on simulator ?

I found that long thread that may provide some hint: https://developer.apple.com/forums/thread/9246

Hi, what’s your use case for fetching the device language instead of the preferred language?

Sorry for the late Reply (somehow I wasn't notified about your answers).

@Claude31 I test on a real device. Thanks for the link. Unfortunately, the provided solution is nearly the same compared to what I have already tried with Locale.preferredLanguages above.

@Frameworks Engineer To obtain the device language is a product management requirement to derive next steps in the app localization process.