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/shared/shared-main/account | |
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/shared/shared-main/account')
-rw-r--r-- | client/src/app/shared/shared-main/account/actor-avatar-info.component.ts | 6 | ||||
-rw-r--r-- | client/src/app/shared/shared-main/account/avatar.component.ts | 15 |
2 files changed, 4 insertions, 17 deletions
diff --git a/client/src/app/shared/shared-main/account/actor-avatar-info.component.ts b/client/src/app/shared/shared-main/account/actor-avatar-info.component.ts index 1389218cc..3a86e5b21 100644 --- a/client/src/app/shared/shared-main/account/actor-avatar-info.component.ts +++ b/client/src/app/shared/shared-main/account/actor-avatar-info.component.ts | |||
@@ -1,7 +1,6 @@ | |||
1 | import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' | 1 | import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' |
2 | import { Notifier, ServerService } from '@app/core' | 2 | import { Notifier, ServerService } from '@app/core' |
3 | import { Account, BytesPipe, VideoChannel } from '@app/shared/shared-main' | 3 | import { Account, BytesPipe, VideoChannel } from '@app/shared/shared-main' |
4 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
5 | import { ServerConfig } from '@shared/models' | 4 | import { ServerConfig } from '@shared/models' |
6 | 5 | ||
7 | @Component({ | 6 | @Component({ |
@@ -23,11 +22,10 @@ export class ActorAvatarInfoComponent implements OnInit { | |||
23 | 22 | ||
24 | constructor ( | 23 | constructor ( |
25 | private serverService: ServerService, | 24 | private serverService: ServerService, |
26 | private notifier: Notifier, | 25 | private notifier: Notifier |
27 | private i18n: I18n | ||
28 | ) { | 26 | ) { |
29 | this.bytesPipe = new BytesPipe() | 27 | this.bytesPipe = new BytesPipe() |
30 | this.maxSizeText = this.i18n('max size') | 28 | this.maxSizeText = $localize`max size` |
31 | } | 29 | } |
32 | 30 | ||
33 | ngOnInit (): void { | 31 | ngOnInit (): void { |
diff --git a/client/src/app/shared/shared-main/account/avatar.component.ts b/client/src/app/shared/shared-main/account/avatar.component.ts index 73c145ef9..2967828a0 100644 --- a/client/src/app/shared/shared-main/account/avatar.component.ts +++ b/client/src/app/shared/shared-main/account/avatar.component.ts | |||
@@ -1,6 +1,5 @@ | |||
1 | import { Component, Input, OnInit } from '@angular/core' | 1 | import { Component, Input, OnInit } from '@angular/core' |
2 | import { Video } from '../video/video.model' | 2 | import { Video } from '../video/video.model' |
3 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
4 | 3 | ||
5 | @Component({ | 4 | @Component({ |
6 | selector: 'avatar-channel', | 5 | selector: 'avatar-channel', |
@@ -15,19 +14,9 @@ export class AvatarComponent implements OnInit { | |||
15 | channelLinkTitle = '' | 14 | channelLinkTitle = '' |
16 | accountLinkTitle = '' | 15 | accountLinkTitle = '' |
17 | 16 | ||
18 | constructor ( | ||
19 | private i18n: I18n | ||
20 | ) {} | ||
21 | |||
22 | ngOnInit () { | 17 | ngOnInit () { |
23 | this.channelLinkTitle = this.i18n( | 18 | this.channelLinkTitle = $localize`${this.video.account.name} (channel page)` |
24 | '{{name}} (channel page)', | 19 | this.accountLinkTitle = $localize`${this.video.byAccount} (account page)` |
25 | { name: this.video.channel.name, handle: this.video.byVideoChannel } | ||
26 | ) | ||
27 | this.accountLinkTitle = this.i18n( | ||
28 | '{{name}} (account page)', | ||
29 | { name: this.video.account.name, handle: this.video.byAccount } | ||
30 | ) | ||
31 | } | 20 | } |
32 | 21 | ||
33 | isChannelAvatarNull () { | 22 | isChannelAvatarNull () { |