ngx-translate / core

The internationalization (i18n) library for Angular
MIT License
4.51k stars 574 forks source link

Different json file/path for each route #392

Closed aortmannm closed 6 years ago

aortmannm commented 7 years ago

I'm submitting a ... (check one with "x")

[ ] bug report => check the FAQ and search github for a similar issue or PR before submitting
[ ] support request => check the FAQ and search github for a similar issue before submitting
[x] feature request

Current behavior one static path/file

Expected/desired behavior We are writing an hosting application where many modules can join and we host them in our frame. We need a solution where each module can use his own translation files.

Reproduction of the problem If the current behavior is a bug or you can illustrate your feature request better with an example, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:btpW3l0jr5beJVjohy1Q).

What is the expected behavior?

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

ocombe commented 7 years ago

Hello,

there's a PR on hold for that, it should be coming soon, hopefully this week end I'll try to merge it

aortmannm commented 7 years ago

Very nice, thanks for the quick answer

charpeni commented 7 years ago

Any news?

ocombe commented 7 years ago

You can try 6.0.0 beta 1, it should be possible to define different configs for the loaders of each lazy loaded modules

Tuizi commented 7 years ago

I wrote a article about how to have 1 json file per lazy loaded module without having to write a new Custom Loader etc... it's quiet simple, only the documentation is not clear in fact: https://medium.com/@TuiZ/how-to-split-your-i18n-file-per-lazy-loaded-module-with-ngx-translate-3caef57a738f

ocombe commented 6 years ago

Hello, I'm closing this issue because it's too old. If you have a similar problem with recent version of the library, please open a new issue.