78

Dear web developers: please use the "Accept-Language" header to determine what language to use, not some weird, whacky geolocation script. That header exists for a reason.

Yes Google - that includes you.

Comments
  • 7
    Yes, with the option to override!
  • 10
    I type in English, I have an English audience, you shall receive its output in English 😎

    Maybe one day I might do multi Lang again but meh 🤷‍♂️
  • 6
    @C0D4 I can understand resources that are limited to a single language, that's no problem. What I don't understand is when resources are multi-lingual, but they try to use geolocation to work out what language they should use (instead of the Accept-Language header.)
  • 10
    @AlmondSauce
    I’m glad you agree there.

    As for the multi language sites, you’re right, that’s annoying when jumping on a vpn and suddenly the page translates to... well nothing I can read 😂

    Then trying to find the translate button but that’s in another language so you let chrome translate it badly for you 😎
  • 3
    @C0D4

    Oh that's the cause of that annoying shit of websites when using VPN 😵
  • 5
    @cursee yea it’s generally a ip2geo lookup for country and pull the language out - which is why vpn users are affected.

    Sadly this is not an accurate way of determining the users preference,
    Request headers will usually contain the accept-language header which gives you the users language from the browser Or you default back to the sites main language.
  • 6
    @C0D4 Yup. Or if you're abroad, and still want to see sites in English!
  • 2
    USE BANNERS

    Display page in default language and have a banner asking if you would like to change language! If the user presses the dismiss button display a small, auto-hiding message about how to change the language in the future! This is simple UX, don't make decisions for the user!
  • 0
    @AlgoRythm Hear, hear!!!
  • 2
    @AlgoRythm I disagree, no banners! Just use the header!
  • 0
    Whatever, the point is that you shouldnt make the decision for the user. Theres nothing more frustrating than software that tries to be "smart" and make things "easier" for the user. Come to think of the Windows File Explorer that by default hides away certain folders and filetypes.
  • 0
    @JohanO I agree, but in this case you should use the tool that's already designed and standardised to do the job, rather than cluttering the interface with something else!

    The header is the standard, browser based way to choose user language. Anything else is just annoying clutter.
  • 0
    @AlmondSauce I disagree! what if I need to borrow a computer or uses one in an Internet cafe/kiosk when in Oman or Bangladesh?
  • 1
    @JohanO Then you should still be able to change the value of that header from within the browser.
  • 2
    *adds to list of headers I didn’t realize existed*
  • 0
    @AlmondSauce But the header is not transparent enough for BFUs. Not everyone who uses web is a web dev and knows how things work. Imagine them coming to a known site from work laptop with everything installed in english, while he uses his native language on his personal computer. He would be like "why is this site in english? Why did they change language?" and some other similiar questions.

    Btw. the best way to do multi language website should be using different url for different languages - either subdomain or start of path (example.com/en/).
Add Comment