aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/app.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-10-03 10:11:26 +0200
committerChocobozzz <me@florianbigard.com>2018-10-03 10:11:26 +0200
commite33f888b86734f7e050a5e3d6f73f852b6de955a (patch)
treeea722659930951a55fbb209f5a5e33ae7e4d1918 /client/src/app/app.component.ts
parent60709df53602def422e8c32509c27c65b52cb1bd (diff)
downloadPeerTube-e33f888b86734f7e050a5e3d6f73f852b6de955a.tar.gz
PeerTube-e33f888b86734f7e050a5e3d6f73f852b6de955a.tar.zst
PeerTube-e33f888b86734f7e050a5e3d6f73f852b6de955a.zip
Fix hotkey translations
Diffstat (limited to 'client/src/app/app.component.ts')
-rw-r--r--client/src/app/app.component.ts18
1 files changed, 10 insertions, 8 deletions
diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts
index 29b02032f..7cd0fff1b 100644
--- a/client/src/app/app.component.ts
+++ b/client/src/app/app.component.ts
@@ -6,6 +6,7 @@ import { is18nPath } from '../../../shared/models/i18n'
6import { ScreenService } from '@app/shared/misc/screen.service' 6import { ScreenService } from '@app/shared/misc/screen.service'
7import { skip } from 'rxjs/operators' 7import { skip } from 'rxjs/operators'
8import { HotkeysService, Hotkey } from 'angular2-hotkeys' 8import { HotkeysService, Hotkey } from 'angular2-hotkeys'
9import { I18n } from '@ngx-translate/i18n-polyfill'
9 10
10@Component({ 11@Component({
11 selector: 'my-app', 12 selector: 'my-app',
@@ -31,6 +32,7 @@ export class AppComponent implements OnInit {
31 customCSS: SafeHtml 32 customCSS: SafeHtml
32 33
33 constructor ( 34 constructor (
35 private i18n: I18n,
34 private router: Router, 36 private router: Router,
35 private authService: AuthService, 37 private authService: AuthService,
36 private serverService: ServerService, 38 private serverService: ServerService,
@@ -133,35 +135,35 @@ export class AppComponent implements OnInit {
133 new Hotkey(['/', 's'], (event: KeyboardEvent): boolean => { 135 new Hotkey(['/', 's'], (event: KeyboardEvent): boolean => {
134 document.getElementById('search-video').focus() 136 document.getElementById('search-video').focus()
135 return false 137 return false
136 }, undefined, 'Focus the search bar'), 138 }, undefined, this.i18n('Focus the search bar')),
137 new Hotkey('b', (event: KeyboardEvent): boolean => { 139 new Hotkey('b', (event: KeyboardEvent): boolean => {
138 this.toggleMenu() 140 this.toggleMenu()
139 return false 141 return false
140 }, undefined, 'Toggle the left menu'), 142 }, undefined, this.i18n('Toggle the left menu')),
141 new Hotkey('g o', (event: KeyboardEvent): boolean => { 143 new Hotkey('g o', (event: KeyboardEvent): boolean => {
142 this.router.navigate([ '/videos/overview' ]) 144 this.router.navigate([ '/videos/overview' ])
143 return false 145 return false
144 }, undefined, 'Go to the videos overview page'), 146 }, undefined, this.i18n('Go to the videos overview page')),
145 new Hotkey('g t', (event: KeyboardEvent): boolean => { 147 new Hotkey('g t', (event: KeyboardEvent): boolean => {
146 this.router.navigate([ '/videos/trending' ]) 148 this.router.navigate([ '/videos/trending' ])
147 return false 149 return false
148 }, undefined, 'Go to the trending videos page'), 150 }, undefined, this.i18n('Go to the trending videos page')),
149 new Hotkey('g r', (event: KeyboardEvent): boolean => { 151 new Hotkey('g r', (event: KeyboardEvent): boolean => {
150 this.router.navigate([ '/videos/recently-added' ]) 152 this.router.navigate([ '/videos/recently-added' ])
151 return false 153 return false
152 }, undefined, 'Go to the recently added videos page'), 154 }, undefined, this.i18n('Go to the recently added videos page')),
153 new Hotkey('g l', (event: KeyboardEvent): boolean => { 155 new Hotkey('g l', (event: KeyboardEvent): boolean => {
154 this.router.navigate([ '/videos/local' ]) 156 this.router.navigate([ '/videos/local' ])
155 return false 157 return false
156 }, undefined, 'Go to the local videos page'), 158 }, undefined, this.i18n('Go to the local videos page')),
157 new Hotkey('g u', (event: KeyboardEvent): boolean => { 159 new Hotkey('g u', (event: KeyboardEvent): boolean => {
158 this.router.navigate([ '/videos/upload' ]) 160 this.router.navigate([ '/videos/upload' ])
159 return false 161 return false
160 }, undefined, 'Go to the videos upload page'), 162 }, undefined, this.i18n('Go to the videos upload page')),
161 new Hotkey('shift+t', (event: KeyboardEvent): boolean => { 163 new Hotkey('shift+t', (event: KeyboardEvent): boolean => {
162 this.themeService.toggleDarkTheme() 164 this.themeService.toggleDarkTheme()
163 return false 165 return false
164 }, undefined, 'Toggle Dark theme') 166 }, undefined, this.i18n('Toggle Dark theme'))
165 ]) 167 ])
166 } 168 }
167 169