fix: ui translation keys

This commit is contained in:
rhunk
2023-09-03 12:59:53 +02:00
parent 721ff6927e
commit 2b682d18f8
2 changed files with 33 additions and 21 deletions

View File

@@ -58,8 +58,7 @@ class ScopeContent(
@Composable
fun Content() {
Column(
modifier = Modifier
.verticalScroll(rememberScrollState())
modifier = Modifier.verticalScroll(rememberScrollState())
) {
when (scope) {
SocialScope.FRIEND -> Friend()
@@ -92,10 +91,12 @@ class ScopeContent(
maxLines = 1,
modifier = Modifier.weight(1f)
)
Switch(checked = ruleEnabled, enabled = if (ruleType.listMode) ruleState != null else true, onCheckedChange = {
context.modDatabase.setRule(id, ruleType.key, it)
ruleEnabled = it
})
Switch(checked = ruleEnabled,
enabled = if (ruleType.listMode) ruleState != null else true,
onCheckedChange = {
context.modDatabase.setRule(id, ruleType.key, it)
ruleEnabled = it
})
}
}
}
@@ -180,9 +181,7 @@ class ScopeContent(
horizontalAlignment = Alignment.CenterHorizontally
) {
val bitmojiUrl = BitmojiSelfie.getBitmojiSelfie(
friend.selfieId,
friend.bitmojiId,
BitmojiSelfie.BitmojiSelfieType.THREE_D
friend.selfieId, friend.bitmojiId, BitmojiSelfie.BitmojiSelfieType.THREE_D
)
BitmojiImage(context = context, url = bitmojiUrl, size = 100)
Spacer(modifier = Modifier.height(16.dp))
@@ -214,13 +213,26 @@ class ScopeContent(
Column(
modifier = Modifier.weight(1f),
) {
Text(text = translation.format("streaks_length_text", "count" to streaks.length.toString()), maxLines = 1)
Text(text = translation.format("streaks_expiration_text", "eta" to computeStreakETA(streaks.expirationTimestamp)), maxLines = 1)
Text(
text = translation.format(
"streaks_length_text", "length" to streaks.length.toString()
), maxLines = 1
)
Text(
text = translation.format(
"streaks_expiration_text",
"eta" to computeStreakETA(streaks.expirationTimestamp)
), maxLines = 1
)
}
Row(
verticalAlignment = Alignment.CenterVertically
) {
Text(text = translation["reminder_button"], maxLines = 1, modifier = Modifier.padding(end = 10.dp))
Text(
text = translation["reminder_button"],
maxLines = 1,
modifier = Modifier.padding(end = 10.dp)
)
Switch(checked = shouldNotify, onCheckedChange = {
context.modDatabase.setFriendStreaksNotify(id, it)
shouldNotify = it
@@ -248,17 +260,13 @@ class ScopeContent(
horizontalAlignment = Alignment.CenterHorizontally
) {
Text(
text = group.name,
maxLines = 1,
fontSize = 20.sp,
fontWeight = FontWeight.Bold
text = group.name, maxLines = 1, fontSize = 20.sp, fontWeight = FontWeight.Bold
)
Spacer(modifier = Modifier.height(5.dp))
Text(
text = translation.format("participants_text", "count" to group.participantsCount.toString()),
maxLines = 1,
fontSize = 12.sp,
fontWeight = FontWeight.Light
text = translation.format(
"participants_text", "count" to group.participantsCount.toString()
), maxLines = 1, fontSize = 12.sp, fontWeight = FontWeight.Light
)
}
}

View File

@@ -219,7 +219,11 @@ class SocialSection : Section() {
MaterialTheme.colorScheme.error
else MaterialTheme.colorScheme.primary
)
Text(text = context.translation.format("context.sections.social.streaks_expiration_short", "hours" to streaks.length.toString()), maxLines = 1, fontWeight = FontWeight.Bold)
Text(
text = context.translation.format("manager.sections.social.streaks_expiration_short", "hours" to ((streaks.expirationTimestamp - System.currentTimeMillis()) / 3600000).toInt().toString()),
maxLines = 1,
fontWeight = FontWeight.Bold
)
}
}
}