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 --- .../my-account-history/my-account-history.component.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'client/src/app/+my-account/my-account-history/my-account-history.component.ts') diff --git a/client/src/app/+my-account/my-account-history/my-account-history.component.ts b/client/src/app/+my-account/my-account-history/my-account-history.component.ts index dc78b3d6e..3298c56c7 100644 --- a/client/src/app/+my-account/my-account-history/my-account-history.component.ts +++ b/client/src/app/+my-account/my-account-history/my-account-history.component.ts @@ -13,7 +13,6 @@ import { import { immutableAssign } from '@app/helpers' import { UserHistoryService } from '@app/shared/shared-main' import { AbstractVideoList } from '@app/shared/shared-video-miniature' -import { I18n } from '@ngx-translate/i18n-polyfill' @Component({ selector: 'my-account-history', @@ -30,7 +29,6 @@ export class MyAccountHistoryComponent extends AbstractVideoList implements OnIn videosHistoryEnabled: boolean constructor ( - protected i18n: I18n, protected router: Router, protected serverService: ServerService, protected route: ActivatedRoute, @@ -44,7 +42,7 @@ export class MyAccountHistoryComponent extends AbstractVideoList implements OnIn ) { super() - this.titlePage = this.i18n('My videos history') + this.titlePage = $localize`My videos history` } ngOnInit () { @@ -72,8 +70,8 @@ export class MyAccountHistoryComponent extends AbstractVideoList implements OnIn .subscribe( () => { const message = this.videosHistoryEnabled === true ? - this.i18n('Videos history is enabled') : - this.i18n('Videos history is disabled') + $localize`Videos history is enabled` : + $localize`Videos history is disabled` this.notifier.success(message) @@ -85,8 +83,8 @@ export class MyAccountHistoryComponent extends AbstractVideoList implements OnIn } async deleteHistory () { - const title = this.i18n('Delete videos history') - const message = this.i18n('Are you sure you want to delete all your videos history?') + const title = $localize`Delete videos history` + const message = $localize`Are you sure you want to delete all your videos history?` const res = await this.confirmService.confirm(message, title) if (res !== true) return @@ -94,7 +92,7 @@ export class MyAccountHistoryComponent extends AbstractVideoList implements OnIn this.userHistoryService.deleteUserVideosHistory() .subscribe( () => { - this.notifier.success(this.i18n('Videos history deleted')) + this.notifier.success($localize`Videos history deleted`) this.reloadVideos() }, -- cgit v1.2.3