]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/core/confirm/confirm.component.ts
Fixes #574 account link width on video view (#665)
[github/Chocobozzz/PeerTube.git] / client / src / app / core / confirm / confirm.component.ts
index 8f81b7a988a74fbec57da6bd22c6603ca2edd3ea..02b38489a9b264083758203b2f561bd0d0671156 100644 (file)
@@ -3,6 +3,7 @@ import { Component, HostListener, OnInit, ViewChild } from '@angular/core'
 import { ModalDirective } from 'ngx-bootstrap/modal'
 
 import { ConfirmService } from './confirm.service'
+import { I18n } from '@ngx-translate/i18n-polyfill'
 
 @Component({
   selector: 'my-confirm',
@@ -18,8 +19,12 @@ export class ConfirmComponent implements OnInit {
   inputLabel = ''
 
   inputValue = ''
+  confirmButtonText = ''
 
-  constructor (private confirmService: ConfirmService) {
+  constructor (
+    private confirmService: ConfirmService,
+    private i18n: I18n
+  ) {
     // Empty
   }
 
@@ -30,13 +35,15 @@ export class ConfirmComponent implements OnInit {
     }
 
     this.confirmService.showConfirm.subscribe(
-      ({ title, message, expectedInputValue, inputLabel }) => {
+      ({ title, message, expectedInputValue, inputLabel, confirmButtonText }) => {
         this.title = title
         this.message = message
 
         this.inputLabel = inputLabel
         this.expectedInputValue = expectedInputValue
 
+        this.confirmButtonText = confirmButtonText || this.i18n('Confirm')
+
         this.showModal()
       }
     )