Closed TommyLeong closed 1 year ago
Make sure maskedDirectoryPath starts with http...
@adrai actually no, it's pointing to my local project path. Any chance u spotted something configured wrongly?
If it does not start with http, pn server side that will fail... Beside that, a reproducible example would help to investigate.
@adrai I have created a repo here for reproduce purpose. Hope to hear from you soon!
@TommyLeong => https://github.com/TommyLeong/reproduce-inext18/pull/1/files
So can this issue be closed?
Yes. Thank you for your prompt response!
May I understand why must the url leave it with http://localhost:8080/locales?lng={{lng}}&ns={{ns}}
? From where the value of lng
and ns
is coming?
it gets automatically interpolated with the requested language and namespace by the used backend plugin
🐛 Bug Report
I'm trying to get my translation content from a API, the payload response structure is designed as below. (It's not necessarily to follow such structure, as I'm currently concept proofing the reading from API is possible)
en -> language ns1 -> namespace anything inside namespace is just key:value translation
I'm however getting the following error message while visiting the page itself (loading the page itself has no issue, everything render fine)
At the same time, I have created 2 .json file within FE project, at path of
projectRootDir/public/locales/en/
Inside both this file, I have also placed the key:value for
welcome
common.json
ns1.json
To Reproduce
next-i18next.config.js
_app.js
FE code
Expected behavior
I'm expecting that the translation content read from API will be returned as the namespace
ns1
.Your Environment
More information on the debug