aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/config/edit-custom-config/edit-custom-config.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/+admin/config/edit-custom-config/edit-custom-config.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/+admin/config/edit-custom-config/edit-custom-config.component.ts')
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts24
1 files changed, 11 insertions, 13 deletions
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
index 00a0bfad2..3a60b144f 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
+++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
@@ -12,7 +12,6 @@ import {
12 UserValidatorsService 12 UserValidatorsService
13} from '@app/shared/shared-forms' 13} from '@app/shared/shared-forms'
14import { NgbNav } from '@ng-bootstrap/ng-bootstrap' 14import { NgbNav } from '@ng-bootstrap/ng-bootstrap'
15import { I18n } from '@ngx-translate/i18n-polyfill'
16import { CustomConfig, ServerConfig } from '@shared/models' 15import { CustomConfig, ServerConfig } from '@shared/models'
17 16
18@Component({ 17@Component({
@@ -42,45 +41,44 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A
42 private userValidatorsService: UserValidatorsService, 41 private userValidatorsService: UserValidatorsService,
43 private notifier: Notifier, 42 private notifier: Notifier,
44 private configService: ConfigService, 43 private configService: ConfigService,
45 private serverService: ServerService, 44 private serverService: ServerService
46 private i18n: I18n
47 ) { 45 ) {
48 super() 46 super()
49 47
50 this.resolutions = [ 48 this.resolutions = [
51 { 49 {
52 id: '0p', 50 id: '0p',
53 label: this.i18n('Audio-only'), 51 label: $localize`Audio-only`,
54 description: this.i18n('A <code>.mp4</code> that keeps the original audio track, with no video') 52 description: $localize`A <code>.mp4</code> that keeps the original audio track, with no video`
55 }, 53 },
56 { 54 {
57 id: '240p', 55 id: '240p',
58 label: this.i18n('240p') 56 label: $localize`240p`
59 }, 57 },
60 { 58 {
61 id: '360p', 59 id: '360p',
62 label: this.i18n('360p') 60 label: $localize`360p`
63 }, 61 },
64 { 62 {
65 id: '480p', 63 id: '480p',
66 label: this.i18n('480p') 64 label: $localize`480p`
67 }, 65 },
68 { 66 {
69 id: '720p', 67 id: '720p',
70 label: this.i18n('720p') 68 label: $localize`720p`
71 }, 69 },
72 { 70 {
73 id: '1080p', 71 id: '1080p',
74 label: this.i18n('1080p') 72 label: $localize`1080p`
75 }, 73 },
76 { 74 {
77 id: '2160p', 75 id: '2160p',
78 label: this.i18n('2160p') 76 label: $localize`2160p`
79 } 77 }
80 ] 78 ]
81 79
82 this.transcodingThreadOptions = [ 80 this.transcodingThreadOptions = [
83 { value: 0, label: this.i18n('Auto (via ffmpeg)') }, 81 { value: 0, label: $localize`Auto (via ffmpeg)` },
84 { value: 1, label: '1' }, 82 { value: 1, label: '1' },
85 { value: 2, label: '2' }, 83 { value: 2, label: '2' },
86 { value: 4, label: '4' }, 84 { value: 4, label: '4' },
@@ -288,7 +286,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A
288 286
289 this.updateForm() 287 this.updateForm()
290 288
291 this.notifier.success(this.i18n('Configuration updated.')) 289 this.notifier.success($localize`Configuration updated.`)
292 }, 290 },
293 291
294 err => this.notifier.error(err.message) 292 err => this.notifier.error(err.message)