rbalet / ngx-translate-multi-http-loader

A loader for ngx-translate that loads translations with http calls
MIT License
75 stars 15 forks source link

Does this package support Angular Universal? #7

Closed ElesGergo closed 3 years ago

ElesGergo commented 4 years ago

I am getting the following error when I try to serve the app with angular universal.

I have tried many ways to reach the location of the file with http client and it seems that not the route is the problem.

Is that possible that it is not working because of http client on serverside. I have seen other libaries using fs for loading static files on the server side.

Error message: Could not find translation file: xyz

denniske commented 4 years ago

I never tried it with angular universal. I think it should work when ngx-translate works with angular universal. Did you try using ngx-translate with only one translation file and angular universal?

ElesGergo commented 4 years ago

I found the solution. So this will not work because with universal you should use the filesystem to read in the translations.

denniske commented 4 years ago

Okay so I can close this?

ElesGergo commented 4 years ago

Yes, the verdict is that it is not supported currently.Would you accept a pull request with a new module for Angular universal support?

denniske commented 4 years ago

You can create a pull request for https://github.com/ngx-translate/http-loader which I forked this repo from. Then I can pull the changes from there.