gilsdav / universal-localize-module-loader

(DEPCRECATED since Angular 8) Translate lazy-loaded routes using localize-router server-side using Universal
MIT License
5 stars 1 forks source link

is this working? #2

Closed epgeroy closed 6 years ago

epgeroy commented 6 years ago

I just installed the node package and added to the imports on my server mudule, but got this during compilation.

ERROR in node_modules/localize-router-lazy-universal-module-loader/src/lazy-universal-module-loader.d.ts(7,27): error TS2307: Cannot find module '@nguniversal/module-map-ngfactory-loader/typings/src/module-map'.

any ideas?

epgeroy commented 6 years ago

also tried downgrading @nguniversal/module-map-ngfactory-loader to the version pointed in package.json, but got the same result

gilsdav commented 6 years ago

You can check it work's on this project : https://github.com/gilsdav/angular-universal-localize-router/blob/master/package.json

This only work's with Angular <= 5 for now.

SrgSteak commented 6 years ago

Hi @gilsdav , is it possible to update this module loader to work with angular7? Do you need help?

(Btw, you are my personal hero with an actually working fork of the router-translate bundle.)

gilsdav commented 6 years ago

Hello @SrgSteak, Thanks for your support 👍

I will have to update this repo to upgrade Angular version of https://github.com/gilsdav/angular-universal-localize-router.

I currently never tested ngx-translate-router on Angular Universal, it's a big point I need to take. But did you ? Can you confirm it works if you don't have lazy-load translated routes (without this repo) ?

I think it will not need to much changes to work with ngx-translate-router. Replace references from localize-router to ngx-translate-router on https://github.com/gilsdav/universal-localize-module-loader/blob/master/src/lazy-universal-module-loader.ts may works. Can you test by copying this file into your project ?

SrgSteak commented 6 years ago

Hi @gildsav, thanks for the fast answer. For your first question: Yes, I have a working project you can find at https://github.com/SrgSteak/angular7-universal-translate Theres not only a bunch of modules to switch but also a lazy loaded one where it works on client side but results in a route not found on server side. (where i hope your module loader will help) I think i can try later today (about 10,11 hours?)

SrgSteak commented 6 years ago

Okay, wait. I got a few minutes to spare and guess what? It works! You are a genius! I pushed the changes on the latest commit in master.

gilsdav commented 6 years ago

Thank's for your feedback and your example 👍 I will use your repo as help to upgrade my own :)

SrgSteak commented 6 years ago

Hi @gilsdav glad i could help! We really need a working solution for translations accross the board and this bundle (plus lazy loading modules) is really something everyone could use. Why this isn't already a thing is beyond me.

If you have any questions on my repo, feel free to ask!

gilsdav commented 6 years ago

New version available for ngx-translate-router : localize-router-lazy-universal-module-loader@1.0.0-ntr. And my sample was updated to Angular 7 : https://github.com/gilsdav/angular-universal-localize-router @SrgSteak thanks for your help.