mirror of
https://github.com/lobehub/lobehub.git
synced 2026-03-26 13:19:34 +07:00
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.
14 lines
437 B
JavaScript
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',
|
|
};
|