File tree Expand file tree Collapse file tree 4 files changed +20
-8
lines changed
apps/blog/src/assets/i18n
shared/util-seo/src/lib/services
shell/feature-shell-web/src/lib Expand file tree Collapse file tree 4 files changed +20
-8
lines changed Original file line number Diff line number Diff line change 108
108
"readLess" : " Read less"
109
109
},
110
110
"seo" : {
111
- "metaDescription" : " Angular.love - a place for all Angular enthusiasts created to inspire and educate."
111
+ "metaDescription" : " Angular.love - a place for all Angular enthusiasts created to inspire and educate." ,
112
+ "home" : " Blog and community for Angular fans" ,
113
+ "aboutUs" : " About us" ,
114
+ "becomeAuthor" : " Become an author" ,
115
+ "notFound" : " Not found"
112
116
},
113
117
"adBanner" : {
114
118
"registerButton" : " Download for free" ,
Original file line number Diff line number Diff line change 111
111
"readLess" : " Czytaj mniej"
112
112
},
113
113
"seo" : {
114
- "metaDescription" : " Angular.love - ciekawostki oraz rozwiązania dla średnio-zaawansowanych oraz zaawansowanych developerów Angulara."
114
+ "metaDescription" : " Angular.love - ciekawostki oraz rozwiązania dla średnio-zaawansowanych oraz zaawansowanych developerów Angulara." ,
115
+ "home" : " Blog dla sympatyków Angulara" ,
116
+ "aboutUs" : " O nas" ,
117
+ "becomeAuthor" : " Zostań autorem" ,
118
+ "notFound" : " Nie znaleziono"
115
119
},
116
120
"adBanner" : {
117
121
"registerButton" : " Pobierz za darmo" ,
Original file line number Diff line number Diff line change 1
1
import { DOCUMENT } from '@angular/common' ;
2
- import { inject , Injectable , signal } from '@angular/core' ;
2
+ import { inject , Injectable } from '@angular/core' ;
3
3
import { Meta , MetaDefinition , Title } from '@angular/platform-browser' ;
4
4
import { ActivatedRoute , NavigationEnd , Router } from '@angular/router' ;
5
+ import { TranslocoService } from '@jsverse/transloco' ;
5
6
import { filter , map , switchMap } from 'rxjs' ;
6
7
7
8
import { SeoMetaData } from '@angular-love/contracts/articles' ;
@@ -19,6 +20,7 @@ export class SeoService {
19
20
private readonly _meta = inject ( Meta ) ;
20
21
private readonly _document = inject ( DOCUMENT ) ;
21
22
private readonly _seoConfig = inject ( SEO_CONFIG ) ;
23
+ private readonly _translocoService = inject ( TranslocoService ) ;
22
24
private _url = '' ;
23
25
24
26
init ( ) : void {
@@ -47,7 +49,9 @@ export class SeoService {
47
49
this . updateTag ( seoConfig . siteName , 'ogSiteName' ) ;
48
50
49
51
if ( routeData && routeData [ 'seo' ] && routeData [ 'seo' ] [ 'title' ] ) {
50
- this . setTitle ( `${ routeData [ 'seo' ] [ 'title' ] } - ${ seoConfig . title } ` ) ;
52
+ this . setTitle (
53
+ `${ seoConfig . title } - ${ this . _translocoService . translate ( routeData [ 'seo' ] [ 'title' ] ) } ` ,
54
+ ) ;
51
55
} else {
52
56
this . setTitle ( '' ) ;
53
57
}
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export const routes: Route[] = [
31
31
( await import ( '@angular-love/blog/home/feature-home' ) )
32
32
. HomePageComponent ,
33
33
data : {
34
- seo : { title : 'Home ' } ,
34
+ seo : { title : 'seo.home ' } ,
35
35
} ,
36
36
} ,
37
37
{
@@ -48,7 +48,7 @@ export const routes: Route[] = [
48
48
( await import ( '@angular-love/feature-about-us' ) )
49
49
. FeatureAboutUsComponent ,
50
50
data : {
51
- seo : { title : 'About Us ' } ,
51
+ seo : { title : 'seo.aboutUs ' } ,
52
52
} ,
53
53
} ,
54
54
{
@@ -63,7 +63,7 @@ export const routes: Route[] = [
63
63
( await import ( '@angular-love/blog/become-author-page-feature' ) )
64
64
. BecomeAuthorPageFeatureComponent ,
65
65
data : {
66
- seo : { title : 'Become an author ' } ,
66
+ seo : { title : 'seo.becomeAuthor ' } ,
67
67
} ,
68
68
} ,
69
69
{
@@ -78,7 +78,7 @@ export const routes: Route[] = [
78
78
( await import ( '@angular-love/blog/shared/ui-not-found' ) )
79
79
. NotFoundPageComponent ,
80
80
data : {
81
- seo : { title : 'Not Found ' } ,
81
+ seo : { title : 'seo.notFound ' } ,
82
82
} ,
83
83
} ,
84
84
...articleRoutes ,
You can’t perform that action at this time.
0 commit comments