diff options
author | Chocobozzz <me@florianbigard.com> | 2020-08-12 10:40:04 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-08-14 10:28:30 +0200 |
commit | 66357162f8e1227495f09bd4f68446aad7071c6d (patch) | |
tree | 7d4429506deb512b2fe1d0267f38a28cda20af55 /client/src/app/+admin/config/shared | |
parent | 8c360747995e17eb5520e22fc3d7bd4c3d26eeee (diff) | |
download | PeerTube-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/shared')
-rw-r--r-- | client/src/app/+admin/config/shared/config.service.ts | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/client/src/app/+admin/config/shared/config.service.ts b/client/src/app/+admin/config/shared/config.service.ts index f182946b8..5f98aa545 100644 --- a/client/src/app/+admin/config/shared/config.service.ts +++ b/client/src/app/+admin/config/shared/config.service.ts | |||
@@ -2,7 +2,6 @@ import { catchError } from 'rxjs/operators' | |||
2 | import { HttpClient } from '@angular/common/http' | 2 | import { HttpClient } from '@angular/common/http' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { RestExtractor } from '@app/core' | 4 | import { RestExtractor } from '@app/core' |
5 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
6 | import { CustomConfig } from '@shared/models' | 5 | import { CustomConfig } from '@shared/models' |
7 | import { environment } from '../../../../environments/environment' | 6 | import { environment } from '../../../../environments/environment' |
8 | 7 | ||
@@ -15,33 +14,32 @@ export class ConfigService { | |||
15 | 14 | ||
16 | constructor ( | 15 | constructor ( |
17 | private authHttp: HttpClient, | 16 | private authHttp: HttpClient, |
18 | private restExtractor: RestExtractor, | 17 | private restExtractor: RestExtractor |
19 | private i18n: I18n | 18 | ) { |
20 | ) { | ||
21 | this.videoQuotaOptions = [ | 19 | this.videoQuotaOptions = [ |
22 | { value: undefined, label: 'Default quota', disabled: true }, | 20 | { value: undefined, label: 'Default quota', disabled: true }, |
23 | { value: -1, label: this.i18n('Unlimited') }, | 21 | { value: -1, label: $localize`Unlimited` }, |
24 | { value: undefined, label: '─────', disabled: true }, | 22 | { value: undefined, label: '─────', disabled: true }, |
25 | { value: 0, label: this.i18n('None - no upload possible') }, | 23 | { value: 0, label: $localize`None - no upload possible` }, |
26 | { value: 100 * 1024 * 1024, label: this.i18n('100MB') }, | 24 | { value: 100 * 1024 * 1024, label: $localize`100MB` }, |
27 | { value: 500 * 1024 * 1024, label: this.i18n('500MB') }, | 25 | { value: 500 * 1024 * 1024, label: $localize`500MB` }, |
28 | { value: 1024 * 1024 * 1024, label: this.i18n('1GB') }, | 26 | { value: 1024 * 1024 * 1024, label: $localize`1GB` }, |
29 | { value: 5 * 1024 * 1024 * 1024, label: this.i18n('5GB') }, | 27 | { value: 5 * 1024 * 1024 * 1024, label: $localize`5GB` }, |
30 | { value: 20 * 1024 * 1024 * 1024, label: this.i18n('20GB') }, | 28 | { value: 20 * 1024 * 1024 * 1024, label: $localize`20GB` }, |
31 | { value: 50 * 1024 * 1024 * 1024, label: this.i18n('50GB') } | 29 | { value: 50 * 1024 * 1024 * 1024, label: $localize`50GB` } |
32 | ] | 30 | ] |
33 | 31 | ||
34 | this.videoQuotaDailyOptions = [ | 32 | this.videoQuotaDailyOptions = [ |
35 | { value: undefined, label: 'Default daily upload limit', disabled: true }, | 33 | { value: undefined, label: 'Default daily upload limit', disabled: true }, |
36 | { value: -1, label: this.i18n('Unlimited') }, | 34 | { value: -1, label: $localize`Unlimited` }, |
37 | { value: undefined, label: '─────', disabled: true }, | 35 | { value: undefined, label: '─────', disabled: true }, |
38 | { value: 0, label: this.i18n('None - no upload possible') }, | 36 | { value: 0, label: $localize`None - no upload possible` }, |
39 | { value: 10 * 1024 * 1024, label: this.i18n('10MB') }, | 37 | { value: 10 * 1024 * 1024, label: $localize`10MB` }, |
40 | { value: 50 * 1024 * 1024, label: this.i18n('50MB') }, | 38 | { value: 50 * 1024 * 1024, label: $localize`50MB` }, |
41 | { value: 100 * 1024 * 1024, label: this.i18n('100MB') }, | 39 | { value: 100 * 1024 * 1024, label: $localize`100MB` }, |
42 | { value: 500 * 1024 * 1024, label: this.i18n('500MB') }, | 40 | { value: 500 * 1024 * 1024, label: $localize`500MB` }, |
43 | { value: 2 * 1024 * 1024 * 1024, label: this.i18n('2GB') }, | 41 | { value: 2 * 1024 * 1024 * 1024, label: $localize`2GB` }, |
44 | { value: 5 * 1024 * 1024 * 1024, label: this.i18n('5GB') } | 42 | { value: 5 * 1024 * 1024 * 1024, label: $localize`5GB` } |
45 | ] | 43 | ] |
46 | } | 44 | } |
47 | 45 | ||