You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I set up react-i18next with i18next-browser-languagedetector in my project
I set up options as usual setting I think
but it doesn't set up cookie only using local storage
how can I set up cookie value in my project
if i make a wrong setting up options could you give me a some advice for me?
import LngDetector from 'i18next-browser-languagedetector';
...
looks like you set language on i18next.init -> lng: 'ko' -> which will completely ignore detections - which means only calling i18next.changeLanguage will set cookie later
I set up react-i18next with i18next-browser-languagedetector in my project
I set up options as usual setting I think
but it doesn't set up cookie only using local storage
how can I set up cookie value in my project
if i make a wrong setting up options could you give me a some advice for me?
import LngDetector from 'i18next-browser-languagedetector';
...
const options = {
order:['cookie', 'header', 'querystring'],
lookupCookie: 'Locale',
lookupQuerystring: 'Locale',
lookupLocalStorage: 'Locale',
// cookieExpirationDate: new Date(),
caches: ['cookie'],
cookieMinutes: 86400000,
cookieDomain: 'http://localhost:30202',
excludeCacheFor: ['cimode']
}
const detector = new LngDetector(null, options);
i18next
.use(XHR)
.use(detector)
.use(reactI18nextModule)
.init({
debug: true,
interpolation: {
// React already does escaping
escapeValue: false,
},
fallbackLng: 'ko',
lng: 'ko', // 'ko' | 'en',
// localStorageExprirationTime: 86400000,
ns: 'translation',
load:'all',
useCookie: true,
// Using simple hardcoded resources for simple example
resGetPath: 'locales/{{lng}}/{{ns}}.json',
},function(err, t){
window.geoip2.country(onSuccess, onError);
})
The text was updated successfully, but these errors were encountered: