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-moderation/abuse.service.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-moderation/abuse.service.ts')
-rw-r--r-- | client/src/app/shared/shared-moderation/abuse.service.ts | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/client/src/app/shared/shared-moderation/abuse.service.ts b/client/src/app/shared/shared-moderation/abuse.service.ts index 06b236d1e..bf98d4b36 100644 --- a/client/src/app/shared/shared-moderation/abuse.service.ts +++ b/client/src/app/shared/shared-moderation/abuse.service.ts | |||
@@ -5,7 +5,6 @@ import { catchError, map } from 'rxjs/operators' | |||
5 | import { HttpClient, HttpParams } from '@angular/common/http' | 5 | import { HttpClient, HttpParams } from '@angular/common/http' |
6 | import { Injectable } from '@angular/core' | 6 | import { Injectable } from '@angular/core' |
7 | import { RestExtractor, RestPagination, RestService } from '@app/core' | 7 | import { RestExtractor, RestPagination, RestService } from '@app/core' |
8 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
9 | import { | 8 | import { |
10 | AbuseCreate, | 9 | AbuseCreate, |
11 | AbuseFilter, | 10 | AbuseFilter, |
@@ -25,7 +24,6 @@ export class AbuseService { | |||
25 | private static BASE_MY_ABUSE_URL = environment.apiUrl + '/api/v1/users/me/abuses' | 24 | private static BASE_MY_ABUSE_URL = environment.apiUrl + '/api/v1/users/me/abuses' |
26 | 25 | ||
27 | constructor ( | 26 | constructor ( |
28 | private i18n: I18n, | ||
29 | private authHttp: HttpClient, | 27 | private authHttp: HttpClient, |
30 | private restService: RestService, | 28 | private restService: RestService, |
31 | private restExtractor: RestExtractor | 29 | private restExtractor: RestExtractor |
@@ -138,33 +136,33 @@ export class AbuseService { | |||
138 | let reasons: { id: AbusePredefinedReasonsString, label: string, description?: string, help?: string }[] = [ | 136 | let reasons: { id: AbusePredefinedReasonsString, label: string, description?: string, help?: string }[] = [ |
139 | { | 137 | { |
140 | id: 'violentOrRepulsive', | 138 | id: 'violentOrRepulsive', |
141 | label: this.i18n('Violent or repulsive'), | 139 | label: $localize`Violent or repulsive`, |
142 | help: this.i18n('Contains offensive, violent, or coarse language or iconography.') | 140 | help: $localize`Contains offensive, violent, or coarse language or iconography.` |
143 | }, | 141 | }, |
144 | { | 142 | { |
145 | id: 'hatefulOrAbusive', | 143 | id: 'hatefulOrAbusive', |
146 | label: this.i18n('Hateful or abusive'), | 144 | label: $localize`Hateful or abusive`, |
147 | help: this.i18n('Contains abusive, racist or sexist language or iconography.') | 145 | help: $localize`Contains abusive, racist or sexist language or iconography.` |
148 | }, | 146 | }, |
149 | { | 147 | { |
150 | id: 'spamOrMisleading', | 148 | id: 'spamOrMisleading', |
151 | label: this.i18n('Spam, ad or false news'), | 149 | label: $localize`Spam, ad or false news`, |
152 | help: this.i18n('Contains marketing, spam, purposefully deceitful news, or otherwise misleading thumbnail/text/tags. Please provide reputable sources to report hoaxes.') | 150 | help: $localize`Contains marketing, spam, purposefully deceitful news, or otherwise misleading thumbnail/text/tags. Please provide reputable sources to report hoaxes.` |
153 | }, | 151 | }, |
154 | { | 152 | { |
155 | id: 'privacy', | 153 | id: 'privacy', |
156 | label: this.i18n('Privacy breach or doxxing'), | 154 | label: $localize`Privacy breach or doxxing`, |
157 | help: this.i18n('Contains personal information that could be used to track, identify, contact or impersonate someone (e.g. name, address, phone number, email, or credit card details).') | 155 | help: $localize`Contains personal information that could be used to track, identify, contact or impersonate someone (e.g. name, address, phone number, email, or credit card details).` |
158 | }, | 156 | }, |
159 | { | 157 | { |
160 | id: 'rights', | 158 | id: 'rights', |
161 | label: this.i18n('Copyright'), | 159 | label: $localize`Copyright`, |
162 | help: this.i18n('Infringes your copyright wrt. the regional laws with which the server must comply.') | 160 | help: $localize`Infringes your copyright wrt. the regional laws with which the server must comply.` |
163 | }, | 161 | }, |
164 | { | 162 | { |
165 | id: 'serverRules', | 163 | id: 'serverRules', |
166 | label: this.i18n('Breaks server rules'), | 164 | label: $localize`Breaks server rules`, |
167 | description: this.i18n('Anything not included in the above that breaks the terms of service, code of conduct, or general rules in place on the server.') | 165 | description: $localize`Anything not included in the above that breaks the terms of service, code of conduct, or general rules in place on the server.` |
168 | } | 166 | } |
169 | ] | 167 | ] |
170 | 168 | ||
@@ -172,13 +170,13 @@ export class AbuseService { | |||
172 | reasons = reasons.concat([ | 170 | reasons = reasons.concat([ |
173 | { | 171 | { |
174 | id: 'thumbnails', | 172 | id: 'thumbnails', |
175 | label: this.i18n('Thumbnails'), | 173 | label: $localize`Thumbnails`, |
176 | help: this.i18n('The above can only be seen in thumbnails.') | 174 | help: $localize`The above can only be seen in thumbnails.` |
177 | }, | 175 | }, |
178 | { | 176 | { |
179 | id: 'captions', | 177 | id: 'captions', |
180 | label: this.i18n('Captions'), | 178 | label: $localize`Captions`, |
181 | help: this.i18n('The above can only be seen in captions (please describe which).') | 179 | help: $localize`The above can only be seen in captions (please describe which).` |
182 | } | 180 | } |
183 | ]) | 181 | ]) |
184 | } | 182 | } |