fix: replace all remaining hardcoded German strings with stringResource
ModelSheet, ChatComponents, SettingsScreen had hardcoded strings like "Ausgewählt", "Modell auswählen", "Zurück" etc. instead of using the existing string resources. Now all UI text uses stringResource(R.string.xxx) for proper de/en localization.
This commit is contained in:
parent
d468ec893f
commit
cad445f87c
3 changed files with 16 additions and 13 deletions
|
|
@ -318,7 +318,7 @@ fun ChatInput(
|
||||||
cursorBrush = SolidColor(accent.primary), maxLines = 6, modifier = Modifier.fillMaxWidth(),
|
cursorBrush = SolidColor(accent.primary), maxLines = 6, modifier = Modifier.fillMaxWidth(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
GhostIconButton(Icons.Rounded.Call, "Anruf")
|
GhostIconButton(Icons.Rounded.Call, stringResource(R.string.chat_call))
|
||||||
Spacer(Modifier.width(4.dp))
|
Spacer(Modifier.width(4.dp))
|
||||||
val canSend = enabled && (value.isNotBlank() || pendingFiles.any { it.uploaded != null }) && pendingFiles.none { it.uploading }
|
val canSend = enabled && (value.isNotBlank() || pendingFiles.any { it.uploaded != null }) && pendingFiles.none { it.uploading }
|
||||||
SendButton(enabled = canSend, onClick = onSend)
|
SendButton(enabled = canSend, onClick = onSend)
|
||||||
|
|
@ -365,14 +365,14 @@ private fun PendingFileChip(pf: PendingFile, onRemove: () -> Unit) {
|
||||||
}
|
}
|
||||||
if (pf.error != null) {
|
if (pf.error != null) {
|
||||||
Box(Modifier.fillMaxSize().background(Color(0xFFDC2626).copy(alpha = 0.3f)), contentAlignment = Alignment.Center) {
|
Box(Modifier.fillMaxSize().background(Color(0xFFDC2626).copy(alpha = 0.3f)), contentAlignment = Alignment.Center) {
|
||||||
Icon(Icons.Rounded.Close, "Fehler", tint = Color.White, modifier = Modifier.size(18.dp))
|
Icon(Icons.Rounded.Close, stringResource(R.string.chat_error), tint = Color.White, modifier = Modifier.size(18.dp))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Box(
|
Box(
|
||||||
Modifier.align(Alignment.TopEnd).padding(2.dp).size(18.dp).clip(KaizenShapes.circle).background(Color.Black.copy(alpha = 0.5f)).clickable(onClick = onRemove),
|
Modifier.align(Alignment.TopEnd).padding(2.dp).size(18.dp).clip(KaizenShapes.circle).background(Color.Black.copy(alpha = 0.5f)).clickable(onClick = onRemove),
|
||||||
contentAlignment = Alignment.Center,
|
contentAlignment = Alignment.Center,
|
||||||
) {
|
) {
|
||||||
Icon(Icons.Rounded.Close, "Entfernen", tint = Color.White, modifier = Modifier.size(12.dp))
|
Icon(Icons.Rounded.Close, stringResource(R.string.chat_remove), tint = Color.White, modifier = Modifier.size(12.dp))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,8 @@ import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import dev.kaizen.app.net.KaizenModel
|
import dev.kaizen.app.net.KaizenModel
|
||||||
|
import dev.kaizen.app.R
|
||||||
|
import androidx.compose.ui.res.stringResource
|
||||||
import dev.kaizen.app.ui.theme.LocalKaizenAccent
|
import dev.kaizen.app.ui.theme.LocalKaizenAccent
|
||||||
import dev.kaizen.app.haptics.rememberHaptics
|
import dev.kaizen.app.haptics.rememberHaptics
|
||||||
|
|
||||||
|
|
@ -66,14 +68,14 @@ private fun groupFor(m: KaizenModel): String = when {
|
||||||
else -> "OpenRouter"
|
else -> "OpenRouter"
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun buildGroups(models: List<KaizenModel>, favorites: Set<String>, query: String): List<ModelGroup> {
|
private fun buildGroups(models: List<KaizenModel>, favorites: Set<String>, query: String, favoritesLabel: String = "★ Favorites"): List<ModelGroup> {
|
||||||
val q = query.trim().lowercase()
|
val q = query.trim().lowercase()
|
||||||
val filtered = if (q.isEmpty()) models
|
val filtered = if (q.isEmpty()) models
|
||||||
else models.filter { it.name?.lowercase()?.contains(q) == true || it.id.lowercase().contains(q) }
|
else models.filter { it.name?.lowercase()?.contains(q) == true || it.id.lowercase().contains(q) }
|
||||||
|
|
||||||
val groups = mutableListOf<ModelGroup>()
|
val groups = mutableListOf<ModelGroup>()
|
||||||
val favs = filtered.filter { it.id in favorites }
|
val favs = filtered.filter { it.id in favorites }
|
||||||
if (favs.isNotEmpty()) groups += ModelGroup("★ Favoriten", favs)
|
if (favs.isNotEmpty()) groups += ModelGroup(favoritesLabel, favs)
|
||||||
|
|
||||||
// Group models, sorting group labels (Vertex first, then OpenRouter)
|
// Group models, sorting group labels (Vertex first, then OpenRouter)
|
||||||
filtered.groupBy { groupFor(it) }
|
filtered.groupBy { groupFor(it) }
|
||||||
|
|
@ -112,13 +114,14 @@ fun ModelSheet(
|
||||||
val accent = LocalKaizenAccent.current
|
val accent = LocalKaizenAccent.current
|
||||||
val sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)
|
val sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)
|
||||||
var query by remember { mutableStateOf("") }
|
var query by remember { mutableStateOf("") }
|
||||||
val groups = remember(models, favorites, query) { buildGroups(models, favorites, query) }
|
val favLabel = stringResource(R.string.model_favorites_group)
|
||||||
|
val groups = remember(models, favorites, query) { buildGroups(models, favorites, query, favLabel) }
|
||||||
|
|
||||||
ModalBottomSheet(onDismissRequest = onDismiss, sheetState = sheetState) {
|
ModalBottomSheet(onDismissRequest = onDismiss, sheetState = sheetState) {
|
||||||
Column(Modifier.fillMaxWidth().padding(horizontal = 20.dp)) {
|
Column(Modifier.fillMaxWidth().padding(horizontal = 20.dp)) {
|
||||||
// --- Title ---
|
// --- Title ---
|
||||||
Text(
|
Text(
|
||||||
"Modell auswählen",
|
stringResource(R.string.model_sheet_title),
|
||||||
color = cs.onBackground,
|
color = cs.onBackground,
|
||||||
fontSize = 18.sp,
|
fontSize = 18.sp,
|
||||||
fontWeight = FontWeight.Bold,
|
fontWeight = FontWeight.Bold,
|
||||||
|
|
@ -145,7 +148,7 @@ fun ModelSheet(
|
||||||
Box(Modifier.weight(1f)) {
|
Box(Modifier.weight(1f)) {
|
||||||
if (query.isEmpty()) {
|
if (query.isEmpty()) {
|
||||||
Text(
|
Text(
|
||||||
"Modell suchen…",
|
stringResource(R.string.model_search_placeholder),
|
||||||
color = cs.onSurfaceVariant.copy(alpha = 0.5f),
|
color = cs.onSurfaceVariant.copy(alpha = 0.5f),
|
||||||
fontSize = 14.sp
|
fontSize = 14.sp
|
||||||
)
|
)
|
||||||
|
|
@ -165,7 +168,7 @@ fun ModelSheet(
|
||||||
if (query.isNotEmpty()) {
|
if (query.isNotEmpty()) {
|
||||||
Icon(
|
Icon(
|
||||||
Icons.Rounded.Close,
|
Icons.Rounded.Close,
|
||||||
contentDescription = "Löschen",
|
contentDescription = stringResource(R.string.model_search_clear),
|
||||||
tint = cs.onSurfaceVariant.copy(alpha = 0.6f),
|
tint = cs.onSurfaceVariant.copy(alpha = 0.6f),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(18.dp)
|
.size(18.dp)
|
||||||
|
|
@ -180,7 +183,7 @@ fun ModelSheet(
|
||||||
if (groups.isEmpty()) {
|
if (groups.isEmpty()) {
|
||||||
item {
|
item {
|
||||||
Text(
|
Text(
|
||||||
if (models.isEmpty()) "Verbindung wird hergestellt..." else "Keine Treffer",
|
if (models.isEmpty()) stringResource(R.string.model_connecting) else stringResource(R.string.model_no_results),
|
||||||
color = cs.onSurfaceVariant,
|
color = cs.onSurfaceVariant,
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
modifier = Modifier.padding(vertical = 24.dp),
|
modifier = Modifier.padding(vertical = 24.dp),
|
||||||
|
|
@ -292,7 +295,7 @@ private fun ModelRow(
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = if (favorite) Icons.Rounded.Star else Icons.Rounded.StarBorder,
|
imageVector = if (favorite) Icons.Rounded.Star else Icons.Rounded.StarBorder,
|
||||||
contentDescription = "Favorit",
|
contentDescription = stringResource(R.string.model_favorite),
|
||||||
tint = if (favorite) accent.primary else cs.onSurfaceVariant.copy(alpha = 0.35f),
|
tint = if (favorite) accent.primary else cs.onSurfaceVariant.copy(alpha = 0.35f),
|
||||||
modifier = Modifier.size(20.dp),
|
modifier = Modifier.size(20.dp),
|
||||||
)
|
)
|
||||||
|
|
@ -302,7 +305,7 @@ private fun ModelRow(
|
||||||
Spacer(Modifier.size(4.dp))
|
Spacer(Modifier.size(4.dp))
|
||||||
Icon(
|
Icon(
|
||||||
Icons.Rounded.Check,
|
Icons.Rounded.Check,
|
||||||
contentDescription = "Ausgewählt",
|
contentDescription = stringResource(R.string.model_selected),
|
||||||
tint = accent.primary,
|
tint = accent.primary,
|
||||||
modifier = Modifier.size(20.dp)
|
modifier = Modifier.size(20.dp)
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ fun SettingsScreen(
|
||||||
modifier = Modifier.size(44.dp).clickable { onBack() },
|
modifier = Modifier.size(44.dp).clickable { onBack() },
|
||||||
) {
|
) {
|
||||||
Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
|
Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
|
||||||
Icon(Icons.AutoMirrored.Rounded.ArrowBack, "Zurück", tint = cs.onBackground, modifier = Modifier.size(20.dp))
|
Icon(Icons.AutoMirrored.Rounded.ArrowBack, stringResource(R.string.settings_back), tint = cs.onBackground, modifier = Modifier.size(20.dp))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue