question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Language order not respected correctly

See original GitHub issue

It turns out that if you provide a header with language options,

e.g. curl -H 'Accept-Language: en-US,en;q=0.9,nl;q=0.8' wttr.in/~Portland

The system provides a response in the least-preferred language, e.g.:

Weerbericht voor: Portland

    \  /       Gedeeltelijk bewolkt
  _ /"".-.     59 °F
    \_(   ).   → 4 mph
    /(___(__)  9 mi
               0.0 in

This is incorrect. The first language in the list is the one that the site should choose for localization.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:7
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
drwilcocommented, May 10, 2018

Slight correction, the language with the highest q value should be chosen. (Which most browsers will make the first in the list, but it’s not mandatory.)

2reactions
marcopaganinicommented, Feb 13, 2019

The problem here seems to be that “en” has a somewhat of a “special status”: It’s the “default” language when no other language is specified, but not int he list of supported languages (SUPPORTED_LANGS). When “en” appears in the “Accept-Language” header, it is completely ignored by _find_supported_language().

This looks like a simple fix: Either add “en” to the list of supported languages (don’t know the side effects of it), or special case “en” in _find_supported_language().

Read more comments on GitHub >

github_iconTop Results From Across the Web

Word, Outlook not respecting language settings, not detecting ...
Word, Outlook not respecting language settings, not detecting language automatically. Hi,. I run Win 10 (1803) in English, keyboard ch-EN, ...
Read more >
Setting language preferences in a browser - W3C
Sometimes a server may determine which language to send to you in a way that doesn't rely on the Accept-Language information.
Read more >
Speech (sound) disorder - Raising Children Network
Children with speech disorders can understand words and sentences well and form phrases and sentences correctly. Children with language ...
Read more >
How Does Word Order Work? - Babbel
In this article, we look at every possible word order, what languages use them and what it would look like if English used...
Read more >
Word order - Wikipedia
However, even languages with flexible word order have a preferred or basic word order, with other word orders considered "marked". Constituent word order...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found