i18next / i18next-xhr-backend

[deprecated] can be replaced with i18next-http-backend
https://github.com/i18next/i18next-http-backend
MIT License
253 stars 75 forks source link

category files #338

Closed alirezaseif28 closed 4 years ago

alirezaseif28 commented 4 years ago

hi. I went ahead with the documentation and implemented it according to the following code i18next.use(Backend).init({ backend: { // for all available options read the backend's repository readme file loadPath: '/Scripts/locales/{{lng}}/{{ns}}.json' } });

How do I have multiple files in multilingual folders? For example, I have a file Caption and a validation file on my backend. How does it fit into the language folders with the same category? Thanks.

jamuhl commented 4 years ago

ns -> is what you call category

alirezaseif28 commented 4 years ago

yes.ok I have a translation file I want to have some translation files.include caption file and validation file and etc. Thanks

jamuhl commented 4 years ago

Nesting files...like some magic scss stuff...?

You can have multiple files and load / use them...but we do not have some build time include mechanism...

alirezaseif28 commented 4 years ago

thanks. in line loadPath: '/Scripts/locales/{{lng}}/{{ns}}.json' When I look at server-side requests, I see that these files are in demand.

localhost/Scripts/locales/de/translation.json but i have two files. translation.json validation.json and why not get validation.json file? thanks

jamuhl commented 4 years ago

eventual reading the docs: https://www.i18next.com/principles/namespaces#sample

alirezaseif28 commented 4 years ago

Great Best regards