mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-16 23:12:12 +00:00
Update localization strings to use string formatting
This commit is contained in:
parent
0fbdcf18c0
commit
7ef0083a71
7 changed files with 113 additions and 81 deletions
|
|
@ -182,8 +182,8 @@
|
|||
<string name="compose_player_style">Στυλ</string>
|
||||
<string name="compose_player_subs">Υπότιτλοι</string>
|
||||
<string name="compose_player_subtitles">Υπότιτλοι</string>
|
||||
<string name="compose_player_brightness_level">Φωτεινότητα %1$d%%</string>
|
||||
<string name="compose_player_volume_level">Ένταση ήχου %1$d%%</string>
|
||||
<string name="compose_player_brightness_level">Φωτεινότητα %1$s</string>
|
||||
<string name="compose_player_volume_level">Ένταση ήχου %1$s</string>
|
||||
<string name="compose_player_muted">Σε σίγαση</string>
|
||||
<string name="compose_player_downloaded">Κατέβηκε</string>
|
||||
<string name="compose_player_airs_prefix">Προβάλλεται</string>
|
||||
|
|
@ -1040,4 +1040,4 @@
|
|||
<string name="unit_bytes_kb">KB</string>
|
||||
<string name="unit_bytes_mb">MB</string>
|
||||
<string name="unit_bytes_gb">GB</string>
|
||||
</resources>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -300,8 +300,8 @@
|
|||
<string name="compose_player_style">Estilo</string>
|
||||
<string name="compose_player_subs">Subs</string>
|
||||
<string name="compose_player_subtitles">Subtítulos</string>
|
||||
<string name="compose_player_brightness_level">Brillo %1$d%%</string>
|
||||
<string name="compose_player_volume_level">Volumen %1$d%%</string>
|
||||
<string name="compose_player_brightness_level">Brillo %1$s</string>
|
||||
<string name="compose_player_volume_level">Volumen %1$s</string>
|
||||
<string name="compose_player_muted">Silenciado</string>
|
||||
<string name="compose_player_downloaded">Descargado</string>
|
||||
<string name="compose_player_airs_prefix">Se emite</string>
|
||||
|
|
|
|||
|
|
@ -182,8 +182,8 @@
|
|||
<string name="compose_player_style">Stile</string>
|
||||
<string name="compose_player_subs">Sub</string>
|
||||
<string name="compose_player_subtitles">Sottotitoli</string>
|
||||
<string name="compose_player_brightness_level">Luminosità %1$d%%</string>
|
||||
<string name="compose_player_volume_level">Volume %1$d%%</string>
|
||||
<string name="compose_player_brightness_level">Luminosità %1$s</string>
|
||||
<string name="compose_player_volume_level">Volume %1$s</string>
|
||||
<string name="compose_player_muted">Muto</string>
|
||||
<string name="compose_player_downloaded">Scaricato</string>
|
||||
<string name="compose_player_airs_prefix">In onda</string>
|
||||
|
|
|
|||
|
|
@ -182,8 +182,8 @@
|
|||
<string name="compose_player_style">Stil</string>
|
||||
<string name="compose_player_subs">Altyazı</string>
|
||||
<string name="compose_player_subtitles">Altyazılar</string>
|
||||
<string name="compose_player_brightness_level">Parlaklık %1$d%%</string>
|
||||
<string name="compose_player_volume_level">Ses %1$d%%</string>
|
||||
<string name="compose_player_brightness_level">Parlaklık %1$s</string>
|
||||
<string name="compose_player_volume_level">Ses %1$s</string>
|
||||
<string name="compose_player_muted">Sessizde</string>
|
||||
<string name="compose_player_downloaded">İndirildi</string>
|
||||
<string name="compose_player_airs_prefix">Yayınlanma</string>
|
||||
|
|
@ -1041,4 +1041,3 @@
|
|||
<string name="unit_bytes_mb">MB</string>
|
||||
<string name="unit_bytes_gb">GB</string>
|
||||
</resources>
|
||||
|
||||
|
|
|
|||
|
|
@ -300,8 +300,8 @@
|
|||
<string name="compose_player_style">Style</string>
|
||||
<string name="compose_player_subs">Subs</string>
|
||||
<string name="compose_player_subtitles">Subtitles</string>
|
||||
<string name="compose_player_brightness_level">Brightness %1$d%%</string>
|
||||
<string name="compose_player_volume_level">Volume %1$d%%</string>
|
||||
<string name="compose_player_brightness_level">Brightness %1$s</string>
|
||||
<string name="compose_player_volume_level">Volume %1$s</string>
|
||||
<string name="compose_player_muted">Muted</string>
|
||||
<string name="compose_player_downloaded">Downloaded</string>
|
||||
<string name="compose_player_airs_prefix">Airs</string>
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import androidx.compose.foundation.background
|
|||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.BoxWithConstraints
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.WindowInsets
|
||||
|
|
@ -288,7 +289,7 @@ internal fun PauseMetadataOverlay(
|
|||
horizontalSafePadding: Dp,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
Column(
|
||||
BoxWithConstraints(
|
||||
modifier = modifier
|
||||
.background(
|
||||
Brush.horizontalGradient(
|
||||
|
|
@ -298,80 +299,107 @@ internal fun PauseMetadataOverlay(
|
|||
Color.Transparent,
|
||||
),
|
||||
),
|
||||
)
|
||||
.padding(
|
||||
start = horizontalSafePadding + metrics.horizontalPadding,
|
||||
end = horizontalSafePadding + metrics.horizontalPadding,
|
||||
top = 40.dp,
|
||||
bottom = 120.dp,
|
||||
),
|
||||
verticalArrangement = Arrangement.Bottom,
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(Res.string.compose_player_youre_watching),
|
||||
style = MaterialTheme.nuvioTypeScale.bodyLg,
|
||||
color = Color(0xFFB8B8B8),
|
||||
)
|
||||
androidx.compose.foundation.layout.Spacer(modifier = Modifier.height(12.dp))
|
||||
|
||||
if (!logo.isNullOrBlank()) {
|
||||
AsyncImage(
|
||||
model = logo,
|
||||
contentDescription = title,
|
||||
contentScale = ContentScale.Fit,
|
||||
alignment = Alignment.BottomStart,
|
||||
modifier = Modifier.height(96.dp),
|
||||
)
|
||||
val compactHeight = maxHeight < 420.dp
|
||||
val veryCompactHeight = maxHeight < 340.dp
|
||||
val topPadding = if (compactHeight) 24.dp else 40.dp
|
||||
val bottomPadding = when {
|
||||
veryCompactHeight -> 24.dp
|
||||
compactHeight -> 40.dp
|
||||
else -> 120.dp
|
||||
}
|
||||
val logoHeight = when {
|
||||
veryCompactHeight -> 48.dp
|
||||
compactHeight -> 64.dp
|
||||
else -> 96.dp
|
||||
}
|
||||
val titleFontScale = if (compactHeight) 1.35f else 1.8f
|
||||
val descriptionStyle = if (compactHeight) {
|
||||
MaterialTheme.nuvioTypeScale.bodyMd.copy(lineHeight = 20.sp)
|
||||
} else {
|
||||
Text(
|
||||
text = title,
|
||||
style = MaterialTheme.nuvioTypeScale.displayMd.copy(
|
||||
fontSize = max(metrics.titleSize.value * 1.8f, 32f).sp,
|
||||
fontWeight = FontWeight.ExtraBold,
|
||||
MaterialTheme.nuvioTypeScale.bodyLg.copy(lineHeight = 24.sp)
|
||||
}
|
||||
val descriptionMaxLines = if (compactHeight) 2 else 3
|
||||
val descriptionWidthFraction = if (compactHeight) 0.82f else 0.62f
|
||||
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(
|
||||
start = horizontalSafePadding + metrics.horizontalPadding,
|
||||
end = horizontalSafePadding + metrics.horizontalPadding,
|
||||
top = topPadding,
|
||||
bottom = bottomPadding,
|
||||
),
|
||||
color = Color.White,
|
||||
maxLines = 2,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
)
|
||||
}
|
||||
|
||||
val episodeInfo = if (isEpisode && seasonNumber != null && episodeNumber != null) {
|
||||
stringResource(Res.string.compose_player_episode_code_full, seasonNumber, episodeNumber)
|
||||
} else {
|
||||
providerName
|
||||
}
|
||||
|
||||
Text(
|
||||
text = episodeInfo,
|
||||
style = MaterialTheme.nuvioTypeScale.bodyLg,
|
||||
color = Color(0xFFCCCCCC),
|
||||
modifier = Modifier.padding(top = 8.dp),
|
||||
)
|
||||
|
||||
if (!episodeTitle.isNullOrBlank()) {
|
||||
verticalArrangement = Arrangement.Bottom,
|
||||
) {
|
||||
Text(
|
||||
text = episodeTitle,
|
||||
style = MaterialTheme.nuvioTypeScale.titleLg,
|
||||
color = Color.White,
|
||||
maxLines = 2,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
modifier = Modifier.padding(top = 12.dp),
|
||||
text = stringResource(Res.string.compose_player_youre_watching),
|
||||
style = MaterialTheme.nuvioTypeScale.bodyLg,
|
||||
color = Color(0xFFB8B8B8),
|
||||
)
|
||||
}
|
||||
androidx.compose.foundation.layout.Spacer(modifier = Modifier.height(if (compactHeight) 8.dp else 12.dp))
|
||||
|
||||
if (!logo.isNullOrBlank()) {
|
||||
AsyncImage(
|
||||
model = logo,
|
||||
contentDescription = title,
|
||||
contentScale = ContentScale.Fit,
|
||||
alignment = Alignment.BottomStart,
|
||||
modifier = Modifier.height(logoHeight),
|
||||
)
|
||||
} else {
|
||||
Text(
|
||||
text = title,
|
||||
style = MaterialTheme.nuvioTypeScale.displayMd.copy(
|
||||
fontSize = max(metrics.titleSize.value * titleFontScale, 32f).sp,
|
||||
fontWeight = FontWeight.ExtraBold,
|
||||
),
|
||||
color = Color.White,
|
||||
maxLines = if (compactHeight) 1 else 2,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
)
|
||||
}
|
||||
|
||||
val episodeInfo = if (isEpisode && seasonNumber != null && episodeNumber != null) {
|
||||
stringResource(Res.string.compose_player_episode_code_full, seasonNumber, episodeNumber)
|
||||
} else {
|
||||
providerName
|
||||
}
|
||||
|
||||
if (!pauseDescription.isNullOrBlank()) {
|
||||
Text(
|
||||
text = pauseDescription,
|
||||
style = MaterialTheme.nuvioTypeScale.bodyLg.copy(lineHeight = 24.sp),
|
||||
color = Color(0xFFD6D6D6),
|
||||
softWrap = true,
|
||||
textAlign = TextAlign.Start,
|
||||
maxLines = 3,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
modifier = Modifier
|
||||
.padding(top = 16.dp)
|
||||
.fillMaxWidth(0.62f),
|
||||
text = episodeInfo,
|
||||
style = MaterialTheme.nuvioTypeScale.bodyLg,
|
||||
color = Color(0xFFCCCCCC),
|
||||
modifier = Modifier.padding(top = if (compactHeight) 6.dp else 8.dp),
|
||||
)
|
||||
|
||||
if (!episodeTitle.isNullOrBlank()) {
|
||||
Text(
|
||||
text = episodeTitle,
|
||||
style = MaterialTheme.nuvioTypeScale.titleLg,
|
||||
color = Color.White,
|
||||
maxLines = if (compactHeight) 1 else 2,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
modifier = Modifier.padding(top = if (compactHeight) 8.dp else 12.dp),
|
||||
)
|
||||
}
|
||||
|
||||
if (!pauseDescription.isNullOrBlank()) {
|
||||
Text(
|
||||
text = pauseDescription,
|
||||
style = descriptionStyle,
|
||||
color = Color(0xFFD6D6D6),
|
||||
softWrap = true,
|
||||
textAlign = TextAlign.Start,
|
||||
maxLines = descriptionMaxLines,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
modifier = Modifier
|
||||
.padding(top = if (compactHeight) 10.dp else 16.dp)
|
||||
.fillMaxWidth(descriptionWidthFraction),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.nuvio.app.features.player
|
||||
|
||||
import androidx.compose.animation.AnimatedVisibility
|
||||
import androidx.compose.animation.core.tween
|
||||
import androidx.compose.animation.fadeIn
|
||||
import androidx.compose.animation.fadeOut
|
||||
import androidx.compose.foundation.background
|
||||
|
|
@ -586,7 +587,7 @@ fun PlayerScreen(
|
|||
showGestureFeedback(
|
||||
GestureFeedbackState(
|
||||
messageRes = Res.string.compose_player_brightness_level,
|
||||
messageArgs = listOf(percentage),
|
||||
messageArgs = listOf("$percentage%"),
|
||||
icon = GestureFeedbackIcon.Brightness,
|
||||
),
|
||||
)
|
||||
|
|
@ -601,7 +602,7 @@ fun PlayerScreen(
|
|||
} else {
|
||||
Res.string.compose_player_volume_level
|
||||
},
|
||||
messageArgs = if (level.isMuted) emptyList() else listOf(percentage),
|
||||
messageArgs = if (level.isMuted) emptyList() else listOf("$percentage%"),
|
||||
icon = if (level.isMuted) GestureFeedbackIcon.VolumeMuted else GestureFeedbackIcon.Volume,
|
||||
isDanger = level.isMuted,
|
||||
),
|
||||
|
|
@ -1539,7 +1540,11 @@ fun PlayerScreen(
|
|||
},
|
||||
)
|
||||
|
||||
if (pausedOverlayVisible && !controlsVisible && !playerControlsLocked) {
|
||||
AnimatedVisibility(
|
||||
visible = pausedOverlayVisible && !controlsVisible && !playerControlsLocked,
|
||||
enter = fadeIn(animationSpec = tween(durationMillis = 220)),
|
||||
exit = fadeOut(animationSpec = tween(durationMillis = 180)),
|
||||
) {
|
||||
PauseMetadataOverlay(
|
||||
title = title,
|
||||
logo = logo,
|
||||
|
|
|
|||
Loading…
Reference in a new issue