mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-29 11:10:35 +02:00
Translate new dialog strings
This commit is contained in:
@@ -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))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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 = {
|
||||
|
@@ -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)) }
|
||||
}
|
||||
)
|
||||
}
|
||||
|
@@ -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 {
|
||||
|
@@ -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()
|
||||
)
|
||||
|
@@ -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))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -87,6 +87,12 @@
|
||||
<string name="dialog_title_edit_value">%1$s bearbeiten</string> <!-- Beispiel: "Gewicht bearbeiten" -->
|
||||
<string name="dialog_title_change_date">%1$s ändern</string> <!-- Beispiel: "Datum ändern" oder "Messdatum ändern" -->
|
||||
<string name="dialog_title_change_time">%1$s ändern</string> <!-- Beispiel: "Zeit ändern" oder "Messzeit ändern" -->
|
||||
<string name="dialog_title_select_color">Farbe auswählen</string>
|
||||
<string name="dialog_title_select_icon">Symbol auswählen</string>
|
||||
<string name="dialog_title_input_value">Wert eingeben</string>
|
||||
<string name="dialog_title_input_text">Text eingeben</string>
|
||||
<string name="dialog_title_hour">Stunde</string>
|
||||
<string name="dialog_title_minute">Minute</string>
|
||||
<string name="label_date">Datum</string>
|
||||
<string name="label_time">Uhrzeit</string>
|
||||
|
||||
|
@@ -88,6 +88,13 @@
|
||||
<string name="dialog_title_edit_value">Edit %1$s</string> <!-- Example: "Edit Weight" -->
|
||||
<string name="dialog_title_change_date">Change %1$s</string> <!-- Example: "Change Date" or "Change Measurement Date" -->
|
||||
<string name="dialog_title_change_time">Change %1$s</string> <!-- Example: "Change Time" or "Change Measurement Time" -->
|
||||
<string name="dialog_title_select_color">Select color</string>
|
||||
<string name="dialog_title_select_icon">Select icon</string>
|
||||
<string name="dialog_title_input_value">Input value</string>
|
||||
<string name="dialog_title_input_text">Input text</string>
|
||||
<string name="dialog_title_hour">Hour</string>
|
||||
<string name="dialog_title_minute">Minute</string>
|
||||
|
||||
<string name="label_date">Date</string>
|
||||
<string name="label_time">Time</string>
|
||||
|
||||
|
Reference in New Issue
Block a user