Skip to content

launcher: set preferred language list from system locale#732

Open
rawoul wants to merge 1 commit intoIgalia:masterfrom
rawoul:preferred-lang-from-locale
Open

launcher: set preferred language list from system locale#732
rawoul wants to merge 1 commit intoIgalia:masterfrom
rawoul:preferred-lang-from-locale

Conversation

@rawoul
Copy link
Contributor

@rawoul rawoul commented Aug 28, 2024

This changes the Accept-Language header to match the system locale by default.

@rawoul rawoul force-pushed the preferred-lang-from-locale branch from 9eddac8 to d281298 Compare August 28, 2024 12:16
@rawoul rawoul force-pushed the preferred-lang-from-locale branch from d281298 to 125f665 Compare August 29, 2024 09:25
@rawoul
Copy link
Contributor Author

rawoul commented Aug 29, 2024

Thanks for the review, I've fixed the issues you raised and factored the code in a separate function for clarity.

@TingPing
Copy link
Member

TingPing commented Aug 29, 2024

I have one concern, this exposes system information directly to the web which adds information for fingerprinting. Browsers like Safari specifically filter and reduce this list to make it less unique.

If this does or doesn't matter to Cog is probably for another dev to decide.


/* build Accept-Language from locale, filtering out encodings */
locales = g_get_language_names();
length = g_strv_length((gchar **) g_get_language_names());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might have to reformat the languages.

MDN says the format is en-US yet this will return en_US.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language

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