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/follows/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/follows/shared')
-rw-r--r-- | client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts b/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts index 662143abc..729b7f599 100644 --- a/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts +++ b/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts | |||
@@ -1,7 +1,6 @@ | |||
1 | import { Component, Input } from '@angular/core' | 1 | import { Component, Input } from '@angular/core' |
2 | import { Notifier } from '@app/core' | 2 | import { Notifier } from '@app/core' |
3 | import { RedundancyService } from '@app/shared/shared-main' | 3 | import { RedundancyService } from '@app/shared/shared-main' |
4 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
5 | 4 | ||
6 | @Component({ | 5 | @Component({ |
7 | selector: 'my-redundancy-checkbox', | 6 | selector: 'my-redundancy-checkbox', |
@@ -14,17 +13,16 @@ export class RedundancyCheckboxComponent { | |||
14 | 13 | ||
15 | constructor ( | 14 | constructor ( |
16 | private notifier: Notifier, | 15 | private notifier: Notifier, |
17 | private redundancyService: RedundancyService, | 16 | private redundancyService: RedundancyService |
18 | private i18n: I18n | 17 | ) { } |
19 | ) { } | ||
20 | 18 | ||
21 | updateRedundancyState () { | 19 | updateRedundancyState () { |
22 | this.redundancyService.updateRedundancy(this.host, this.redundancyAllowed) | 20 | this.redundancyService.updateRedundancy(this.host, this.redundancyAllowed) |
23 | .subscribe( | 21 | .subscribe( |
24 | () => { | 22 | () => { |
25 | const stateLabel = this.redundancyAllowed ? this.i18n('enabled') : this.i18n('disabled') | 23 | const stateLabel = this.redundancyAllowed ? $localize`enabled` : $localize`disabled` |
26 | 24 | ||
27 | this.notifier.success(this.i18n('Redundancy for {{host}} is {{stateLabel}}', { host: this.host, stateLabel })) | 25 | this.notifier.success($localize`Redundancy for ${this.host} is ${stateLabel}`) |
28 | }, | 26 | }, |
29 | 27 | ||
30 | err => this.notifier.error(err.message) | 28 | err => this.notifier.error(err.message) |