I created a Next.js project and having trouble installing next-i18next.
If I try to define next-i18next.config.js like this:
/** @type {import('next-i18next').UserConfig} */
module.exports = {
i18n: {
defaultLocale: 'en',
locales: ['en'],
},
}
Then I simply can’t import it in next.config.mjs. I can’t find any documentation on how to do this.
Second problem is that I can’t do this:
import { appWithTranslation } from 'next-i18next'
const MyApp = ({ Component, pageProps }) => (
<Component {...pageProps} />
)
export default appWithTranslation(MyApp)
because there is now _app.js file in my app.
Did someone successfully install next-i18next with next.config.mjs and without _app.js?
If not, which alternatives can I use? next-i18next.config.js already seems too bothersome.