-
-
Notifications
You must be signed in to change notification settings - Fork 222
/
Copy pathnext-i18next.config.mjs
42 lines (37 loc) · 922 Bytes
/
next-i18next.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const debugI18n = ['true', 1].includes(
process?.env?.NEXTJS_DEBUG_I18N ?? 'false'
);
const localePublicFolder = undefined;
export const defaultLocale = 'en';
const getLocalesPath = async () => {
if ('window' in globalThis) {
return localePublicFolder;
}
// eslint-disable-next-line unicorn/prefer-node-protocol,unicorn/import-style
const path = await import('path').then((mod) => mod.default);
return path.resolve('../../packages/common-i18n/src/locales');
};
const localePath = await getLocalesPath();
/**
* @type {import('next-i18next').UserConfig}
*/
export default {
i18n: {
defaultLocale,
locales: ['en', 'fr'],
},
saveMissing: false,
strictMode: true,
serializeConfig: false,
reloadOnPrerender: process?.env?.NODE_ENV === 'development',
react: {
useSuspense: false,
},
debug: debugI18n,
/*
interpolation: {
escapeValue: false,
},
*/
localePath,
};