`accept-language` is not send correctly by URLSession

We are developing an multi language app. We support

  • German
  • French
  • English

When the user have set the phones primary language to Danish and the secondary language to French, the app will then default to French.

URLSession will then put da-DK,da;q=0.9 in the accept-language header and not fr-FR,fr;q=0.9 as expected.

But when the user changes the app only to German, then the accept-language header is de-DE,de;q=0.9

So it looks like iOS is not sending the correct header.

Anyone else that have experienced this problem and maybe can help us?

I’d like to clarify this:

When the user have set the phones primary language …

But when the user changes the app only to German …

My reading of this is that:

  • URLSession does the right thing when you change the language for the system as a whole.

  • But the wrong thing when you change the language just for your app.

Is that correct?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Hi Quinn!

Thanks for the reply.

My iOS language settings are the following screenshot

The app language setting are the following screenshot

Here I would expect that URLSession is adding fr-FR,fr;q=0.9 as accept-language header. But it actually sends da-DA,da;q=0.9.

When we change the language to English or German, we get the correct headers as expected

That seems like a bug to me and I encourage you to file it as such. Please post your bug number, just for the record.

Here I would expect that URLSession is adding fr-FR,fr;q=0.9

You mean fr-CH,fr;q=0.9, right?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Bug filed: FB11640290

`accept-language` is not send correctly by URLSession
 
 
Q