From b1d40cff89f7cff565a98cdbcea9a624196a169a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 4 Jun 2018 16:21:17 +0200 Subject: Add i18n attributes --- .../following-list/following-list.component.html | 8 ++++---- .../follows/following-list/following-list.component.ts | 18 +++++++++++++----- 2 files changed, 17 insertions(+), 9 deletions(-) (limited to 'client/src/app/+admin/follows/following-list') diff --git a/client/src/app/+admin/follows/following-list/following-list.component.html b/client/src/app/+admin/follows/following-list/following-list.component.html index 24981d3e9..e4a45e88c 100644 --- a/client/src/app/+admin/follows/following-list/following-list.component.html +++ b/client/src/app/+admin/follows/following-list/following-list.component.html @@ -4,10 +4,10 @@ > - ID - Host - State - Created + ID + Host + State + Created diff --git a/client/src/app/+admin/follows/following-list/following-list.component.ts b/client/src/app/+admin/follows/following-list/following-list.component.ts index 873a5d965..2fb818c90 100644 --- a/client/src/app/+admin/follows/following-list/following-list.component.ts +++ b/client/src/app/+admin/follows/following-list/following-list.component.ts @@ -5,6 +5,7 @@ import { AccountFollow } from '../../../../../../shared/models/actors/follow.mod import { ConfirmService } from '../../../core/confirm/confirm.service' import { RestPagination, RestTable } from '../../../shared' import { FollowService } from '../shared' +import { I18n } from '@ngx-translate/i18n-polyfill' @Component({ selector: 'my-followers-list', @@ -20,7 +21,8 @@ export class FollowingListComponent extends RestTable implements OnInit { constructor ( private notificationsService: NotificationsService, private confirmService: ConfirmService, - private followService: FollowService + private followService: FollowService, + private i18n: I18n ) { super() } @@ -30,16 +32,22 @@ export class FollowingListComponent extends RestTable implements OnInit { } async removeFollowing (follow: AccountFollow) { - const res = await this.confirmService.confirm(`Do you really want to unfollow ${follow.following.host}?`, 'Unfollow') + const res = await this.confirmService.confirm( + this.i18n('Do you really want to unfollow {{ host }}?', { host: follow.following.host }), + this.i18n('Unfollow') + ) if (res === false) return this.followService.unfollow(follow).subscribe( () => { - this.notificationsService.success('Success', `You are not following ${follow.following.host} anymore.`) + this.notificationsService.success( + this.i18n('Success'), + this.i18n('You are not following {{ host }} anymore.', { host: follow.following.host }) + ) this.loadData() }, - err => this.notificationsService.error('Error', err.message) + err => this.notificationsService.error(this.i18n('Error'), err.message) ) } @@ -51,7 +59,7 @@ export class FollowingListComponent extends RestTable implements OnInit { this.totalRecords = resultList.total }, - err => this.notificationsService.error('Error', err.message) + err => this.notificationsService.error(this.i18n('Error'), err.message) ) } } -- cgit v1.2.3