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:
Bruno Deanoz 2026-06-21 18:33:41 +02:00
parent d468ec893f
commit cad445f87c
3 changed files with 16 additions and 13 deletions

View file

@ -318,7 +318,7 @@ fun ChatInput(
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))
val canSend = enabled && (value.isNotBlank() || pendingFiles.any { it.uploaded != null }) && pendingFiles.none { it.uploading }
SendButton(enabled = canSend, onClick = onSend)
@ -365,14 +365,14 @@ private fun PendingFileChip(pf: PendingFile, onRemove: () -> Unit) {
}
if (pf.error != null) {
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(
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,
) {
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))
}
}
}

View file

@ -21,6 +21,8 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
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.haptics.rememberHaptics
@ -66,14 +68,14 @@ private fun groupFor(m: KaizenModel): String = when {
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 filtered = if (q.isEmpty()) models
else models.filter { it.name?.lowercase()?.contains(q) == true || it.id.lowercase().contains(q) }
val groups = mutableListOf<ModelGroup>()
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)
filtered.groupBy { groupFor(it) }
@ -112,13 +114,14 @@ fun ModelSheet(
val accent = LocalKaizenAccent.current
val sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)
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) {
Column(Modifier.fillMaxWidth().padding(horizontal = 20.dp)) {
// --- Title ---
Text(
"Modell auswählen",
stringResource(R.string.model_sheet_title),
color = cs.onBackground,
fontSize = 18.sp,
fontWeight = FontWeight.Bold,
@ -145,7 +148,7 @@ fun ModelSheet(
Box(Modifier.weight(1f)) {
if (query.isEmpty()) {
Text(
"Modell suchen…",
stringResource(R.string.model_search_placeholder),
color = cs.onSurfaceVariant.copy(alpha = 0.5f),
fontSize = 14.sp
)
@ -165,7 +168,7 @@ fun ModelSheet(
if (query.isNotEmpty()) {
Icon(
Icons.Rounded.Close,
contentDescription = "Löschen",
contentDescription = stringResource(R.string.model_search_clear),
tint = cs.onSurfaceVariant.copy(alpha = 0.6f),
modifier = Modifier
.size(18.dp)
@ -180,7 +183,7 @@ fun ModelSheet(
if (groups.isEmpty()) {
item {
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,
fontSize = 14.sp,
modifier = Modifier.padding(vertical = 24.dp),
@ -292,7 +295,7 @@ private fun ModelRow(
) {
Icon(
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),
modifier = Modifier.size(20.dp),
)
@ -302,7 +305,7 @@ private fun ModelRow(
Spacer(Modifier.size(4.dp))
Icon(
Icons.Rounded.Check,
contentDescription = "Ausgewählt",
contentDescription = stringResource(R.string.model_selected),
tint = accent.primary,
modifier = Modifier.size(20.dp)
)

View file

@ -93,7 +93,7 @@ fun SettingsScreen(
modifier = Modifier.size(44.dp).clickable { onBack() },
) {
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))
}
}