Working on a language(i18n) switcher but it works only partialy

I am working on a language(i18n) switcher with localized urls (instead of just adding a language prefix) but I cant get it to work. Atm it will translate regular text so switching between locale files(lazy loading) but it stops working when I switch to a different language and with stops working I mean that the pages wont work and I will show me the 404 page.

Because its a lot of file I added it to a github repo (still need to figure out how to setup a demo for this).