Files
lobehub/next-i18next.config.js
canisminor1990 85e91ad977 🔧 chore: Update i18n configuration to include entry and output locales
This commit updates the "locales" property in the "i18n" object of
"next-i18next.config.js". It now includes the "entryLocale" and all
the "outputLocales" using the spread operator. Additionally, the
"localePath" property is set based on whether the code is running in
a browser or not.

The changes improve the i18n configuration by making it more flexible
and dynamic.
2023-07-15 19:31:03 +08:00

14 lines
437 B
JavaScript

const i18n = require('./.i18nrc');
/** @type {import('next-i18next').UserConfig} */
module.exports = {
debug: process.env.NODE_ENV === 'development',
i18n: {
defaultLocale: i18n.entryLocale,
locales: [i18n.entryLocale, ...i18n.outputLocales],
},
localePath:
typeof window === 'undefined' ? require('node:path').resolve('./', i18n.output) : '/locales',
reloadOnPrerender: process.env.NODE_ENV === 'development',
};