Honigeintopf
Honigeintopf

Reputation: 63

NGX translate with mutliple pages

so I understood and can implement NGX translate with one page, but how does it work with multiple pages. When I change the page with routing from www.testsite.com/home to www.testsite.com/profile for example and I have changed the language chaned from EN to FR for example, does it automatically update all the routes?

Upvotes: 0

Views: 129

Answers (1)

Eugene_Kr
Eugene_Kr

Reputation: 129

if you provide TranslateModule.forRoot() in app module - it will exist on root level of app. By changing language on one page(rout) it will be set 'globally' (not really globally) but on highest level of you angular application. And by this way you should not worry about your translations on other pages. \

BUT if you configure translations differently for every particular module - it should vary...

Also are you using lazy loaded modules or shared services?

Answering to you question

for example and I have changed the language chaned from EN to FR for example, does it automatically update all the routes?

  • if all configured correctly - actually it doesn't updates routes, but service store user choice. you will see selected translation on other pages.

Upvotes: 1

Related Questions