Giter VIP home page Giter VIP logo

Comments (6)

jamuhl avatar jamuhl commented on June 16, 2024 1

http://stackoverflow.com/questions/1043339/javascript-for-detecting-browser-language-preference

see answer with 129 upvotes

from i18next-browser-languagedetector.

jamuhl avatar jamuhl commented on June 16, 2024

the point is navigator.languages is the preferred languages ordered by priority -> currently we pick the first and let i18next handle further prios - but basically we could extend that to enable user defined fallbacks to second preferred language,...

navigator.language here acts only as a fallback if navigator.languages (experimental) or navigator.userLanguages (older IE) do not return a language.

To get your desired result order your browser languages by prio (drag&drop). Display google chrome in this language - does not have to do with the content shown on web - just sets prio for chrome itself.

from i18next-browser-languagedetector.

damienleroux avatar damienleroux commented on June 16, 2024

I don't know another way than "Display google chrome in this language" for a user to change the default chosen language on newly loaded website.

It appears to me than if I choose to display chrome in English, it is to see both chrome and websites in English.

How could a user change the website default computed language on first load otherwise?
I voluntary exclude the usual website top flag select :).

I think it make sense that when both navigator.languages and navigator.language are defined, with navigator.language contained in navigator.languages, navigator.language should be chosen first instead of the first valid/whitelisted navigator.languages element.

from i18next-browser-languagedetector.

jamuhl avatar jamuhl commented on June 16, 2024

the order of the languages is relevant - on top is the most preferred - you can change the order by drag&drop

from i18next-browser-languagedetector.

damienleroux avatar damienleroux commented on June 16, 2024

Thank you for the reference. It helped! MDN declares that the order is relevant as well as Chrome in their documentation.I found the option "Display google chrome in this language" really misleading...

So I have to prey that my users read their browser documentation.. not like me!

from i18next-browser-languagedetector.

jamuhl avatar jamuhl commented on June 16, 2024

agree on it to be missleading...hope they improve that...

from i18next-browser-languagedetector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.