]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/follows/following-list/follow-modal.component.ts
Support ICU in TS components
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / follows / following-list / follow-modal.component.ts
index c55fc8d81f2380066dc88a8dbebf48e4e6cd8f1e..bac7b2b0186d8605dfba9a862962597de2ba44c8 100644 (file)
@@ -1,5 +1,6 @@
 import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core'
 import { Notifier } from '@app/core'
+import { prepareIcu } from '@app/helpers'
 import { splitAndGetNotEmpty, UNIQUE_HOSTS_OR_HANDLE_VALIDATOR } from '@app/shared/form-validators/host-validators'
 import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
 import { InstanceFollowService } from '@app/shared/shared-instance'
@@ -54,13 +55,19 @@ export class FollowModalComponent extends FormReactive implements OnInit {
     return window.location.protocol === 'https:'
   }
 
-  private async addFollowing () {
+  private addFollowing () {
     const hostsOrHandles = splitAndGetNotEmpty(this.form.value['hostsOrHandles'])
 
     this.followService.follow(hostsOrHandles)
       .subscribe({
         next: () => {
-          this.notifier.success($localize`Follow request(s) sent!`)
+          this.notifier.success(
+            prepareIcu($localize`{count, plural, =1 {Follow request} other {Follow requests}} sent!`)(
+              { count: hostsOrHandles.length },
+              $localize`Follow request(s) sent!`
+            )
+          )
+
           this.newFollow.emit()
         },