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/users/user-edit/user-create.component.ts | |
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/users/user-edit/user-create.component.ts')
-rw-r--r-- | client/src/app/+admin/users/user-edit/user-create.component.ts | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/client/src/app/+admin/users/user-edit/user-create.component.ts b/client/src/app/+admin/users/user-edit/user-create.component.ts index 3fddb9c09..36d71a927 100644 --- a/client/src/app/+admin/users/user-edit/user-create.component.ts +++ b/client/src/app/+admin/users/user-edit/user-create.component.ts | |||
@@ -3,7 +3,6 @@ import { ActivatedRoute, Router } from '@angular/router' | |||
3 | import { ConfigService } from '@app/+admin/config/shared/config.service' | 3 | import { ConfigService } from '@app/+admin/config/shared/config.service' |
4 | import { AuthService, Notifier, ScreenService, ServerService, UserService } from '@app/core' | 4 | import { AuthService, Notifier, ScreenService, ServerService, UserService } from '@app/core' |
5 | import { FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' | 5 | import { FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' |
6 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
7 | import { UserCreate, UserRole } from '@shared/models' | 6 | import { UserCreate, UserRole } from '@shared/models' |
8 | import { UserEdit } from './user-edit' | 7 | import { UserEdit } from './user-edit' |
9 | 8 | ||
@@ -25,9 +24,8 @@ export class UserCreateComponent extends UserEdit implements OnInit { | |||
25 | private route: ActivatedRoute, | 24 | private route: ActivatedRoute, |
26 | private router: Router, | 25 | private router: Router, |
27 | private notifier: Notifier, | 26 | private notifier: Notifier, |
28 | private userService: UserService, | 27 | private userService: UserService |
29 | private i18n: I18n | 28 | ) { |
30 | ) { | ||
31 | super() | 29 | super() |
32 | 30 | ||
33 | this.buildQuotaOptions() | 31 | this.buildQuotaOptions() |
@@ -67,7 +65,7 @@ export class UserCreateComponent extends UserEdit implements OnInit { | |||
67 | 65 | ||
68 | this.userService.addUser(userCreate).subscribe( | 66 | this.userService.addUser(userCreate).subscribe( |
69 | () => { | 67 | () => { |
70 | this.notifier.success(this.i18n('User {{username}} created.', { username: userCreate.username })) | 68 | this.notifier.success($localize`User ${userCreate.username} created.`) |
71 | this.router.navigate([ '/admin/users/list' ]) | 69 | this.router.navigate([ '/admin/users/list' ]) |
72 | }, | 70 | }, |
73 | 71 | ||
@@ -85,6 +83,6 @@ export class UserCreateComponent extends UserEdit implements OnInit { | |||
85 | } | 83 | } |
86 | 84 | ||
87 | getFormButtonTitle () { | 85 | getFormButtonTitle () { |
88 | return this.i18n('Create user') | 86 | return $localize`Create user` |
89 | } | 87 | } |
90 | } | 88 | } |