🔧 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.
This commit is contained in:
canisminor1990
2023-07-15 19:31:03 +08:00
parent 32e0255387
commit 85e91ad977

View File

@@ -5,7 +5,7 @@ module.exports = {
debug: process.env.NODE_ENV === 'development',
i18n: {
defaultLocale: i18n.entryLocale,
locales: [i18n.entryLocale, i18n.outputLocales],
locales: [i18n.entryLocale, ...i18n.outputLocales],
},
localePath:
typeof window === 'undefined' ? require('node:path').resolve('./', i18n.output) : '/locales',