]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts
Migrate to $localize
[github/Chocobozzz/PeerTube.git] / client / src / app / +my-account / my-account-settings / my-account-profile / my-account-profile.component.ts
index 400c3b889e380ccb6a1d2508a679684fd10454e8..ed0984bf7d780250af74690944d2f3e02d506d1a 100644 (file)
@@ -1,11 +1,7 @@
+import { Subject } from 'rxjs'
 import { Component, Input, OnInit } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
-import { FormReactive, UserService } from '../../../shared'
-import { User } from '@app/shared'
-import { I18n } from '@ngx-translate/i18n-polyfill'
-import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
-import { Subject } from 'rxjs/Subject'
-import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service'
+import { Notifier, User, UserService } from '@app/core'
+import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms'
 
 @Component({
   selector: 'my-account-profile',
@@ -21,16 +17,15 @@ export class MyAccountProfileComponent extends FormReactive implements OnInit {
   constructor (
     protected formValidatorService: FormValidatorService,
     private userValidatorsService: UserValidatorsService,
-    private notificationsService: NotificationsService,
-    private userService: UserService,
-    private i18n: I18n
-  ) {
+    private notifier: Notifier,
+    private userService: UserService
+    ) {
     super()
   }
 
   ngOnInit () {
     this.buildForm({
-      'display-name': this.userValidatorsService.USER_DISPLAY_NAME,
+      'display-name': this.userValidatorsService.USER_DISPLAY_NAME_REQUIRED,
       description: this.userValidatorsService.USER_DESCRIPTION
     })
 
@@ -53,7 +48,7 @@ export class MyAccountProfileComponent extends FormReactive implements OnInit {
         this.user.account.displayName = displayName
         this.user.account.description = description
 
-        this.notificationsService.success(this.i18n('Success'), this.i18n('Profile updated.'))
+        this.notifier.success($localize`Profile updated.`)
       },
 
       err => this.error = err.message