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-abuse-list/abuse-details.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/shared/shared-abuse-list/abuse-details.component.ts')
-rw-r--r-- | client/src/app/shared/shared-abuse-list/abuse-details.component.ts | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/client/src/app/shared/shared-abuse-list/abuse-details.component.ts b/client/src/app/shared/shared-abuse-list/abuse-details.component.ts index 0e872079a..282a6fe19 100644 --- a/client/src/app/shared/shared-abuse-list/abuse-details.component.ts +++ b/client/src/app/shared/shared-abuse-list/abuse-details.component.ts | |||
@@ -1,7 +1,6 @@ | |||
1 | import { Component, Input } from '@angular/core' | 1 | import { Component, Input } from '@angular/core' |
2 | import { durationToString } from '@app/helpers' | 2 | import { durationToString } from '@app/helpers' |
3 | import { Actor } from '@app/shared/shared-main' | 3 | import { Actor } from '@app/shared/shared-main' |
4 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
5 | import { AbusePredefinedReasonsString } from '@shared/models' | 4 | import { AbusePredefinedReasonsString } from '@shared/models' |
6 | import { ProcessedAbuse } from './processed-abuse.model' | 5 | import { ProcessedAbuse } from './processed-abuse.model' |
7 | 6 | ||
@@ -17,18 +16,16 @@ export class AbuseDetailsComponent { | |||
17 | 16 | ||
18 | private predefinedReasonsTranslations: { [key in AbusePredefinedReasonsString]: string } | 17 | private predefinedReasonsTranslations: { [key in AbusePredefinedReasonsString]: string } |
19 | 18 | ||
20 | constructor ( | 19 | constructor () { |
21 | private i18n: I18n | ||
22 | ) { | ||
23 | this.predefinedReasonsTranslations = { | 20 | this.predefinedReasonsTranslations = { |
24 | violentOrRepulsive: this.i18n('Violent or Repulsive'), | 21 | violentOrRepulsive: $localize`Violent or Repulsive`, |
25 | hatefulOrAbusive: this.i18n('Hateful or Abusive'), | 22 | hatefulOrAbusive: $localize`Hateful or Abusive`, |
26 | spamOrMisleading: this.i18n('Spam or Misleading'), | 23 | spamOrMisleading: $localize`Spam or Misleading`, |
27 | privacy: this.i18n('Privacy'), | 24 | privacy: $localize`Privacy`, |
28 | rights: this.i18n('Copyright'), | 25 | rights: $localize`Copyright`, |
29 | serverRules: this.i18n('Server rules'), | 26 | serverRules: $localize`Server rules`, |
30 | thumbnails: this.i18n('Thumbnails'), | 27 | thumbnails: $localize`Thumbnails`, |
31 | captions: this.i18n('Captions') | 28 | captions: $localize`Captions` |
32 | } | 29 | } |
33 | } | 30 | } |
34 | 31 | ||