Translate more strings in player stats

pull/5271/head
Ewout van Mansom 2022-09-14 18:27:50 +02:00 committed by Chocobozzz
parent e1eada8bae
commit 192edf169c
1 changed files with 6 additions and 4 deletions

View File

@ -260,12 +260,13 @@ class StatsCard extends Component {
const vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0)
const vh = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0)
const pr = (window.devicePixelRatio || 1).toFixed(2)
const frames = `${vw}x${vh}*${pr} / ${videoQuality.droppedVideoFrames} dropped of ${videoQuality.totalVideoFrames}`
const vp = `${vw}x${vh}*${pr}`
const { droppedVideoFrames, totalVideoFrames } = videoQuality
const frames = player.localize('{1} / {2} dropped of {3}', [ vp, droppedVideoFrames + '', totalVideoFrames + '' ])
const duration = player.duration()
let volume = `${Math.round(player.volume() * 100)}`
if (player.muted()) volume += ' (muted)'
if (player.muted()) volume += player.localize(' (muted)')
const networkActivity = playerNetworkInfo.downloadSpeed
? `${playerNetworkInfo.downloadSpeed} ⇓ / ${playerNetworkInfo.uploadSpeed} ⇑`
@ -274,8 +275,9 @@ class StatsCard extends Component {
const totalTransferred = playerNetworkInfo.totalDownloaded
? `${playerNetworkInfo.totalDownloaded} ⇓ / ${playerNetworkInfo.totalUploaded} ⇑`
: undefined
const { downloadedFromServer, downloadedFromPeers } = playerNetworkInfo
const downloadBreakdown = playerNetworkInfo.downloadedFromServer
? `${playerNetworkInfo.downloadedFromServer} from servers · ${playerNetworkInfo.downloadedFromPeers} from peers`
? player.localize('{1} from servers · {2} from peers', [ downloadedFromServer, downloadedFromPeers ])
: undefined
const bufferProgress = progress !== undefined