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/following-list | |
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/following-list')
-rw-r--r-- | client/src/app/+admin/follows/following-list/following-list.component.ts | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/client/src/app/+admin/follows/following-list/following-list.component.ts b/client/src/app/+admin/follows/following-list/following-list.component.ts index dae8923b5..5f71f1238 100644 --- a/client/src/app/+admin/follows/following-list/following-list.component.ts +++ b/client/src/app/+admin/follows/following-list/following-list.component.ts | |||
@@ -3,7 +3,6 @@ import { Component, OnInit, ViewChild } from '@angular/core' | |||
3 | import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core' | 3 | import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core' |
4 | import { InstanceFollowService } from '@app/shared/shared-instance' | 4 | import { InstanceFollowService } from '@app/shared/shared-instance' |
5 | import { BatchDomainsModalComponent } from '@app/shared/shared-moderation' | 5 | import { BatchDomainsModalComponent } from '@app/shared/shared-moderation' |
6 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
7 | import { ActorFollow } from '@shared/models' | 6 | import { ActorFollow } from '@shared/models' |
8 | 7 | ||
9 | @Component({ | 8 | @Component({ |
@@ -22,9 +21,8 @@ export class FollowingListComponent extends RestTable implements OnInit { | |||
22 | constructor ( | 21 | constructor ( |
23 | private notifier: Notifier, | 22 | private notifier: Notifier, |
24 | private confirmService: ConfirmService, | 23 | private confirmService: ConfirmService, |
25 | private followService: InstanceFollowService, | 24 | private followService: InstanceFollowService |
26 | private i18n: I18n | 25 | ) { |
27 | ) { | ||
28 | super() | 26 | super() |
29 | } | 27 | } |
30 | 28 | ||
@@ -47,7 +45,7 @@ export class FollowingListComponent extends RestTable implements OnInit { | |||
47 | async addFollowing (hosts: string[]) { | 45 | async addFollowing (hosts: string[]) { |
48 | this.followService.follow(hosts).subscribe( | 46 | this.followService.follow(hosts).subscribe( |
49 | () => { | 47 | () => { |
50 | this.notifier.success(this.i18n('Follow request(s) sent!')) | 48 | this.notifier.success($localize`Follow request(s) sent!`) |
51 | this.loadData() | 49 | this.loadData() |
52 | }, | 50 | }, |
53 | 51 | ||
@@ -57,14 +55,14 @@ export class FollowingListComponent extends RestTable implements OnInit { | |||
57 | 55 | ||
58 | async removeFollowing (follow: ActorFollow) { | 56 | async removeFollowing (follow: ActorFollow) { |
59 | const res = await this.confirmService.confirm( | 57 | const res = await this.confirmService.confirm( |
60 | this.i18n('Do you really want to unfollow {{host}}?', { host: follow.following.host }), | 58 | $localize`Do you really want to unfollow ${follow.following.host}?`, |
61 | this.i18n('Unfollow') | 59 | $localize`Unfollow` |
62 | ) | 60 | ) |
63 | if (res === false) return | 61 | if (res === false) return |
64 | 62 | ||
65 | this.followService.unfollow(follow).subscribe( | 63 | this.followService.unfollow(follow).subscribe( |
66 | () => { | 64 | () => { |
67 | this.notifier.success(this.i18n('You are not following {{host}} anymore.', { host: follow.following.host })) | 65 | this.notifier.success($localize`You are not following ${follow.following.host} anymore.`) |
68 | this.loadData() | 66 | this.loadData() |
69 | }, | 67 | }, |
70 | 68 | ||