aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+search/search.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-08-12 10:40:04 +0200
committerChocobozzz <me@florianbigard.com>2020-08-14 10:28:30 +0200
commit66357162f8e1227495f09bd4f68446aad7071c6d (patch)
tree7d4429506deb512b2fe1d0267f38a28cda20af55 /client/src/app/+search/search.component.ts
parent8c360747995e17eb5520e22fc3d7bd4c3d26eeee (diff)
downloadPeerTube-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/+search/search.component.ts')
-rw-r--r--client/src/app/+search/search.component.ts8
1 files changed, 3 insertions, 5 deletions
diff --git a/client/src/app/+search/search.component.ts b/client/src/app/+search/search.component.ts
index 70116fab3..2be952e16 100644
--- a/client/src/app/+search/search.component.ts
+++ b/client/src/app/+search/search.component.ts
@@ -7,7 +7,6 @@ import { Video, VideoChannel } from '@app/shared/shared-main'
7import { AdvancedSearch, SearchService } from '@app/shared/shared-search' 7import { AdvancedSearch, SearchService } from '@app/shared/shared-search'
8import { MiniatureDisplayOptions, VideoLinkType } from '@app/shared/shared-video-miniature' 8import { MiniatureDisplayOptions, VideoLinkType } from '@app/shared/shared-video-miniature'
9import { MetaService } from '@ngx-meta/core' 9import { MetaService } from '@ngx-meta/core'
10import { I18n } from '@ngx-translate/i18n-polyfill'
11import { SearchTargetType, ServerConfig } from '@shared/models' 10import { SearchTargetType, ServerConfig } from '@shared/models'
12 11
13@Component({ 12@Component({
@@ -52,7 +51,6 @@ export class SearchComponent implements OnInit, OnDestroy {
52 private lastSearchTarget: SearchTargetType 51 private lastSearchTarget: SearchTargetType
53 52
54 constructor ( 53 constructor (
55 private i18n: I18n,
56 private route: ActivatedRoute, 54 private route: ActivatedRoute,
57 private router: Router, 55 private router: Router,
58 private metaService: MetaService, 56 private metaService: MetaService,
@@ -170,8 +168,8 @@ export class SearchComponent implements OnInit, OnDestroy {
170 } 168 }
171 169
172 this.notifier.error( 170 this.notifier.error(
173 this.i18n('Search index is unavailable. Retrying with instance results instead.'), 171 $localize`Search index is unavailable. Retrying with instance results instead.`,
174 this.i18n('Search error') 172 $localize`Search error`
175 ) 173 )
176 this.advancedSearch.searchTarget = 'local' 174 this.advancedSearch.searchTarget = 'local'
177 this.search() 175 this.search()
@@ -229,7 +227,7 @@ export class SearchComponent implements OnInit, OnDestroy {
229 227
230 private updateTitle () { 228 private updateTitle () {
231 const suffix = this.currentSearch ? ' ' + this.currentSearch : '' 229 const suffix = this.currentSearch ? ' ' + this.currentSearch : ''
232 this.metaService.setTitle(this.i18n('Search') + suffix) 230 this.metaService.setTitle($localize`Search` + suffix)
233 } 231 }
234 232
235 private updateUrlFromAdvancedSearch () { 233 private updateUrlFromAdvancedSearch () {