From 68018040f2ec0a7c89ca5c8490b4b74d11cc07f7 Mon Sep 17 00:00:00 2001 From: kontrollanten <6680299+kontrollanten@users.noreply.github.com> Date: Fri, 29 Jan 2021 14:36:21 +0100 Subject: localize decimal separator in video miniatures (#3643) * fix(client): localize decimal separator * fix(client/numpipe): handle Intl failure gently * Revert "fix(client/numpipe): handle Intl failure gently" This reverts commit e275049f1fabb0a7af5a274ebfc33f9c3fb279ed. * client: switch from Intl to ng formatNumber --- .../app/shared/shared-video-miniature/video-download.component.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'client/src/app/shared/shared-video-miniature/video-download.component.ts') diff --git a/client/src/app/shared/shared-video-miniature/video-download.component.ts b/client/src/app/shared/shared-video-miniature/video-download.component.ts index 99838f712..70b27b105 100644 --- a/client/src/app/shared/shared-video-miniature/video-download.component.ts +++ b/client/src/app/shared/shared-video-miniature/video-download.component.ts @@ -1,5 +1,5 @@ import { mapValues, pick } from 'lodash-es' -import { Component, ElementRef, ViewChild } from '@angular/core' +import { Component, ElementRef, Inject, LOCALE_ID, ViewChild } from '@angular/core' import { AuthService, Notifier } from '@app/core' import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap' import { VideoCaption, VideoFile, VideoPrivacy } from '@shared/models' @@ -34,13 +34,14 @@ export class VideoDownloadComponent { private numbersPipe: NumberFormatterPipe constructor ( + @Inject(LOCALE_ID) private localeId: string, private notifier: Notifier, private modalService: NgbModal, private videoService: VideoService, private auth: AuthService ) { this.bytesPipe = new BytesPipe() - this.numbersPipe = new NumberFormatterPipe() + this.numbersPipe = new NumberFormatterPipe(this.localeId) } get typeText () { -- cgit v1.2.3