diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-06-02 17:53:32 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-06-04 09:05:44 +0200 |
commit | 81fe3c67c5d70e69aa2d965a41afd7331cd4fb76 (patch) | |
tree | 1c2e81d9e609a71f87aa5c29172200b6b283a66f /client/src/app/app.component.ts | |
parent | 140ea386dea49220f4cdd5b67027e8d30eee1b06 (diff) | |
download | PeerTube-81fe3c67c5d70e69aa2d965a41afd7331cd4fb76.tar.gz PeerTube-81fe3c67c5d70e69aa2d965a41afd7331cd4fb76.tar.zst PeerTube-81fe3c67c5d70e69aa2d965a41afd7331cd4fb76.zip |
fix duplicate id in svg, empty alt in base email
Diffstat (limited to 'client/src/app/app.component.ts')
-rw-r--r-- | client/src/app/app.component.ts | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index aba91aad2..c77dc97de 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { Component, OnInit, ViewChild, AfterViewInit, Inject } from '@angular/core' | 1 | import { Component, OnInit, ViewChild, AfterViewInit, Inject, LOCALE_ID } from '@angular/core' |
2 | import { DomSanitizer, SafeHtml } from '@angular/platform-browser' | 2 | import { DomSanitizer, SafeHtml } from '@angular/platform-browser' |
3 | import { Event, GuardsCheckStart, NavigationEnd, Router, Scroll } from '@angular/router' | 3 | import { Event, GuardsCheckStart, NavigationEnd, Router, Scroll } from '@angular/router' |
4 | import { AuthService, RedirectService, ServerService, ThemeService } from '@app/core' | 4 | import { AuthService, RedirectService, ServerService, ThemeService } from '@app/core' |
@@ -43,6 +43,7 @@ export class AppComponent implements OnInit, AfterViewInit { | |||
43 | 43 | ||
44 | constructor ( | 44 | constructor ( |
45 | @Inject(DOCUMENT) private document: Document, | 45 | @Inject(DOCUMENT) private document: Document, |
46 | @Inject(LOCALE_ID) private localeId: string, | ||
46 | private i18n: I18n, | 47 | private i18n: I18n, |
47 | private viewportScroller: ViewportScroller, | 48 | private viewportScroller: ViewportScroller, |
48 | private router: Router, | 49 | private router: Router, |
@@ -97,6 +98,8 @@ export class AppComponent implements OnInit, AfterViewInit { | |||
97 | this.location.onPopState(() => this.modalService.dismissAll(POP_STATE_MODAL_DISMISS)) | 98 | this.location.onPopState(() => this.modalService.dismissAll(POP_STATE_MODAL_DISMISS)) |
98 | 99 | ||
99 | this.openModalsIfNeeded() | 100 | this.openModalsIfNeeded() |
101 | |||
102 | this.document.documentElement.lang = getShortLocale(this.localeId) | ||
100 | } | 103 | } |
101 | 104 | ||
102 | ngAfterViewInit () { | 105 | ngAfterViewInit () { |
@@ -171,16 +174,6 @@ export class AppComponent implements OnInit, AfterViewInit { | |||
171 | filter(pathname => !pathname || pathname === '/' || is18nPath(pathname)) | 174 | filter(pathname => !pathname || pathname === '/' || is18nPath(pathname)) |
172 | ).subscribe(() => this.redirectService.redirectToHomepage(true)) | 175 | ).subscribe(() => this.redirectService.redirectToHomepage(true)) |
173 | 176 | ||
174 | navigationEndEvent.pipe( | ||
175 | map(() => window.location.pathname), | ||
176 | ).subscribe(pathname => { | ||
177 | if (is18nPath(pathname)) { | ||
178 | this.document.documentElement.lang = getShortLocale(pathname.split('/')[1]) | ||
179 | } else { | ||
180 | this.document.documentElement.lang = 'en' | ||
181 | } | ||
182 | }) | ||
183 | |||
184 | navigationEndEvent.subscribe(e => { | 177 | navigationEndEvent.subscribe(e => { |
185 | this.hooks.runAction('action:router.navigation-end', 'common', { path: e.url }) | 178 | this.hooks.runAction('action:router.navigation-end', 'common', { path: e.url }) |
186 | }) | 179 | }) |