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/+my-account/my-account-settings/my-account-settings.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/+my-account/my-account-settings/my-account-settings.component.ts')
-rw-r--r-- | client/src/app/+my-account/my-account-settings/my-account-settings.component.ts | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts b/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts index a3a8ff1f1..7ea4610d4 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts +++ b/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts | |||
@@ -1,7 +1,6 @@ | |||
1 | import { ViewportScroller } from '@angular/common' | 1 | import { ViewportScroller } from '@angular/common' |
2 | import { AfterViewChecked, Component, OnInit } from '@angular/core' | 2 | import { AfterViewChecked, Component, OnInit } from '@angular/core' |
3 | import { AuthService, Notifier, User, UserService } from '@app/core' | 3 | import { AuthService, Notifier, User, UserService } from '@app/core' |
4 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
5 | 4 | ||
6 | @Component({ | 5 | @Component({ |
7 | selector: 'my-account-settings', | 6 | selector: 'my-account-settings', |
@@ -17,9 +16,8 @@ export class MyAccountSettingsComponent implements OnInit, AfterViewChecked { | |||
17 | private viewportScroller: ViewportScroller, | 16 | private viewportScroller: ViewportScroller, |
18 | private userService: UserService, | 17 | private userService: UserService, |
19 | private authService: AuthService, | 18 | private authService: AuthService, |
20 | private notifier: Notifier, | 19 | private notifier: Notifier |
21 | private i18n: I18n | 20 | ) {} |
22 | ) {} | ||
23 | 21 | ||
24 | get userInformationLoaded () { | 22 | get userInformationLoaded () { |
25 | return this.authService.userInformationLoaded | 23 | return this.authService.userInformationLoaded |
@@ -41,7 +39,7 @@ export class MyAccountSettingsComponent implements OnInit, AfterViewChecked { | |||
41 | this.userService.changeAvatar(formData) | 39 | this.userService.changeAvatar(formData) |
42 | .subscribe( | 40 | .subscribe( |
43 | data => { | 41 | data => { |
44 | this.notifier.success(this.i18n('Avatar changed.')) | 42 | this.notifier.success($localize`Avatar changed.`) |
45 | 43 | ||
46 | this.user.updateAccountAvatar(data.avatar) | 44 | this.user.updateAccountAvatar(data.avatar) |
47 | }, | 45 | }, |