Skip to content

Add navigator.languages #59

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

Merged
merged 2 commits into from
Jul 19, 2021

Conversation

toastal
Copy link
Contributor

@toastal toastal commented Jul 15, 2021

Prerequisites

  • Before opening a pull request, please check the HTML standard (https://dom.spec.whatwg.org/). If it doesn't appear in this spec, it may be present in the spec for one of the other purescript-web projects. Although MDN is a great resource, it is not a suitable reference for this project.

Found it: https://html.spec.whatwg.org/multipage/system-state.html#language-preferences
It appears all of the Navigator needs to be updated on MDN.

Description of the change

Languages, plural, gives the developer a list of languages the use prefers be the fallback. Personally I'd rather fallback from en-US to en-CA instead of en-GB and would take Spanish before French and this feature lets users tell the application their preferences (sadly at the cost of browser fingerprinting). This list is also the same list for the Accept-Language HTTP header the client sends to the server, but maybe a SPA would want to know as well since it will talk to the server a lot less.


Checklist:

  • Added the change to the changelog's "Unreleased" section with a reference to this PR (e.g. "- Made a change (#0000)")
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation
  • Added a test for the contribution (if applicable)

Copy link
Contributor

@JordanMartinez JordanMartinez left a comment

Choose a reason for hiding this comment

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

Thanks! Not sure if we need to say anything about the 94% not being 100%, but perhaps that should be left to the developer to check themselves as that number can easily change over time. Besides this is FFI, so they likely should be checking.

@garyb
Copy link
Member

garyb commented Jul 18, 2021

Thanks! Not sure if we need to say anything about the 94% not being 100%, but perhaps that should be left to the developer to check themselves as that number can easily change over time. Besides this is FFI, so they likely should be checking.

I'd agree with that, these libraries are just meant to implement the standards even if unfortunately they're not entirely supported.

@toastal toastal force-pushed the navigator-languages branch from 832e415 to 9fc6a41 Compare July 18, 2021 13:31
@thomashoneyman thomashoneyman merged commit 82ec70a into purescript-web:master Jul 19, 2021
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.

4 participants