next-translate
next-translate copied to clipboard
The t function of the useTranslation hook does not translate
the t function of the useTranslation hook does not translate, it only returns the locales/en/common.json key, is it possible or is it because I have non-standard page names prefixed with .page? like this _app.page.js
Here are my settings
Aren't you supposed to pass whole next.config.js to nextTranslate
? It's stated here
Instead of:
const nextTranslate = require('next-translate')
module.exports = {
webpack: (config, { isServer, webpack }) => {
return config;
},
...nextTranslate()
}
Try:
const nextTranslate = require('next-translate')
module.exports = nextTranslate({
webpack: (config, { isServer, webpack }) => {
return config;
}
})
I am having precisely same issue.
If I have pageExtensions: ['page.tsx', 'page.ts', 'page.jsx', 'page.js'],
, in next.config.js , translations are not working. As soon as I revert back to default pageExtensions, it works again.