2019-06-12 01:05:14 +02:00
|
|
|
const debugMode = !!(
|
|
|
|
|
process.env.NODE_ENV !== 'production' && process.env.REACT_APP_I18N_DEBUG
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const detectionOptions = {
|
|
|
|
|
// order and from where user language should be detected
|
2023-08-09 16:07:33 +02:00
|
|
|
order: [
|
|
|
|
|
'querystring',
|
|
|
|
|
'cookie',
|
|
|
|
|
'localStorage',
|
|
|
|
|
'navigator',
|
|
|
|
|
'htmlTag',
|
|
|
|
|
'path',
|
|
|
|
|
'subdomain',
|
|
|
|
|
],
|
2019-06-12 01:05:14 +02:00
|
|
|
|
|
|
|
|
// keys or params to lookup language from
|
|
|
|
|
lookupQuerystring: 'lng',
|
|
|
|
|
lookupCookie: 'i18next',
|
|
|
|
|
lookupLocalStorage: 'i18nextLng',
|
|
|
|
|
lookupFromPathIndex: 0,
|
|
|
|
|
lookupFromSubdomainIndex: 0,
|
|
|
|
|
|
|
|
|
|
// cache user language on
|
|
|
|
|
caches: ['localStorage', 'cookie'],
|
|
|
|
|
excludeCacheFor: ['cimode'], // languages to not persist (cookie, localStorage)
|
|
|
|
|
|
|
|
|
|
// optional htmlTag with lang attribute, the default is:
|
2023-08-09 16:07:33 +02:00
|
|
|
htmlTag: document.documentElement,
|
2019-06-12 01:05:14 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export { debugMode, detectionOptions };
|