X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-instance%2Finstance-features-table.component.ts;h=e405c579082e896df107705ef9eabcd4f5d2451f;hb=eaa529528cafcfb291009f9f99d296c81e792899;hp=6335de450144f801204212f6e3ce8d48110e6994;hpb=e435cf44c00aba359bf0f265d06bff4841b3f7fe;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/shared-instance/instance-features-table.component.ts b/client/src/app/shared/shared-instance/instance-features-table.component.ts index 6335de450..e405c5790 100644 --- a/client/src/app/shared/shared-instance/instance-features-table.component.ts +++ b/client/src/app/shared/shared-instance/instance-features-table.component.ts @@ -1,5 +1,6 @@ import { Component, OnInit } from '@angular/core' import { ServerService } from '@app/core' +import { prepareIcu } from '@app/helpers' import { ServerConfig } from '@shared/models' import { PeertubeModalService } from '../shared-main/peertube-modal/peertube-modal.service' @@ -65,15 +66,20 @@ export class InstanceFeaturesTableComponent implements OnInit { private getApproximateTime (seconds: number) { const hours = Math.floor(seconds / 3600) - let pluralSuffix = '' - if (hours > 1) pluralSuffix = 's' - if (hours > 0) return `~ ${hours} hour${pluralSuffix}` - const minutes = Math.floor(seconds % 3600 / 60) + if (hours !== 0) { + return prepareIcu($localize`~ {hours, plural, =1 {1 hour} other {{hours} hours}}`)( + { hours }, + $localize`~ ${hours} hours` + ) + } - if (minutes === 1) return $localize`~ 1 minute` + const minutes = Math.floor(seconds % 3600 / 60) - return $localize`~ ${minutes} minutes` + return prepareIcu($localize`~ {minutes, plural, =1 {1 minute} other {{minutes} minutes}}`)( + { minutes }, + $localize`~ ${minutes} minutes` + ) } private buildQuotaHelpIndication () {