gilsdav / ngx-translate-router

Translate routes using ngx-translate
131 stars 43 forks source link

Setting the page title #129

Closed kdbarzallo closed 2 years ago

kdbarzallo commented 2 years ago

Hi, I am using this library for the translation of routes in my project, but now I find that I can't set the title of each page with the title property available in angular 14. here's link : https://angular.io/guide/router#setting-the-page-title

midlis commented 2 years ago

FYI just as a quick workaround check https://github.com/midlis/ngx-translate-router/commit/4b7337b7c3006c9ff352b3e2087238e6d1f38f68. It is not a proper fix but I merely inject a TitleStrategy singleton into LocalizedRouter to address my immediate needs.

You can use dist from https://github.com/midlis/ngx-translate-router-dist (build with Node.js v16.10.0). But be warn, I'm not going to maintain it. To use it put into your package.json: "ngx-translate-router": "git://github.com/midlis/ngx-translate-router-dist.git#70c949bae9698f458722cba31b48b0de92869262", It also requires adjusting all imports to come from ngx-translate-router and make sure that your TitleStrategy is injected in root of the app.

kdbarzallo commented 2 years ago

Hi @midlis ! I will try the solution you have given me and get back to you with comments. Thank you.

gilsdav commented 2 years ago

Fixed in version 5.1.0