Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the Accept-Language header values to include all languages #242

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants