Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Switch from accepts to fluent-langneg for language header parsing #3360

Closed
jaredhirsch opened this issue Aug 16, 2017 · 1 comment
Closed
Labels
good first issue l10n Something related to localization / internationalization skill:js
Milestone

Comments

@jaredhirsch
Copy link
Member

We currently use the 'accepts' npm library to get an ordered list of user-preferred languages from a request.

The 'fluent-langneg' library just added an API in 0.0.3 to parse an accept-language header, a function called acceptedLanguages.

We should switch to dogfooding the new 'fluent-langneg' API.

I'm not sure the output will be the same in all cases, particularly the case of "Accept-Language: *", so we'll need to test that. Manual testing is fine; headers can be tweaked from FF devtools. Unit tests would be swell. Also note that an express request object is passed into accepts, while just the header should be passed into acceptedLanguages.

@johngruen johngruen added this to the Stretch milestone Aug 17, 2017
@ianb ianb added the l10n Something related to localization / internationalization label Jan 10, 2018
@ianb
Copy link
Contributor

ianb commented Jan 10, 2018

Looks like we're doing this now

@ianb ianb closed this as completed Jan 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue l10n Something related to localization / internationalization skill:js
Projects
None yet
Development

No branches or pull requests

3 participants