Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.

Conversation

@NausJessy
Copy link
Contributor

Update the generateLanguageHeaderValue logic to use NSLocale's preferredLanguages property instead of NSBundle's preferredLocalizations.

As per the documentation, the preferredLanguages property returns the user's preferred languages, including the app-specific language (as the first item in the list).

English is no longer added by default. Instead, all identifiers returned by preferredLanguages are included, with an associated priority (q) value, which is calculated depending on the position of the identifier in the list.

q = 1.0 - (position in priority list) * (1 / [list size])

@NausJessy NausJessy marked this pull request as ready for review April 2, 2025 12:12
@gitrema gitrema merged commit 934e213 into spotify:master Apr 2, 2025
1 check passed
@NausJessy NausJessy deleted the jessyn/update-accepte-language-header-logic branch April 2, 2025 12:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants