translation.json 404 error
See original GitHub issue🐛 Bug Report
i18next-http backend, trying to get ns “translation” even though the default name is “common”. And I get 404 error on console. My code working well but I don’t want get console error.
My code:
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import backend from "i18next-http-backend";
import languageDetector from "i18next-browser-languagedetector";
i18n
.use(initReactI18next) // passes i18n down to react-i18next
.use(backend) // for /public/locales
.use(languageDetector)
.init({
fallbackLng: "en",
supportedLngs: ["en", "tr"],
defaultNS: "common",
keySeparator: false, // we do not use keys in form messages.welcome
interpolation: {
escapeValue: false, // react already safes from xss
},
});
export default i18n;
My console log
request.js:60 GET https://tweet-maker-react.netlify.app/locales/en/translation.json 404
My public folder
public – locales ---- en ------ common.json ---- tr ------ common.json
Environment
- Node.js v12
- i18next version: 19.9.1
- Netlify
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Magento 2: js-translation.json 404 (Not Found) on production ...
I used this command : bin/magento setup:static-content:deploy --theme=Vendor/Theme en_US -f. This command created js-translation.json .
Read more >js-translation.json 404 - Magento Forums
Hello, I run MC v2.2 and when I try to add a product I get the spinning wheel & I have this error...
Read more >Magento 2: js-translation.json 404 (Not Found) on production ...
After switching to the production mode, an error appeared in the console : pub/static/adminhtml/Magento/backend/en_US/js-translation.json 404 (Not Found) ...
Read more >Getting 404 error for translation.json even if defaultNs ... - GitHub
Error comes out when trying to switch locale. Here is plunker: http://plnkr.co/edit/NVHURr Here is config for plugin.
Read more >Magento 2: js-translation.json 404 (Not Found) on production ...
Magento: Magento 2: js- translation. json 404 (Not Found ) on production modeHelpful? Please support me on Patreon: ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The ns options also defaults to [‘translation’]: https://www.i18next.com/overview/configuration-options
So you need to change that too:
If you like this module don’t forget to star this repo. Make a tweet, share the word or have a look at our https://locize.com to support the devs of this project.
There are many ways to help this project 🙏