@winstrike/next-i18next-koa
Version:
The easiest way to translate your NextJs apps. With Koa support only. Forked from 'next-i18next'.
45 lines • 1.24 kB
JavaScript
import isNode from 'detect-node';
export const isServer = isNode && !process.browser;
export const localeSubpathOptions = {
ALL: 'all',
FOREIGN: 'foreign',
NONE: 'none'
};
const DEFAULT_LANGUAGE = 'en';
const OTHER_LANGUAGES = [];
const DEFAULT_NAMESPACE = 'common';
const LOCALE_PATH = 'static/locales';
const LOCALE_STRUCTURE = '{{lng}}/{{ns}}';
const LOCALE_EXTENSION = 'json';
const LOCALE_SUBPATHS = localeSubpathOptions.NONE;
const config = {
defaultLanguage: DEFAULT_LANGUAGE,
otherLanguages: OTHER_LANGUAGES,
load: 'currentOnly',
localePath: LOCALE_PATH,
localeStructure: LOCALE_STRUCTURE,
localeExtension: LOCALE_EXTENSION,
localeSubpaths: LOCALE_SUBPATHS,
use: [],
defaultNS: DEFAULT_NAMESPACE,
interpolation: {
escapeValue: false,
formatSeparator: ',',
format: (value, format) => format === 'uppercase' ? value.toUpperCase() : value
},
browserLanguageDetection: true,
serverLanguageDetection: true,
ignoreRoutes: ['/_next', '/static'],
customDetectors: [],
detection: {
lookupCookie: 'next-i18next',
order: ['cookie', 'header', 'querystring'],
caches: ['cookie']
},
react: {
wait: true
},
strictMode: true,
errorStackTraceLimit: 0
};
export default config;