strongloop / strong-globalize

strong-globalize is built on Unicode CLDR and jquery/globalize and implements automatic extraction of strings from JS source code and HTML templates, lint the string resource, machine-translate them in seconds. In runtime, it loads locale and string resource into memory and provides a hook to persistent logging.
Other
25 stars 16 forks source link

Account for differences in accept-language header #156

Closed codechennerator closed 4 years ago

codechennerator commented 4 years ago

Hello all, sorry to bring this up again. Issue: https://github.com/strongloop/strong-globalize/issues/157 The changes I made last time fixed the issue for the regional accept-languages. However, it made a regression for headers without the accept-language header. While fixing the issue, I also realized that there are weighted http headers. So I wanted to account for that too.

Purpose of PR: The purpose of this PR is to account for the different accept-language headers that are possible during a request.

Tests: Made new tests to account for the different accept-language.

  1. If there is one header, but no accept-language
  2. If there is an empty accept-language header
  3. If there is a wildcard, *, accept-language header
  4. If there are multiple, weighted headers.
slnode commented 4 years ago

Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test."