Giter VIP home page Giter VIP logo

Comments (9)

MarcoMedrano avatar MarcoMedrano commented on June 8, 2024 1

yep I just init once or twice with that, then removed it, but I guess that was enough to make i18next to cache it.

from i18next-browser-languagedetector.

jamuhl avatar jamuhl commented on June 8, 2024

could you please paste your init options...thank you

from i18next-browser-languagedetector.

MarcoMedrano avatar MarcoMedrano commented on June 8, 2024

Yeah, almost no init options:
i18next.use(LngDetector).init({ keySeparator: false, resources: .... });

That is all.

from i18next-browser-languagedetector.

MarcoMedrano avatar MarcoMedrano commented on June 8, 2024

Probably is something wrong with firefox :S , after use the query string with es , yes it worked, but when I remove it, it does not want to come back to en, even I configured language preferences again to put en on the top, but I am still having spanish now. I restarted multiple times >.<

from i18next-browser-languagedetector.

jamuhl avatar jamuhl commented on June 8, 2024

https://github.com/i18next/i18next-browser-languageDetector#detector-options there is the caches array. Means after a detection (or manual change via i18next.changeLanguage) the new lng value is stored on localStorage or cookie (whatever is set). On every subsequent load it will use that value (if higher in the detection order. Hope that is understandable...

So if nothing else detected it will take lng from navigator - once persisted it will take the persisted value (clear that from localStorage or cookie for new detection from navigator)

from i18next-browser-languagedetector.

MarcoMedrano avatar MarcoMedrano commented on June 8, 2024

Ho man, yeah I think that was it. In my beginning tests I used lng: 'en' So I guess it was cached, then when I wanted to use your plugging, it got that from cache (cookies or localStorage) and no matter what I tried in the navigator.

I used the options you suggested to put the browser as first option, and all started to work as expected.
Thanks man! appreciated.

Postdata, probably would be better to change the default order, cookies and localstorage imho are used explicitly and require extra work and is a bit hard to realize third libs are using it, also for demo proposals browser priority would be nice.

from i18next-browser-languagedetector.

jamuhl avatar jamuhl commented on June 8, 2024

ah...if you init with lng set in options it not even will do detection...will always use that value.

from i18next-browser-languagedetector.

jamuhl avatar jamuhl commented on June 8, 2024

hey...if you got time checkout http://locize.com might help you on the way to get your project translated

from i18next-browser-languagedetector.

MarcoMedrano avatar MarcoMedrano commented on June 8, 2024

Thank you! I think will be my next step (:.

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.