aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core/hotkeys/hotkeys.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-08-12 10:40:04 +0200
committerChocobozzz <me@florianbigard.com>2020-08-14 10:28:30 +0200
commit66357162f8e1227495f09bd4f68446aad7071c6d (patch)
tree7d4429506deb512b2fe1d0267f38a28cda20af55 /client/src/app/core/hotkeys/hotkeys.component.ts
parent8c360747995e17eb5520e22fc3d7bd4c3d26eeee (diff)
downloadPeerTube-66357162f8e1227495f09bd4f68446aad7071c6d.tar.gz
PeerTube-66357162f8e1227495f09bd4f68446aad7071c6d.tar.zst
PeerTube-66357162f8e1227495f09bd4f68446aad7071c6d.zip
Migrate to $localize
* Remove i18n polyfill to translate things in components * Reduce bundle sizes * Improve runtime perf * Reduce a lot the time to make a full client build * Reduce client build complexity * We don't need a service to translate things anymore (so we will be able to translate title pages etc) Unfortunately we may loose some translations in the migration process. I'll put a message on weblate to notify translators
Diffstat (limited to 'client/src/app/core/hotkeys/hotkeys.component.ts')
-rw-r--r--client/src/app/core/hotkeys/hotkeys.component.ts12
1 files changed, 5 insertions, 7 deletions
diff --git a/client/src/app/core/hotkeys/hotkeys.component.ts b/client/src/app/core/hotkeys/hotkeys.component.ts
index 512a2399a..315e1a25e 100644
--- a/client/src/app/core/hotkeys/hotkeys.component.ts
+++ b/client/src/app/core/hotkeys/hotkeys.component.ts
@@ -1,7 +1,6 @@
1import { Component, OnInit, OnDestroy, Input } from '@angular/core' 1import { Hotkey, HotkeysService } from 'angular2-hotkeys'
2import { Subscription } from 'rxjs' 2import { Subscription } from 'rxjs'
3import { I18n } from '@ngx-translate/i18n-polyfill' 3import { Component, Input, OnDestroy, OnInit } from '@angular/core'
4import { HotkeysService, Hotkey } from 'angular2-hotkeys'
5 4
6@Component({ 5@Component({
7 selector : 'my-hotkeys-cheatsheet', 6 selector : 'my-hotkeys-cheatsheet',
@@ -9,16 +8,15 @@ import { HotkeysService, Hotkey } from 'angular2-hotkeys'
9 styleUrls: [ './hotkeys.component.scss' ] 8 styleUrls: [ './hotkeys.component.scss' ]
10}) 9})
11export class CheatSheetComponent implements OnInit, OnDestroy { 10export class CheatSheetComponent implements OnInit, OnDestroy {
12 @Input() title = this.i18n('Keyboard Shortcuts:') 11 @Input() title = $localize`Keyboard Shortcuts:`
13 helpVisible = false 12 helpVisible = false
14 subscription: Subscription 13 subscription: Subscription
15 14
16 hotkeys: Hotkey[] 15 hotkeys: Hotkey[]
17 16
18 constructor ( 17 constructor (
19 private hotkeysService: HotkeysService, 18 private hotkeysService: HotkeysService
20 private i18n: I18n 19 ) {}
21 ) {}
22 20
23 public ngOnInit (): void { 21 public ngOnInit (): void {
24 this.subscription = this.hotkeysService.cheatSheetToggle.subscribe((isOpen) => { 22 this.subscription = this.hotkeysService.cheatSheetToggle.subscribe((isOpen) => {