diff --git a/app/src/main/java/app/myzel394/locationtest/ui/components/AudioRecorder/atoms/ConfirmDeletionDialog.kt b/app/src/main/java/app/myzel394/locationtest/ui/components/AudioRecorder/atoms/ConfirmDeletionDialog.kt index d7f4c1e..616fcc6 100644 --- a/app/src/main/java/app/myzel394/locationtest/ui/components/AudioRecorder/atoms/ConfirmDeletionDialog.kt +++ b/app/src/main/java/app/myzel394/locationtest/ui/components/AudioRecorder/atoms/ConfirmDeletionDialog.kt @@ -13,8 +13,10 @@ import androidx.compose.material3.Icon import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource import androidx.compose.ui.semantics.contentDescription import androidx.compose.ui.semantics.semantics +import app.myzel394.locationtest.R import app.myzel394.locationtest.services.RecorderService @Composable @@ -27,10 +29,10 @@ fun ConfirmDeletionDialog( onDismiss() }, title = { - Text("Delete Recording?") + Text(stringResource(R.string.ui_audioRecorder_action_delete_confirm_title)) }, text = { - Text("Are you sure you want to delete this recording?") + Text(stringResource(R.string.ui_audioRecorder_action_delete_confirm_message)) }, icon = { Icon( @@ -39,10 +41,11 @@ fun ConfirmDeletionDialog( ) }, confirmButton = { + val label = stringResource(R.string.ui_audioRecorder_action_delete_label) Button( modifier = Modifier .semantics { - contentDescription = "Confirm Recording Deletion" + contentDescription = label }, onClick = { onConfirm() @@ -54,14 +57,15 @@ fun ConfirmDeletionDialog( modifier = Modifier.size(ButtonDefaults.IconSize), ) Spacer(modifier = Modifier.width(ButtonDefaults.IconSpacing)) - Text("Delete") + Text(label) } }, dismissButton = { + val label = stringResource(R.string.dialog_close_cancel_label) Button( modifier = Modifier .semantics { - contentDescription = "Cancel Recording Deletion" + contentDescription = label }, onClick = { onDismiss() @@ -74,7 +78,7 @@ fun ConfirmDeletionDialog( modifier = Modifier.size(ButtonDefaults.IconSize), ) Spacer(modifier = Modifier.width(ButtonDefaults.IconSpacing)) - Text("Cancel") + Text(label) } } ) diff --git a/app/src/main/java/app/myzel394/locationtest/ui/components/AudioRecorder/molecules/RecordingStatus.kt b/app/src/main/java/app/myzel394/locationtest/ui/components/AudioRecorder/molecules/RecordingStatus.kt index 84bea1b..e4fe8b4 100644 --- a/app/src/main/java/app/myzel394/locationtest/ui/components/AudioRecorder/molecules/RecordingStatus.kt +++ b/app/src/main/java/app/myzel394/locationtest/ui/components/AudioRecorder/molecules/RecordingStatus.kt @@ -33,9 +33,11 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.semantics.contentDescription import androidx.compose.ui.semantics.semantics import androidx.compose.ui.unit.dp +import app.myzel394.locationtest.R import app.myzel394.locationtest.services.RecorderService import app.myzel394.locationtest.ui.BIG_PRIMARY_BUTTON_SIZE import app.myzel394.locationtest.ui.components.AudioRecorder.atoms.ConfirmDeletionDialog @@ -124,10 +126,11 @@ fun RecordingStatus( }, ) } + val label = stringResource(R.string.ui_audioRecorder_action_delete_label) Button( modifier = Modifier .semantics { - contentDescription = "Delete Recording" + contentDescription = label }, onClick = { showDeleteDialog = true @@ -140,16 +143,17 @@ fun RecordingStatus( modifier = Modifier.size(ButtonDefaults.IconSize), ) Spacer(modifier = Modifier.width(ButtonDefaults.IconSpacing)) - Text("Delete") + Text(label) } } + val label = stringResource(R.string.ui_audioRecorder_action_save_label) Button( modifier = Modifier .padding(16.dp) .fillMaxWidth() .height(BIG_PRIMARY_BUTTON_SIZE) .semantics { - contentDescription = "Save Recording" + contentDescription = label }, onClick = { RecorderService.stopService(context) @@ -163,7 +167,7 @@ fun RecordingStatus( modifier = Modifier.size(ButtonDefaults.IconSize), ) Spacer(modifier = Modifier.width(ButtonDefaults.IconSpacing)) - Text("Save Recording") + Text(label) } } } \ No newline at end of file diff --git a/app/src/main/java/app/myzel394/locationtest/ui/components/AudioRecorder/molecules/StartRecording.kt b/app/src/main/java/app/myzel394/locationtest/ui/components/AudioRecorder/molecules/StartRecording.kt index e1209bb..da69782 100644 --- a/app/src/main/java/app/myzel394/locationtest/ui/components/AudioRecorder/molecules/StartRecording.kt +++ b/app/src/main/java/app/myzel394/locationtest/ui/components/AudioRecorder/molecules/StartRecording.kt @@ -25,17 +25,18 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.semantics.contentDescription import androidx.compose.ui.semantics.semantics import androidx.compose.ui.unit.dp +import app.myzel394.locationtest.R import app.myzel394.locationtest.services.RecorderService import app.myzel394.locationtest.ui.BIG_PRIMARY_BUTTON_SIZE import app.myzel394.locationtest.ui.components.AudioRecorder.atoms.AudioVisualizer import app.myzel394.locationtest.ui.components.atoms.PermissionRequester import app.myzel394.locationtest.ui.utils.rememberFileSaverDialog import java.time.format.DateTimeFormatter - -val VISUALIZER_HEIGHT = 200.dp +import java.time.format.FormatStyle @Composable fun StartRecording( @@ -66,13 +67,14 @@ fun StartRecording( RecorderService.startService(context, connection) }, ) { trigger -> + val label = stringResource(R.string.ui_audioRecorder_action_start_label) Button( onClick = { trigger() }, modifier = Modifier .semantics { - contentDescription = "Start recording" + contentDescription = label } .size(200.dp) .clip(shape = CircleShape), @@ -89,7 +91,7 @@ fun StartRecording( ) Spacer(modifier = Modifier.height(ButtonDefaults.IconSpacing)) Text( - "Start Recording", + label, style = MaterialTheme.typography.titleSmall, ) } @@ -124,7 +126,12 @@ fun StartRecording( .size(ButtonDefaults.IconSize), ) Spacer(modifier = Modifier.width(ButtonDefaults.IconSpacing)) - Text("Save Recording from ${service.recordingStart!!.format(DateTimeFormatter.ISO_DATE_TIME)}") + Text( + stringResource( + R.string.ui_audioRecorder_action_saveOldRecording_label, + DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL).format(service.recordingStart!!), + ), + ) } } else diff --git a/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/BitrateTile.kt b/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/BitrateTile.kt index 30d3d5a..4670af8 100644 --- a/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/BitrateTile.kt +++ b/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/BitrateTile.kt @@ -17,8 +17,10 @@ import androidx.compose.runtime.collectAsState import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.unit.dp +import app.myzel394.locationtest.R import app.myzel394.locationtest.dataStore import app.myzel394.locationtest.db.AppSettings import app.myzel394.locationtest.db.AudioRecorderSettings @@ -55,13 +57,15 @@ fun BitrateTile() { } } + val notNumberLabel = stringResource(R.string.form_error_type_notNumber) + val notInRangeLabel = stringResource(R.string.form_error_value_notInRange, 1, 320) InputDialog( state = showDialog, selection = InputSelection( input = listOf( InputTextField( header = InputHeader( - title = "Set the bitrate for the audio recording", + title = stringResource(id = R.string.ui_settings_option_bitrate_explanation), icon = IconSource(Icons.Default.Tune), ), keyboardOptions = KeyboardOptions( @@ -73,14 +77,14 @@ fun BitrateTile() { val bitRate = text?.toIntOrNull() if (bitRate == null) { - ValidationResult.Invalid("Please enter a valid number") + ValidationResult.Invalid(notNumberLabel) } - if (bitRate in 1..320) { - ValidationResult.Valid - } else { - ValidationResult.Invalid("Please enter a number between 1 and 320") + if (bitRate !in 1..320) { + ValidationResult.Invalid(notInRangeLabel) } + + ValidationResult.Valid }, key = "bitrate", ) @@ -92,8 +96,8 @@ fun BitrateTile() { } ) SettingsTile( - title = "Bitrate", - description = "A higher bitrate means better quality but also larger file size", + title = stringResource(R.string.ui_settings_option_bitrate_title), + description = stringResource(R.string.ui_settings_option_bitrate_description), leading = { Icon( Icons.Default.Tune, @@ -109,7 +113,10 @@ fun BitrateTile() { shape = MaterialTheme.shapes.medium, ) { Text( - text = "${settings.audioRecorderSettings.bitRate / 1000} KB/s", + stringResource( + R.string.format_kbps, + settings.audioRecorderSettings.bitRate / 1000, + ), ) } }, @@ -119,7 +126,10 @@ fun BitrateTile() { onItemSelected = ::updateValue, ) {bitRate -> Text( - text = "${bitRate / 1000} KB/s", + stringResource( + R.string.format_kbps, + bitRate / 1000, + ), ) } } diff --git a/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/EncoderTile.kt b/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/EncoderTile.kt index 73d4511..84c8f58 100644 --- a/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/EncoderTile.kt +++ b/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/EncoderTile.kt @@ -13,6 +13,8 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource +import app.myzel394.locationtest.R import app.myzel394.locationtest.dataStore import app.myzel394.locationtest.db.AppSettings import app.myzel394.locationtest.db.AudioRecorderSettings @@ -60,7 +62,7 @@ fun EncoderTile() { }, ) SettingsTile( - title = "Encoder", + title = stringResource(R.string.ui_settings_option_encoder_title), leading = { Icon( Icons.Default.Memory, @@ -77,7 +79,7 @@ fun EncoderTile() { ) { Text( text = if (settings.audioRecorderSettings.encoder == null) { - "Auto" + stringResource(R.string.ui_settings_value_auto_label) } else { AudioRecorderSettings.ENCODER_INDEX_TEXT_MAP[settings.audioRecorderSettings.encoder]!! } @@ -89,9 +91,7 @@ fun EncoderTile() { items = listOf(null), onItemSelected = ::updateValue, ) { - Text( - text = "Auto" - ) + Text(stringResource(R.string.ui_settings_value_auto_label)) } } ) diff --git a/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/ForceExactMaxDurationTile.kt b/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/ForceExactMaxDurationTile.kt index 2105a54..125546f 100644 --- a/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/ForceExactMaxDurationTile.kt +++ b/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/ForceExactMaxDurationTile.kt @@ -11,6 +11,8 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource +import app.myzel394.locationtest.R import app.myzel394.locationtest.dataStore import app.myzel394.locationtest.db.AppSettings import app.myzel394.locationtest.db.AudioRecorderSettings @@ -42,8 +44,8 @@ fun ForceExactMaxDurationTile() { SettingsTile( - title = "Force exact duration", - description = "Force to strip the output file to be the exactly specified duration. If this is disabled, the output file may be a bit longer due to batches of audio samples being encoded together.", + title = stringResource(R.string.ui_settings_option_forceExactDuration_title), + description = stringResource(R.string.ui_settings_option_forceExactDuration_description), leading = { Icon( Icons.Default.GraphicEq, diff --git a/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/IntervalDurationTile.kt b/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/IntervalDurationTile.kt index 00822d8..83b6277 100644 --- a/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/IntervalDurationTile.kt +++ b/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/IntervalDurationTile.kt @@ -17,7 +17,9 @@ import androidx.compose.runtime.collectAsState import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp +import app.myzel394.locationtest.R import app.myzel394.locationtest.dataStore import app.myzel394.locationtest.db.AppSettings import app.myzel394.locationtest.db.AudioRecorderSettings @@ -66,8 +68,8 @@ fun IntervalDurationTile() { ) ) SettingsTile( - title = "Batch duration", - description = "Record a single batch for this duration. Alibi records multiple batches and deletes the oldest one. When exporting the audio, all batches will be merged together", + title = stringResource(R.string.ui_settings_option_intervalDuration_title), + description = stringResource(R.string.ui_settings_option_intervalDuration_description), leading = { Icon( Icons.Default.Mic, diff --git a/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/MaxDurationTile.kt b/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/MaxDurationTile.kt index 7f3c007..388c3f6 100644 --- a/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/MaxDurationTile.kt +++ b/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/MaxDurationTile.kt @@ -18,8 +18,10 @@ import androidx.compose.runtime.collectAsState import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.unit.dp +import app.myzel394.locationtest.R import app.myzel394.locationtest.dataStore import app.myzel394.locationtest.db.AppSettings import app.myzel394.locationtest.db.AudioRecorderSettings @@ -74,8 +76,8 @@ fun MaxDurationTile() { ) ) SettingsTile( - title = "Max duration", - description = "Set the maximum duration of the recording", + title = stringResource(R.string.ui_settings_option_maxDuration_title), + description = stringResource(R.string.ui_settings_option_maxDuration_description), leading = { Icon( Icons.Default.Timer, diff --git a/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/OutputFormatTile.kt b/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/OutputFormatTile.kt index d7accb4..bb358bc 100644 --- a/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/OutputFormatTile.kt +++ b/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/OutputFormatTile.kt @@ -15,7 +15,9 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.input.KeyboardType +import app.myzel394.locationtest.R import app.myzel394.locationtest.dataStore import app.myzel394.locationtest.db.AppSettings import app.myzel394.locationtest.db.AudioRecorderSettings @@ -70,7 +72,7 @@ fun OutputFormatTile() { }, ) SettingsTile( - title = "Output Format", + title = stringResource(R.string.ui_settings_option_outputFormat_title), leading = { Icon( Icons.Default.AudioFile, @@ -87,7 +89,7 @@ fun OutputFormatTile() { ) { Text( text = if (settings.audioRecorderSettings.outputFormat == null) { - "Auto" + stringResource(R.string.ui_settings_value_auto_label) } else { AudioRecorderSettings.OUTPUT_FORMAT_INDEX_TEXT_MAP[settings.audioRecorderSettings.outputFormat]!! } @@ -99,9 +101,7 @@ fun OutputFormatTile() { items = listOf(null), onItemSelected = ::updateValue, ) { - Text( - text = "Auto" - ) + Text(stringResource(R.string.ui_settings_value_auto_label)) } } ) diff --git a/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/SamplingRateTile.kt b/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/SamplingRateTile.kt index e8eb173..48d9be1 100644 --- a/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/SamplingRateTile.kt +++ b/app/src/main/java/app/myzel394/locationtest/ui/components/SettingsScreen/atoms/SamplingRateTile.kt @@ -13,7 +13,9 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.input.KeyboardType +import app.myzel394.locationtest.R import app.myzel394.locationtest.dataStore import app.myzel394.locationtest.db.AppSettings import app.myzel394.locationtest.db.AudioRecorderSettings @@ -50,13 +52,15 @@ fun SamplingRateTile() { } } + val notNumberLabel = stringResource(R.string.form_error_type_notNumber) + val mustBeGreaterThanLabel = stringResource(R.string.form_error_value_mustBeGreaterThan, 1000) InputDialog( state = showDialog, selection = InputSelection( input = listOf( InputTextField( header = InputHeader( - title = "Set the sampling rate", + title = stringResource(R.string.ui_settings_option_samplingRate_explanation), icon = IconSource(Icons.Default.RadioButtonChecked), ), keyboardOptions = KeyboardOptions( @@ -68,11 +72,11 @@ fun SamplingRateTile() { val samplingRate = text?.toIntOrNull() if (samplingRate == null) { - ValidationResult.Invalid("Please enter a valid number") + ValidationResult.Invalid(notNumberLabel) } if (samplingRate!! <= 1000) { - ValidationResult.Invalid("Sampling rate must be greater than 1000") + ValidationResult.Invalid(mustBeGreaterThanLabel) } ValidationResult.Valid @@ -87,8 +91,8 @@ fun SamplingRateTile() { } ) SettingsTile( - title = "Sampling rate", - description = "Define how many samples per second are taken from the audio signal", + title = stringResource(R.string.ui_settings_option_samplingRate_title), + description = stringResource(R.string.ui_settings_option_samplingRate_description), leading = { Icon( Icons.Default.RadioButtonChecked, @@ -104,7 +108,7 @@ fun SamplingRateTile() { shape = MaterialTheme.shapes.medium, ) { Text( - text = (settings.audioRecorderSettings.samplingRate ?: "Auto").toString() + (settings.audioRecorderSettings.samplingRate ?: stringResource(R.string.ui_settings_value_auto_label)).toString() ) } }, @@ -114,7 +118,7 @@ fun SamplingRateTile() { onItemSelected = ::updateValue, ) {samplingRate -> Text( - text = (samplingRate ?: "Auto").toString() + (samplingRate ?: stringResource(R.string.ui_settings_value_auto_label)).toString() ) } } diff --git a/app/src/main/java/app/myzel394/locationtest/ui/components/WelcomeScreen/atoms/ExplanationPage.kt b/app/src/main/java/app/myzel394/locationtest/ui/components/WelcomeScreen/atoms/ExplanationPage.kt index 88887e2..f417fa1 100644 --- a/app/src/main/java/app/myzel394/locationtest/ui/components/WelcomeScreen/atoms/ExplanationPage.kt +++ b/app/src/main/java/app/myzel394/locationtest/ui/components/WelcomeScreen/atoms/ExplanationPage.kt @@ -23,7 +23,9 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp +import app.myzel394.locationtest.R import app.myzel394.locationtest.ui.BIG_PRIMARY_BUTTON_SIZE @Composable @@ -50,12 +52,12 @@ fun ExplanationPage( ) Spacer(modifier = Modifier.height(32.dp)) Text( - "Welcome to Alibi!", + stringResource(R.string.ui_welcome_explanation_title), style = MaterialTheme.typography.titleLarge, ) Spacer(modifier = Modifier.height(16.dp)) Text( - "Alibi is like a dashcam for your phone. It allows you to record your audio continuously and save the last 30 minutes when you need it.", + stringResource(R.string.ui_welcome_explanation_message), ) } Spacer(modifier = Modifier.weight(1f)) @@ -72,7 +74,7 @@ fun ExplanationPage( modifier = Modifier.size(ButtonDefaults.IconSize) ) Spacer(modifier = Modifier.width(ButtonDefaults.IconSpacing)) - Text("Continue") + Text(stringResource(R.string.continue_label)) } } } diff --git a/app/src/main/java/app/myzel394/locationtest/ui/components/WelcomeScreen/atoms/ResponsibilityPage.kt b/app/src/main/java/app/myzel394/locationtest/ui/components/WelcomeScreen/atoms/ResponsibilityPage.kt index 2b71a78..9abc4c4 100644 --- a/app/src/main/java/app/myzel394/locationtest/ui/components/WelcomeScreen/atoms/ResponsibilityPage.kt +++ b/app/src/main/java/app/myzel394/locationtest/ui/components/WelcomeScreen/atoms/ResponsibilityPage.kt @@ -21,7 +21,9 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp +import app.myzel394.locationtest.R import app.myzel394.locationtest.ui.BIG_PRIMARY_BUTTON_SIZE @Composable @@ -48,12 +50,12 @@ fun ResponsibilityPage( ) Spacer(modifier = Modifier.height(32.dp)) Text( - "You are solely responsible for the use of this app", + stringResource(R.string.ui_welcome_responsibility_title), style = MaterialTheme.typography.titleLarge, ) Spacer(modifier = Modifier.height(16.dp)) Text( - "Alibi does not take any responsibility for the use of this app. You are solely responsible. Use it at your own risk.", + stringResource(R.string.ui_welcome_responsibility_message), ) } Spacer(modifier = Modifier.weight(1f)) @@ -70,7 +72,7 @@ fun ResponsibilityPage( modifier = Modifier.size(ButtonDefaults.IconSize) ) Spacer(modifier = Modifier.width(ButtonDefaults.IconSpacing)) - Text("Start Alibi") + Text(stringResource(R.string.ui_welcome_start_label)) } } } \ No newline at end of file diff --git a/app/src/main/java/app/myzel394/locationtest/ui/components/atoms/PermissionRequester.kt b/app/src/main/java/app/myzel394/locationtest/ui/components/atoms/PermissionRequester.kt index e33695c..d58c708 100644 --- a/app/src/main/java/app/myzel394/locationtest/ui/components/atoms/PermissionRequester.kt +++ b/app/src/main/java/app/myzel394/locationtest/ui/components/atoms/PermissionRequester.kt @@ -9,7 +9,6 @@ import androidx.compose.material.icons.filled.OpenInNew import androidx.compose.material3.AlertDialog import androidx.compose.material3.Button import androidx.compose.material3.ButtonDefaults -import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -19,6 +18,8 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.runtime.getValue import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import app.myzel394.locationtest.R import app.myzel394.locationtest.ui.utils.PermissionHelper import app.myzel394.locationtest.ui.utils.openAppSystemSettings @@ -51,10 +52,10 @@ fun PermissionRequester( }, icon = icon, title = { - Text("Permission denied") + Text(stringResource(R.string.ui_permissions_request_title)) }, text = { - Text("Please grant the permission to continue. You will be redirected to the app settings to grant the permission there.") + Text(stringResource(R.string.ui_permissions_request_message)) }, confirmButton = { Button( @@ -69,7 +70,7 @@ fun PermissionRequester( modifier = Modifier.size(ButtonDefaults.IconSize), ) Spacer(modifier = Modifier.width(ButtonDefaults.IconSpacing)) - Text("OK") + Text(stringResource(R.string.dialog_close_neutral_label)) } }, dismissButton = { @@ -85,7 +86,7 @@ fun PermissionRequester( modifier = Modifier.size(ButtonDefaults.IconSize), ) Spacer(modifier = Modifier.width(ButtonDefaults.IconSpacing)) - Text("Cancel") + Text(stringResource(R.string.dialog_close_cancel_label)) } } ) diff --git a/app/src/main/java/app/myzel394/locationtest/ui/screens/AudioRecorder.kt b/app/src/main/java/app/myzel394/locationtest/ui/screens/AudioRecorder.kt index c1cbda4..a6f3b91 100644 --- a/app/src/main/java/app/myzel394/locationtest/ui/screens/AudioRecorder.kt +++ b/app/src/main/java/app/myzel394/locationtest/ui/screens/AudioRecorder.kt @@ -14,12 +14,14 @@ import androidx.compose.material3.TopAppBar import androidx.compose.runtime.Composable import androidx.compose.runtime.* import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource import androidx.navigation.NavController import app.myzel394.locationtest.services.bindToRecorderService import app.myzel394.locationtest.ui.components.AudioRecorder.molecules.RecordingStatus import app.myzel394.locationtest.ui.components.AudioRecorder.molecules.StartRecording import app.myzel394.locationtest.ui.enums.Screen import app.myzel394.locationtest.ui.utils.rememberFileSaverDialog +import app.myzel394.locationtest.R @OptIn(ExperimentalMaterial3Api::class) @Composable @@ -34,7 +36,7 @@ fun AudioRecorder( topBar = { TopAppBar( title = { - Text("Alibi") + Text(stringResource(R.string.app_name)) }, actions = { IconButton( diff --git a/app/src/main/java/app/myzel394/locationtest/ui/screens/SettingsScreen.kt b/app/src/main/java/app/myzel394/locationtest/ui/screens/SettingsScreen.kt index 5b9e97f..9078f5b 100644 --- a/app/src/main/java/app/myzel394/locationtest/ui/screens/SettingsScreen.kt +++ b/app/src/main/java/app/myzel394/locationtest/ui/screens/SettingsScreen.kt @@ -35,8 +35,10 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.navigation.NavController +import app.myzel394.locationtest.R import app.myzel394.locationtest.dataStore import app.myzel394.locationtest.db.AppSettings import app.myzel394.locationtest.db.AudioRecorderSettings @@ -75,7 +77,7 @@ fun SettingsScreen( topBar = { LargeTopAppBar( title = { - Text(text = "Settings") + Text(stringResource(R.string.ui_settings_title)) }, navigationIcon = { IconButton(onClick = navController::popBackStack) { @@ -113,12 +115,12 @@ fun SettingsScreen( ) { MessageBox( type = MessageType.WARNING, - title = "You are recording", - message = "Your changes will be applied the next time you start recording", + title = stringResource(R.string.ui_settings_hint_recordingActive_title), + message = stringResource(R.string.ui_settings_hint_recordingActive_message), ) } GlobalSwitch( - label = "Advanced Settings", + label = stringResource(R.string.ui_settings_advancedSettings_label), checked = settings.showAdvancedSettings, onCheckedChange = { scope.launch { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 2c6acd3..3c88fe9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,3 +1,48 @@ - + LocationTest + Cancel + OK + Continue + + %s KB/s + Please enter a valid number + Please enter a number between %s and %s + Please enter a number greater than %s + + Permission denied + Please grant the permission to continue. You will be redirected to the app settings to grant the permission there. + + Start Recording + Save Recording from %s + Delete + Delete Recording? + Are you sure you want to delete this recording? + Save Recording + + Welcome to Alibi! + Alibi is like a dashcam for your phone. It allows you to record your audio continuously and save the last 30 minutes when you need it. + You are solely responsible for the use of this app + Alibi does not take any responsibility for the use of this app. You are solely responsible. Use it at your own risk. + Start Alibi + + Settings + Advanced Settings + You are recording + Your changes will be applied the next time you start recording + Max duration + Set the maximum duration of the recording + Batch duration + Record a single batch for this duration. Alibi records multiple batches and deletes the oldest one. When exporting the audio, all batches will be merged together + Force exact duration + Force to strip the output file to be the exactly specified duration. If this is disabled, the output file may be a bit longer due to batches of audio samples being encoded together. + Bitrate + A higher bitrate means better quality but also larger file size + Set the bitrate for the audio recording + Output Format + Auto + Sampling rate + Define how many samples per second are taken from the audio signal + Set the sampling rate + Encoder \ No newline at end of file