1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 17:59:37 +02:00

Simplify ICU in components

This commit is contained in:
Chocobozzz 2023-06-06 14:32:47 +02:00
parent 40346ead2b
commit 866c5f667d
No known key found for this signature in database
GPG key ID: 583A612D890159BE
22 changed files with 231 additions and 143 deletions

View file

@ -1,6 +1,6 @@
import { Component, OnInit } from '@angular/core'
import { ServerService } from '@app/core'
import { prepareIcu } from '@app/helpers'
import { formatICU } from '@app/helpers'
import { ServerConfig } from '@shared/models'
@Component({
@ -71,17 +71,17 @@ export class InstanceFeaturesTableComponent implements OnInit {
const hours = Math.floor(seconds / 3600)
if (hours !== 0) {
return prepareIcu($localize`~ {hours, plural, =1 {1 hour} other {{hours} hours}}`)(
{ hours },
$localize`~ ${hours} hours`
return formatICU(
$localize`~ {hours, plural, =1 {1 hour} other {{hours} hours}}`,
{ hours }
)
}
const minutes = Math.floor(seconds % 3600 / 60)
return prepareIcu($localize`~ {minutes, plural, =1 {1 minute} other {{minutes} minutes}}`)(
{ minutes },
$localize`~ ${minutes} minutes`
return formatICU(
$localize`~ {minutes, plural, =1 {1 minute} other {{minutes} minutes}}`,
{ minutes }
)
}