Problems I met
common.json is the file I used in my project with react-i18n
I want to add a different hash suffix like: common_sdfslkk.json to key it new, so that browsers can load new versions of this common.json file.
But if I add a suffix to the common.json file, the ns is changed to common_sdfslkk.
I don't know if it's right to say so.
What I need
I want to add a hash to the common.js file like: common_absddsldkf.json, but I still want to keep the namespace common.
You will need to change the loadPath (if using xhr) -> https://github.com/i18next/i18next-xhr-backend#backend-options
loadPath: '/locales/{{lng}}/{{ns}}-hash.json',
So I add a hash to common.json to common_asdgsd.json, the namespace is still common?
And I should edit the file by hand
Now if I add a hash to common.json to common_hash.json, the namespace is changed to common_hash. That's the problem.
yes - namespace will be interpolated to the {{ns}} -> so namespace will keep common
but honestly you do not need a hash...for what you need that...? there are cache-headers
Sometimes servers can't support Etag, and the new file common.json can't be loaded
Thank you very much!
did you find a solution
What's the solution for this? I am now using create-react-app and can't find how to add hash to json filenames during development (npm start) and build (npm run build)
Most helpful comment
What's the solution for this? I am now using
create-react-appand can't find how to add hash to json filenames during development (npm start) and build (npm run build)