diff --git a/android_app/app/src/main/java/com/health/openscale/ui/screen/dialog/ColorPickerDialog.kt b/android_app/app/src/main/java/com/health/openscale/ui/screen/dialog/ColorPickerDialog.kt index 6c43ee50..863755c8 100644 --- a/android_app/app/src/main/java/com/health/openscale/ui/screen/dialog/ColorPickerDialog.kt +++ b/android_app/app/src/main/java/com/health/openscale/ui/screen/dialog/ColorPickerDialog.kt @@ -41,8 +41,10 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.compose.ui.window.Dialog +import com.health.openscale.R val tangoColors = listOf( Color(0xFFEF2929), Color(0xFFF57900), Color(0xFFFFCE44), Color(0xFF8AE234), @@ -70,7 +72,7 @@ fun ColorPickerDialog( .fillMaxWidth() ) { Column(modifier = Modifier.padding(16.dp)) { - Text("Farbe auswählen", style = MaterialTheme.typography.titleMedium) + Text(stringResource(R.string.dialog_title_select_color), style = MaterialTheme.typography.titleMedium) Spacer(modifier = Modifier.height(16.dp)) LazyVerticalGrid( @@ -108,7 +110,7 @@ fun ColorPickerDialog( horizontalArrangement = Arrangement.End ) { TextButton(onClick = onDismiss) { - Text("Abbrechen") + Text(stringResource(R.string.cancel_button)) } } } diff --git a/android_app/app/src/main/java/com/health/openscale/ui/screen/dialog/DateInputDialog.kt b/android_app/app/src/main/java/com/health/openscale/ui/screen/dialog/DateInputDialog.kt index 32862118..8441bc84 100644 --- a/android_app/app/src/main/java/com/health/openscale/ui/screen/dialog/DateInputDialog.kt +++ b/android_app/app/src/main/java/com/health/openscale/ui/screen/dialog/DateInputDialog.kt @@ -38,7 +38,9 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp +import com.health.openscale.R @OptIn(ExperimentalMaterial3Api::class) @Composable @@ -66,12 +68,12 @@ fun DateInputDialog( } } ) { - Text("OK") + Text(stringResource(R.string.dialog_ok)) } }, dismissButton = { TextButton(onClick = onDismiss) { - Text("Abbrechen") + Text(stringResource(R.string.cancel_button)) } }, title = { diff --git a/android_app/app/src/main/java/com/health/openscale/ui/screen/dialog/IconPickerDialog.kt b/android_app/app/src/main/java/com/health/openscale/ui/screen/dialog/IconPickerDialog.kt index 8b78adde..84c2bc83 100644 --- a/android_app/app/src/main/java/com/health/openscale/ui/screen/dialog/IconPickerDialog.kt +++ b/android_app/app/src/main/java/com/health/openscale/ui/screen/dialog/IconPickerDialog.kt @@ -35,6 +35,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.health.openscale.R @@ -83,7 +84,7 @@ fun IconPickerDialog( AlertDialog( onDismissRequest = onDismiss, - title = { Text("Icon auswählen") }, + title = { Text(stringResource(R.string.dialog_title_select_icon))}, text = { LazyVerticalGrid( columns = GridCells.Fixed(4), @@ -109,7 +110,7 @@ fun IconPickerDialog( } }, confirmButton = { - TextButton(onClick = onDismiss) { Text("Abbrechen") } + TextButton(onClick = onDismiss) { Text(stringResource(R.string.cancel_button)) } } ) } diff --git a/android_app/app/src/main/java/com/health/openscale/ui/screen/dialog/NumberInputDialog.kt b/android_app/app/src/main/java/com/health/openscale/ui/screen/dialog/NumberInputDialog.kt index a173d377..feea3c8f 100644 --- a/android_app/app/src/main/java/com/health/openscale/ui/screen/dialog/NumberInputDialog.kt +++ b/android_app/app/src/main/java/com/health/openscale/ui/screen/dialog/NumberInputDialog.kt @@ -46,8 +46,10 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.unit.dp +import com.health.openscale.R import com.health.openscale.core.data.InputFieldType @Composable @@ -69,12 +71,12 @@ fun NumberInputDialog( onConfirm(value) onDismiss() }) { - Text("OK") + Text(stringResource(R.string.dialog_ok)) } }, dismissButton = { TextButton(onClick = onDismiss) { - Text("Abbrechen") + Text(stringResource(R.string.cancel_button)) } }, title = { @@ -101,7 +103,7 @@ fun NumberInputDialog( OutlinedTextField( value = value, onValueChange = { value = it }, - label = { Text("Wert eingeben") }, + label = { Text(stringResource(R.string.dialog_title_input_value)) }, keyboardOptions = KeyboardOptions.Default.copy( keyboardType = when (inputType) { InputFieldType.FLOAT -> KeyboardType.Decimal @@ -114,7 +116,7 @@ fun NumberInputDialog( Column { Icon( imageVector = Icons.Default.KeyboardArrowUp, - contentDescription = "Erhöhen", + contentDescription = stringResource(R.string.trend_increased_desc), modifier = Modifier .size(24.dp) .clickable { @@ -123,7 +125,7 @@ fun NumberInputDialog( ) Icon( imageVector = Icons.Default.KeyboardArrowDown, - contentDescription = "Verringern", + contentDescription = stringResource(R.string.trend_decreased_desc), modifier = Modifier .size(24.dp) .clickable { diff --git a/android_app/app/src/main/java/com/health/openscale/ui/screen/dialog/TextInputDialog.kt b/android_app/app/src/main/java/com/health/openscale/ui/screen/dialog/TextInputDialog.kt index 3f87f44c..ea7b9c45 100644 --- a/android_app/app/src/main/java/com/health/openscale/ui/screen/dialog/TextInputDialog.kt +++ b/android_app/app/src/main/java/com/health/openscale/ui/screen/dialog/TextInputDialog.kt @@ -41,7 +41,9 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp +import com.health.openscale.R @Composable fun TextInputDialog( @@ -60,10 +62,10 @@ fun TextInputDialog( TextButton(onClick = { onConfirm(value) onDismiss() - }) { Text("OK") } + }) { Text(stringResource(R.string.dialog_ok)) } }, dismissButton = { - TextButton(onClick = onDismiss) { Text("Abbrechen") } + TextButton(onClick = onDismiss) { Text(stringResource(R.string.cancel_button)) } }, title = { Row(verticalAlignment = Alignment.CenterVertically) { @@ -89,7 +91,7 @@ fun TextInputDialog( OutlinedTextField( value = value, onValueChange = { value = it }, - label = { Text("Text eingeben") }, + label = { Text(stringResource(R.string.dialog_title_input_text)) }, singleLine = true, modifier = Modifier.fillMaxWidth() ) diff --git a/android_app/app/src/main/java/com/health/openscale/ui/screen/dialog/TimeInputDialog.kt b/android_app/app/src/main/java/com/health/openscale/ui/screen/dialog/TimeInputDialog.kt index 337904ae..75dbb700 100644 --- a/android_app/app/src/main/java/com/health/openscale/ui/screen/dialog/TimeInputDialog.kt +++ b/android_app/app/src/main/java/com/health/openscale/ui/screen/dialog/TimeInputDialog.kt @@ -47,9 +47,11 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp +import com.health.openscale.R import java.util.Calendar @Composable @@ -78,12 +80,12 @@ fun TimeInputDialog( onConfirm(updatedCal.timeInMillis) onDismiss() }) { - Text("OK") + Text(stringResource(R.string.dialog_ok)) } }, dismissButton = { TextButton(onClick = onDismiss) { - Text("Abbrechen") + Text(stringResource(R.string.cancel_button)) } }, title = { @@ -112,14 +114,14 @@ fun TimeInputDialog( horizontalArrangement = Arrangement.spacedBy(16.dp) ) { TimeField( - label = "Stunde", + label = stringResource(R.string.dialog_title_hour), value = hour, onValueChange = { hour = it.coerceIn(0, 23) }, onIncrement = { hour = (hour + 1) % 24 }, onDecrement = { hour = (hour + 23) % 24 } ) TimeField( - label = "Minute", + label = stringResource(R.string.dialog_title_minute), value = minute, onValueChange = { minute = it.coerceIn(0, 59) }, onIncrement = { minute = (minute + 1) % 60 }, @@ -154,10 +156,10 @@ private fun TimeField( Row { IconButton(onClick = onIncrement) { - Icon(Icons.Default.KeyboardArrowUp, contentDescription = "Stunde erhöhen") + Icon(Icons.Default.KeyboardArrowUp, contentDescription = stringResource(R.string.trend_increased_desc)) } IconButton(onClick = onDecrement) { - Icon(Icons.Default.KeyboardArrowDown, contentDescription = "Stunde verringern") + Icon(Icons.Default.KeyboardArrowDown, contentDescription = stringResource(R.string.trend_decreased_desc)) } } } diff --git a/android_app/app/src/main/res/values-de/strings.xml b/android_app/app/src/main/res/values-de/strings.xml index c43299d4..e15af571 100644 --- a/android_app/app/src/main/res/values-de/strings.xml +++ b/android_app/app/src/main/res/values-de/strings.xml @@ -87,6 +87,12 @@ %1$s bearbeiten %1$s ändern %1$s ändern + Farbe auswählen + Symbol auswählen + Wert eingeben + Text eingeben + Stunde + Minute Datum Uhrzeit diff --git a/android_app/app/src/main/res/values/strings.xml b/android_app/app/src/main/res/values/strings.xml index ed6a4d55..b97c08e2 100644 --- a/android_app/app/src/main/res/values/strings.xml +++ b/android_app/app/src/main/res/values/strings.xml @@ -88,6 +88,13 @@ Edit %1$s Change %1$s Change %1$s + Select color + Select icon + Input value + Input text + Hour + Minute + Date Time