Comments (9)
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.
could you please paste your init options...thank you
from i18next-browser-languagedetector.
Yeah, almost no init options:
i18next.use(LngDetector).init({ keySeparator: false, resources: .... });
That is all.
from i18next-browser-languagedetector.
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.
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.
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.
ah...if you init with lng
set in options it not even will do detection...will always use that value.
from i18next-browser-languagedetector.
hey...if you got time checkout http://locize.com might help you on the way to get your project translated
from i18next-browser-languagedetector.
Thank you! I think will be my next step (:.
from i18next-browser-languagedetector.
Related Issues (20)
- lng does not work if is after a # HOT 2
- Property 'detect' in type 'I18nextBrowserLanguageDetector' is not assignable to the same property in base type 'LanguageDetectorModule'. HOT 2
- FR and SP Not Working HOT 6
- LanguageDetector does not automatically detect language from browser HOT 14
- Cannot find file: 'i18nextBrowserLanguageDetector.js' does not match the corresponding name on disk: './node_modules/i18next-browser-languageDetector/dist/esm/i18next-browser-languagedetector'. HOT 4
- Subdomain Detection is not Working on Localhost HOT 4
- Types entries missing in package exports (Needed for Typescript >= 4.7 and moduleResolution="Node16"/"Nodenext") HOT 6
- v6.1.7 breaks create-react-app production build (and dev too) HOT 5
- TypeScript Error: TS2300 - Duplicate identifier 'PluginOptions'. HOT 3
- Can't import i18next-browser-language-detector in SvelteKit (vite) using adapter-static HOT 1
- typo case miss(mix)matching in modue name HOT 7
- Add an option like singleDetect HOT 2
- Add ability to specify mapping function HOT 4
- Don't understand what problem this library solves HOT 3
- How to change the localStorage name from i18nextLng to any other name HOT 1
- Failed to read the 'cookie' property from 'Document': Cookies are disabled inside 'data:' URLs. HOT 3
- Blank string values will get updated in localStorage, sessionStorage or cookie HOT 1
- How to disable getBestMatchFromCodes? HOT 3
- addDetector type does not match implementation HOT 1
- Only first language in list of browser languages is considered? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from i18next-browser-languagedetector.