From 66357162f8e1227495f09bd4f68446aad7071c6d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 12 Aug 2020 10:40:04 +0200 Subject: 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 --- client/src/app/+search/search.component.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'client/src/app/+search/search.component.ts') 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' import { AdvancedSearch, SearchService } from '@app/shared/shared-search' import { MiniatureDisplayOptions, VideoLinkType } from '@app/shared/shared-video-miniature' import { MetaService } from '@ngx-meta/core' -import { I18n } from '@ngx-translate/i18n-polyfill' import { SearchTargetType, ServerConfig } from '@shared/models' @Component({ @@ -52,7 +51,6 @@ export class SearchComponent implements OnInit, OnDestroy { private lastSearchTarget: SearchTargetType constructor ( - private i18n: I18n, private route: ActivatedRoute, private router: Router, private metaService: MetaService, @@ -170,8 +168,8 @@ export class SearchComponent implements OnInit, OnDestroy { } this.notifier.error( - this.i18n('Search index is unavailable. Retrying with instance results instead.'), - this.i18n('Search error') + $localize`Search index is unavailable. Retrying with instance results instead.`, + $localize`Search error` ) this.advancedSearch.searchTarget = 'local' this.search() @@ -229,7 +227,7 @@ export class SearchComponent implements OnInit, OnDestroy { private updateTitle () { const suffix = this.currentSearch ? ' ' + this.currentSearch : '' - this.metaService.setTitle(this.i18n('Search') + suffix) + this.metaService.setTitle($localize`Search` + suffix) } private updateUrlFromAdvancedSearch () { -- cgit v1.2.3