Move hardcoded strings to strings.xml across all apps
- Commit
29cd2dc36589107d51f65017dbe4026c0cb04d4d- Author
- Vayun Mathur <[email protected]>
- When
- 2026-06-04 23:19 UTC (6 months ago)
- Parents
d15a57f
Diff
calendar/src/main/java/com/vayunmathur/calendar/ui/EventScreen.kt
diff --git a/calendar/src/main/java/com/vayunmathur/calendar/ui/EventScreen.kt b/calendar/src/main/java/com/vayunmathur/calendar/ui/EventScreen.ktindex 25de60eb8a..5b188324f2 100644--- a/calendar/src/main/java/com/vayunmathur/calendar/ui/EventScreen.kt+++ b/calendar/src/main/java/com/vayunmathur/calendar/ui/EventScreen.kt@@ -94,7 +94,7 @@ fun EventScreen(viewModel: CalendarViewModel, instance: Instance, backStack: Nav onDismissRequest = { showDeleteMenu = false } ) { DropdownMenuItem(- text = { Text("Delete this event") },+ text = { Text(stringResource(R.string.delete_this_event)) }, onClick = { showDeleteMenu = false viewModel.deleteEventInstance(event.id!!, instance.begin)@@ -102,7 +102,7 @@ fun EventScreen(viewModel: CalendarViewModel, instance: Instance, backStack: Nav } ) DropdownMenuItem(- text = { Text("Delete all events") },+ text = { Text(stringResource(R.string.delete_all_events)) }, onClick = { showDeleteMenu = false viewModel.deleteEventSeries(event.id!!)
calendar/src/main/java/com/vayunmathur/calendar/ui/dialogs/ImportIcsDialog.kt
diff --git a/calendar/src/main/java/com/vayunmathur/calendar/ui/dialogs/ImportIcsDialog.kt b/calendar/src/main/java/com/vayunmathur/calendar/ui/dialogs/ImportIcsDialog.ktindex a638fbafb3..dcd82b8d84 100644--- a/calendar/src/main/java/com/vayunmathur/calendar/ui/dialogs/ImportIcsDialog.kt+++ b/calendar/src/main/java/com/vayunmathur/calendar/ui/dialogs/ImportIcsDialog.kt@@ -53,12 +53,12 @@ fun ImportIcsDialog( if (showAddCalendar) { AlertDialog( onDismissRequest = { showAddCalendar = false },- title = { Text("New Local Calendar") },+ title = { Text(stringResource(R.string.new_local_calendar_title)) }, text = { TextField( value = newCalName, onValueChange = { newCalName = it },- label = { Text("Calendar Name") }+ label = { Text(stringResource(R.string.calendar_name_label)) } ) }, confirmButton = {@@ -74,10 +74,10 @@ fun ImportIcsDialog( showAddCalendar = false newCalName = "" }- }) { Text("Create") }+ }) { Text(stringResource(R.string.create)) } }, dismissButton = {- TextButton(onClick = { showAddCalendar = false }) { Text("Cancel") }+ TextButton(onClick = { showAddCalendar = false }) { Text(stringResource(R.string.cancel)) } } ) }@@ -87,16 +87,16 @@ fun ImportIcsDialog( AlertDialog( onDismissRequest = onDismiss, confirmButton = {},- title = { Text("Loading events...") },+ title = { Text(stringResource(R.string.loading_events)) }, text = { Box(Modifier.fillMaxWidth(), contentAlignment = androidx.compose.ui.Alignment.Center) { CircularProgressIndicator() } } ) } else { AlertDialog( onDismissRequest = onDismiss,- title = { Text("Import Events") },+ title = { Text(stringResource(R.string.import_events_title)) }, text = { Column(Modifier.fillMaxWidth()) {- Text("Select calendar to import to:")+ Text(stringResource(R.string.select_calendar_to_import)) Spacer(Modifier.height(8.dp)) Box {@@ -130,7 +130,7 @@ fun ImportIcsDialog( } Divider() DropdownMenuItem(- text = { Text("+ Create new calendar") },+ text = { Text(stringResource(R.string.create_new_calendar)) }, onClick = { showAddCalendar = true showDropdown = false@@ -156,12 +156,12 @@ fun ImportIcsDialog( viewModel.importIcsEvents(events, calId, onDone = onDismiss) } ) {- Text("Import")+ Text(stringResource(R.string.import_button)) } }, dismissButton = { TextButton(onClick = onDismiss) {- Text("Cancel")+ Text(stringResource(R.string.cancel)) } } )
calendar/src/main/java/com/vayunmathur/calendar/ui/dialogs/RecurrenceDialog.kt
diff --git a/calendar/src/main/java/com/vayunmathur/calendar/ui/dialogs/RecurrenceDialog.kt b/calendar/src/main/java/com/vayunmathur/calendar/ui/dialogs/RecurrenceDialog.ktindex af21ac56a2..532f3842dc 100644--- a/calendar/src/main/java/com/vayunmathur/calendar/ui/dialogs/RecurrenceDialog.kt+++ b/calendar/src/main/java/com/vayunmathur/calendar/ui/dialogs/RecurrenceDialog.kt@@ -216,8 +216,8 @@ fun RecurrenceDialog(backStack: NavBackStack<Route>, resultKey: String, startDat byMonthDayStr = new byMonthDay = new.split(",").mapNotNull { it.trim().toIntOrNull() } },- label = { Text("By month day (1-31, -1 to -31)") },- placeholder = { Text("e.g., 1,15,-1") }+ label = { Text(stringResource(R.string.by_month_day_label)) },+ placeholder = { Text(stringResource(R.string.by_month_day_placeholder)) } ) } @@ -230,8 +230,8 @@ fun RecurrenceDialog(backStack: NavBackStack<Route>, resultKey: String, startDat byMonthStr = new byMonth = new.split(",").mapNotNull { it.trim().toIntOrNull() } },- label = { Text("By month (1-12)") },- placeholder = { Text("e.g., 1,6,12") }+ label = { Text(stringResource(R.string.by_month_label)) },+ placeholder = { Text(stringResource(R.string.by_month_placeholder)) } ) } @@ -243,8 +243,8 @@ fun RecurrenceDialog(backStack: NavBackStack<Route>, resultKey: String, startDat bySetPosStr = new bySetPos = new.split(",").mapNotNull { it.trim().toIntOrNull() } },- label = { Text("By set position (1-366, -1 to -366)") },- placeholder = { Text("e.g., 1,-1,2") }+ label = { Text(stringResource(R.string.by_set_pos_label)) },+ placeholder = { Text(stringResource(R.string.by_set_pos_placeholder)) } ) // BYYEARDAY - day of year@@ -256,8 +256,8 @@ fun RecurrenceDialog(backStack: NavBackStack<Route>, resultKey: String, startDat byYearDayStr = new byYearDay = new.split(",").mapNotNull { it.trim().toIntOrNull() } },- label = { Text("By year day (1-366, -1 to -366)") },- placeholder = { Text("e.g., 1,100,-1") }+ label = { Text(stringResource(R.string.by_year_day_label)) },+ placeholder = { Text(stringResource(R.string.by_year_day_placeholder)) } ) } @@ -270,8 +270,8 @@ fun RecurrenceDialog(backStack: NavBackStack<Route>, resultKey: String, startDat byWeekNoStr = new byWeekNo = new.split(",").mapNotNull { it.trim().toIntOrNull() } },- label = { Text("By week number (1-53, -1 to -53)") },- placeholder = { Text("e.g., 1,26,52") }+ label = { Text(stringResource(R.string.by_week_no_label)) },+ placeholder = { Text(stringResource(R.string.by_week_no_placeholder)) } ) } @@ -281,7 +281,7 @@ fun RecurrenceDialog(backStack: NavBackStack<Route>, resultKey: String, startDat wkst?.name?.take(2) ?: "MO", { }, readOnly = true,- label = { Text("Week start") },+ label = { Text(stringResource(R.string.week_start_label)) }, trailingIcon = { Text( wkst?.name?.take(2) ?: "MO",
calendar/src/main/res/values/strings.xml
diff --git a/calendar/src/main/res/values/strings.xml b/calendar/src/main/res/values/strings.xmlindex ade5392c5e..2e5f48031b 100644--- a/calendar/src/main/res/values/strings.xml+++ b/calendar/src/main/res/values/strings.xml@@ -83,4 +83,33 @@ <!-- Location row --> <string name="open_location_in_navigation">Open location</string>++ <!-- Delete event dialog -->+ <string name="delete_this_event">Delete this event</string>+ <string name="delete_all_events">Delete all events</string>++ <!-- Recurrence dialog - RFC 5545 properties -->+ <string name="by_month_day_label">By month day (1-31, -1 to -31)</string>+ <string name="by_month_day_placeholder">e.g., 1,15,-1</string>+ <string name="by_month_label">By month (1-12)</string>+ <string name="by_month_placeholder">e.g., 1,6,12</string>+ <string name="by_set_pos_label">By set position (1-366, -1 to -366)</string>+ <string name="by_set_pos_placeholder">e.g., 1,-1,2</string>+ <string name="by_year_day_label">By year day (1-366, -1 to -366)</string>+ <string name="by_year_day_placeholder">e.g., 1,100,-1</string>+ <string name="by_week_no_label">By week number (1-53, -1 to -53)</string>+ <string name="by_week_no_placeholder">e.g., 1,26,52</string>+ <string name="week_start_label">Week start</string>++ <!-- Import ICS dialog -->+ <string name="new_local_calendar_title">New Local Calendar</string>+ <string name="calendar_name_label">Calendar Name</string>+ <string name="loading_events">Loading events…</string>+ <string name="import_events_title">Import Events</string>+ <string name="select_calendar_to_import">Select calendar to import to:</string>+ <string name="create_new_calendar">+ Create new calendar</string>+ <string name="import_button">Import</string>++ <!-- Settings screen -->+ <string name="default_layout">Default Layout</string> </resources>\ No newline at end of file
contacts/src/main/java/com/vayunmathur/contacts/ui/GroupsPage.kt
diff --git a/contacts/src/main/java/com/vayunmathur/contacts/ui/GroupsPage.kt b/contacts/src/main/java/com/vayunmathur/contacts/ui/GroupsPage.ktindex d96a9b80c8..b717ba7b97 100644--- a/contacts/src/main/java/com/vayunmathur/contacts/ui/GroupsPage.kt+++ b/contacts/src/main/java/com/vayunmathur/contacts/ui/GroupsPage.kt@@ -115,7 +115,7 @@ fun GroupsPage(viewModel: ContactViewModel, backStack: NavBackStack<Route>, expa ) }, supportingContent = {- Text("${contactsInGroup.size} contacts")+ Text(stringResource(R.string.contacts_count, contactsInGroup.size)) }, leadingContent = { Box(
contacts/src/main/java/com/vayunmathur/contacts/ui/dialogs/AddToGroupDialog.kt
diff --git a/contacts/src/main/java/com/vayunmathur/contacts/ui/dialogs/AddToGroupDialog.kt b/contacts/src/main/java/com/vayunmathur/contacts/ui/dialogs/AddToGroupDialog.ktindex b1f301c8ff..1cd7ac6e8d 100644--- a/contacts/src/main/java/com/vayunmathur/contacts/ui/dialogs/AddToGroupDialog.kt+++ b/contacts/src/main/java/com/vayunmathur/contacts/ui/dialogs/AddToGroupDialog.kt@@ -30,7 +30,7 @@ fun AddToGroupDialog( title = { Text(stringResource(R.string.add_to_group)) }, text = { if (groups.isEmpty()) {- Text("No groups found. Create one in the Groups tab.")+ Text(stringResource(R.string.no_groups_found)) } else { LazyColumn( modifier = Modifier.fillMaxWidth().heightIn(max = 400.dp)
contacts/src/main/java/com/vayunmathur/contacts/ui/dialogs/ImportVcfDialog.kt
diff --git a/contacts/src/main/java/com/vayunmathur/contacts/ui/dialogs/ImportVcfDialog.kt b/contacts/src/main/java/com/vayunmathur/contacts/ui/dialogs/ImportVcfDialog.ktindex 8bd09b8078..df9ed7b334 100644--- a/contacts/src/main/java/com/vayunmathur/contacts/ui/dialogs/ImportVcfDialog.kt+++ b/contacts/src/main/java/com/vayunmathur/contacts/ui/dialogs/ImportVcfDialog.kt@@ -60,7 +60,7 @@ fun ImportVcfDialog( title = { Text(stringResource(R.string.import_contacts)) }, text = { Column(Modifier.fillMaxWidth()) {- Text("Select account to import to:")+ Text(stringResource(R.string.select_account_to_import)) Spacer(Modifier.height(8.dp)) LazyColumn(Modifier.weight(1f, fill = false)) { items(accounts, key = { "${it.type}|${it.name}" }) { account ->@@ -77,7 +77,7 @@ fun ImportVcfDialog( } item { TextButton(onClick = { showCreateAccount = true }) {- Text("+ Create new account")+ Text(stringResource(R.string.create_new_account)) } } }@@ -104,7 +104,7 @@ fun ImportVcfDialog( onDismiss() } ) {- Text("Import")+ Text(stringResource(R.string.import_button)) } }, dismissButton = {
contacts/src/main/res/values/strings.xml
diff --git a/contacts/src/main/res/values/strings.xml b/contacts/src/main/res/values/strings.xmlindex 260ac6754a..e9660177b0 100644--- a/contacts/src/main/res/values/strings.xml+++ b/contacts/src/main/res/values/strings.xml@@ -89,4 +89,9 @@ <string name="delete_group_confirm">Are you sure you want to delete this group? The contacts will not be deleted.</string> <string name="remove_from_group">Remove from group</string> <string name="copied_to_clipboard">Copied to clipboard</string>+ <string name="select_account_to_import">Select account to import to:</string>+ <string name="create_new_account">+ Create new account</string>+ <string name="import_button">Import</string>+ <string name="no_groups_found">No groups found. Create one in the Groups tab.</string>+ <string name="contacts_count">%1$d contacts</string> </resources>\ No newline at end of file
email/src/main/java/com/vayunmathur/email/MainActivity.kt
diff --git a/email/src/main/java/com/vayunmathur/email/MainActivity.kt b/email/src/main/java/com/vayunmathur/email/MainActivity.ktindex 7bda0481ce..12eec1dbc3 100644--- a/email/src/main/java/com/vayunmathur/email/MainActivity.kt+++ b/email/src/main/java/com/vayunmathur/email/MainActivity.kt@@ -23,6 +23,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.painterResource+import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp@@ -176,7 +177,7 @@ fun EmailApp(viewModel: EmailViewModel) { ) { Text("Unified Inbox", modifier = Modifier.padding(16.dp), style = MaterialTheme.typography.titleMedium) NavigationDrawerItem(- label = { Text("All Accounts") },+ label = { Text(stringResource(R.string.all_accounts)) }, selected = selectedAccountEmail == null, onClick = { viewModel.selectAccount("")@@ -214,7 +215,7 @@ fun EmailApp(viewModel: EmailViewModel) { ) } NavigationDrawerItem(- label = { Text("Add Account") },+ label = { Text(stringResource(R.string.add_account)) }, selected = false, onClick = { backStack.add(Route.AddAccount)@@ -238,8 +239,8 @@ fun EmailApp(viewModel: EmailViewModel) { NavigationDrawerItem( label = { Text(- if (outbox.isEmpty()) "Outbox"- else "Outbox (${outbox.size})"+ if (outbox.isEmpty()) stringResource(R.string.outbox)+ else stringResource(R.string.outbox_with_count, outbox.size) ) }, selected = false,@@ -257,7 +258,7 @@ fun EmailApp(viewModel: EmailViewModel) { if (selectedAccountEmail != null) { HorizontalDivider() NavigationDrawerItem(- label = { Text("Logout Current Account") },+ label = { Text(stringResource(R.string.logout_current_account)) }, selected = false, onClick = { viewModel.logout(context)@@ -412,7 +413,7 @@ fun MessageListScreen( topBar = { if (selectedUids.isNotEmpty()) { TopAppBar(- title = { Text("${selectedUids.size} selected") },+ title = { Text(stringResource(R.string.selected_count, selectedUids.size)) }, navigationIcon = { IconButton(onClick = { viewModel.clearSelection() }) { IconClose()@@ -748,7 +749,7 @@ fun MessageItem( ) { IconUndo(modifier = Modifier.size(18.dp)) Spacer(Modifier.width(8.dp))- Text("Reply")+ Text(stringResource(R.string.reply)) } OutlinedButton( onClick = { onForward(msg.subject, msg.body) },@@ -756,7 +757,7 @@ fun MessageItem( ) { IconForward(modifier = Modifier.size(18.dp)) Spacer(Modifier.width(8.dp))- Text("Forward")+ Text(stringResource(R.string.forward)) } } @@ -779,9 +780,9 @@ fun MessageItem( modifier = Modifier.align(Alignment.End) ) - DetailItem(label = "From", name = senderName, email = senderEmail, avatarColor = avatarColor)+ DetailItem(label = stringResource(R.string.from_label), name = senderName, email = senderEmail, avatarColor = avatarColor) // DetailItem(label = "Reply to", ...) // If available- DetailItem(label = "To", name = "me", email = msg.to ?: "", avatarColor = Color.Gray)+ DetailItem(label = stringResource(R.string.to_label), name = "me", email = msg.to ?: "", avatarColor = Color.Gray) Spacer(Modifier.height(16.dp)) Row(verticalAlignment = Alignment.CenterVertically) {@@ -881,7 +882,7 @@ fun ComposerScreen( Scaffold( topBar = { TopAppBar(- title = { Text("Compose") },+ title = { Text(stringResource(R.string.compose)) }, navigationIcon = { IconNavigation(onBack) }, actions = { IconButton(onClick = { attachmentLauncher.launch("*/*") }) {@@ -922,8 +923,8 @@ fun ComposerScreen( Column(modifier = Modifier.padding(padding).padding(16.dp).fillMaxSize(), verticalArrangement = Arrangement.spacedBy(8.dp)) { // Account Picker ListItem(- headlineContent = { Text(fromAccount?.email ?: "Select Account") },- overlineContent = { Text("From") },+ headlineContent = { Text(fromAccount?.email ?: stringResource(R.string.select_account)) },+ overlineContent = { Text(stringResource(R.string.from_label)) }, trailingContent = { IconChevronRight() }, modifier = Modifier.clickable { showAccountPicker = true } )@@ -933,7 +934,7 @@ fun ComposerScreen( AlertDialog( onDismissRequest = { showAccountPicker = false }, confirmButton = {},- title = { Text("Select Sender") },+ title = { Text(stringResource(R.string.select_sender)) }, text = { Column { accounts.forEach { acc ->@@ -950,9 +951,9 @@ fun ComposerScreen( ) } - OutlinedTextField(value = to, onValueChange = { to = it }, label = { Text("To") }, modifier = Modifier.fillMaxWidth())- OutlinedTextField(value = subject, onValueChange = { subject = it }, label = { Text("Subject") }, modifier = Modifier.fillMaxWidth())- OutlinedTextField(value = body, onValueChange = { body = it }, label = { Text("Body") }, modifier = Modifier.fillMaxWidth().weight(1f))+ OutlinedTextField(value = to, onValueChange = { to = it }, label = { Text(stringResource(R.string.to_label)) }, modifier = Modifier.fillMaxWidth())+ OutlinedTextField(value = subject, onValueChange = { subject = it }, label = { Text(stringResource(R.string.subject_label)) }, modifier = Modifier.fillMaxWidth())+ OutlinedTextField(value = body, onValueChange = { body = it }, label = { Text(stringResource(R.string.body_label)) }, modifier = Modifier.fillMaxWidth().weight(1f)) if (attachments.isNotEmpty()) { Text("Attachments:", style = MaterialTheme.typography.labelLarge)@@ -976,14 +977,14 @@ fun OutboxScreen( Scaffold( topBar = { TopAppBar(- title = { Text("Outbox") },+ title = { Text(stringResource(R.string.outbox)) }, navigationIcon = { IconNavigation(onBack) }, actions = { if (outbox.isNotEmpty()) { TextButton(onClick = { viewModel.sendOutboxNow(context) android.widget.Toast.makeText(context, "Retrying ${outbox.size} pending message(s)…", android.widget.Toast.LENGTH_SHORT).show()- }) { Text("Send now") }+ }) { Text(stringResource(R.string.send_now)) } } }, )
email/src/main/java/com/vayunmathur/email/data/ImapIdleService.kt
diff --git a/email/src/main/java/com/vayunmathur/email/data/ImapIdleService.kt b/email/src/main/java/com/vayunmathur/email/data/ImapIdleService.ktindex e2dc06f372..f388c0d6f6 100644--- a/email/src/main/java/com/vayunmathur/email/data/ImapIdleService.kt+++ b/email/src/main/java/com/vayunmathur/email/data/ImapIdleService.kt@@ -188,8 +188,8 @@ class ImapIdleService : Service() { ensureChannel(applicationContext) return NotificationCompat.Builder(applicationContext, CHANNEL_ID) .setSmallIcon(R.drawable.ic_notification_mail)- .setContentTitle("Email")- .setContentText("Listening for new mail")+ .setContentTitle(getString(R.string.app_name))+ .setContentText(getString(R.string.listening_for_new_mail)) .setPriority(NotificationCompat.PRIORITY_LOW) .setOngoing(true) .setShowWhen(false)
email/src/main/java/com/vayunmathur/email/ui/AddAccountScreen.kt
diff --git a/email/src/main/java/com/vayunmathur/email/ui/AddAccountScreen.kt b/email/src/main/java/com/vayunmathur/email/ui/AddAccountScreen.ktindex b837fd9a09..420860fe80 100644--- a/email/src/main/java/com/vayunmathur/email/ui/AddAccountScreen.kt+++ b/email/src/main/java/com/vayunmathur/email/ui/AddAccountScreen.kt@@ -14,12 +14,14 @@ import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext+import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.text.input.PasswordVisualTransformation import androidx.compose.ui.unit.dp import com.vayunmathur.email.EmailAccount import com.vayunmathur.email.EmailManager+import com.vayunmathur.email.R import com.vayunmathur.email.ServerConfig import com.vayunmathur.email.data.CredentialCrypto import com.vayunmathur.email.data.EmailDatabase@@ -63,7 +65,7 @@ fun AddAccountScreen( Scaffold( topBar = { TopAppBar(- title = { Text(if (selectedProvider == null) "Add account" else selectedProvider.displayName) },+ title = { Text(if (selectedProvider == null) stringResource(R.string.add_account) else selectedProvider.displayName) }, navigationIcon = { val backTarget: (() -> Unit)? = when { selectedProvider != null -> ({ selectedProviderId = null })@@ -163,7 +165,7 @@ private fun PasswordForm( OutlinedTextField( value = email, onValueChange = { email = it.trim() },- label = { Text("Email address") },+ label = { Text(stringResource(R.string.email_address)) }, singleLine = true, keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Email), modifier = Modifier.fillMaxWidth(),@@ -243,9 +245,9 @@ private fun PasswordForm( if (working) { CircularProgressIndicator(modifier = Modifier.size(20.dp), strokeWidth = 2.dp) Spacer(Modifier.width(8.dp))- Text("Testing connection…")+ Text(stringResource(R.string.testing_connection)) } else {- Text("Test connection & save")+ Text(stringResource(R.string.test_connection_and_save)) } } }@@ -263,7 +265,7 @@ private fun InstructionsCard(preset: ProviderPreset) { preset.appPasswordHelpUrl?.let { url -> Spacer(Modifier.height(4.dp)) TextButton(onClick = { openUrl(context, url) }) {- Text("Open ${preset.displayName} app-password help")+ Text(stringResource(R.string.open_app_password_help, preset.displayName)) } } }@@ -280,14 +282,14 @@ private fun ServerRow( OutlinedTextField( value = host, onValueChange = onHostChange,- label = { Text("Host") },+ label = { Text(stringResource(R.string.host_label)) }, singleLine = true, modifier = Modifier.weight(2f), ) OutlinedTextField( value = port, onValueChange = onPortChange,- label = { Text("Port") },+ label = { Text(stringResource(R.string.port_label)) }, singleLine = true, keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number), modifier = Modifier.weight(1f),@@ -298,13 +300,13 @@ private fun ServerRow( FilterChip( selected = useSsl, onClick = { onSslChange(true) },- label = { Text("SSL/TLS") },+ label = { Text(stringResource(R.string.ssl_tls)) }, ) Spacer(Modifier.width(8.dp)) FilterChip( selected = !useSsl, onClick = { onSslChange(false) },- label = { Text("STARTTLS") },+ label = { Text(stringResource(R.string.starttls)) }, ) } }
email/src/main/res/values/strings.xml
diff --git a/email/src/main/res/values/strings.xml b/email/src/main/res/values/strings.xmlindex 7ab97b7513..42efee05e5 100644--- a/email/src/main/res/values/strings.xml+++ b/email/src/main/res/values/strings.xml@@ -1,3 +1,34 @@ <resources> <string name="app_name">Email</string>+ + <!-- MainActivity strings -->+ <string name="all_accounts">All Accounts</string>+ <string name="add_account">Add Account</string>+ <string name="logout_current_account">Logout Current Account</string>+ <string name="selected_count">%1$d selected</string>+ <string name="reply">Reply</string>+ <string name="forward">Forward</string>+ <string name="compose">Compose</string>+ <string name="from_label">From</string>+ <string name="select_account">Select Account</string>+ <string name="select_sender">Select Sender</string>+ <string name="to_label">To</string>+ <string name="subject_label">Subject</string>+ <string name="body_label">Body</string>+ <string name="outbox">Outbox</string>+ <string name="outbox_with_count">Outbox (%1$d)</string>+ <string name="send_now">Send now</string>+ + <!-- AddAccountScreen strings -->+ <string name="email_address">Email address</string>+ <string name="testing_connection">Testing connection…</string>+ <string name="test_connection_and_save">Test connection & save</string>+ <string name="open_app_password_help">Open %1$s app-password help</string>+ <string name="host_label">Host</string>+ <string name="port_label">Port</string>+ <string name="ssl_tls">SSL/TLS</string>+ <string name="starttls">STARTTLS</string>+ + <!-- ImapIdleService strings -->+ <string name="listening_for_new_mail">Listening for new mail</string> </resources>
health/src/main/java/com/vayunmathur/health/ui/FoodLoggingDialogs.kt
diff --git a/health/src/main/java/com/vayunmathur/health/ui/FoodLoggingDialogs.kt b/health/src/main/java/com/vayunmathur/health/ui/FoodLoggingDialogs.ktindex d132db4dd2..1684b7c397 100644--- a/health/src/main/java/com/vayunmathur/health/ui/FoodLoggingDialogs.kt+++ b/health/src/main/java/com/vayunmathur/health/ui/FoodLoggingDialogs.kt@@ -27,8 +27,10 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier+import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.unit.dp+import com.vayunmathur.health.R import com.vayunmathur.health.data.Ingredient import com.vayunmathur.health.data.Recipe import com.vayunmathur.health.util.HealthViewModel@@ -53,13 +55,13 @@ fun LogHydrationDialog(viewModel: HealthViewModel, initialTime: Instant? = null, AlertDialog( onDismissRequest = onDismiss,- title = { Text("Log Hydration") },+ title = { Text(stringResource(R.string.log_hydration)) }, text = { Column(verticalArrangement = Arrangement.spacedBy(8.dp)) { OutlinedTextField( value = quantityStr, onValueChange = { quantityStr = it },- label = { Text("Quantity") },+ label = { Text(stringResource(R.string.quantity)) }, keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number), modifier = Modifier.fillMaxWidth(), trailingIcon = {@@ -111,9 +113,9 @@ fun LogHydrationDialog(viewModel: HealthViewModel, initialTime: Instant? = null, onDismiss() } }- ) { Text("Save") }+ ) { Text(stringResource(R.string.save)) } },- dismissButton = { TextButton(onClick = onDismiss) { Text("Cancel") } }+ dismissButton = { TextButton(onClick = onDismiss) { Text(stringResource(R.string.cancel)) } } ) } @@ -153,7 +155,7 @@ fun LogMealDialog(viewModel: HealthViewModel, initialTime: Instant? = null, onDi AlertDialog( onDismissRequest = onDismiss,- title = { Text("Log Meal") },+ title = { Text(stringResource(R.string.log_meal)) }, text = { Column(verticalArrangement = Arrangement.spacedBy(8.dp)) { ExposedDropdownMenuBox(@@ -233,8 +235,8 @@ fun LogMealDialog(viewModel: HealthViewModel, initialTime: Instant? = null, onDi onDismiss() } }- ) { Text("Save") }+ ) { Text(stringResource(R.string.save)) } },- dismissButton = { TextButton(onClick = onDismiss) { Text("Cancel") } }+ dismissButton = { TextButton(onClick = onDismiss) { Text(stringResource(R.string.cancel)) } } ) }
health/src/main/java/com/vayunmathur/health/ui/NutritionDetailsPage.kt
diff --git a/health/src/main/java/com/vayunmathur/health/ui/NutritionDetailsPage.kt b/health/src/main/java/com/vayunmathur/health/ui/NutritionDetailsPage.ktindex 53647a74c4..3484ebf997 100644--- a/health/src/main/java/com/vayunmathur/health/ui/NutritionDetailsPage.kt+++ b/health/src/main/java/com/vayunmathur/health/ui/NutritionDetailsPage.kt@@ -43,7 +43,7 @@ fun NutritionDetailsPage(backStack: NavBackStack<Route>, viewModel: HealthViewMo Scaffold( topBar = { TopAppBar(- title = { Text("Nutrition breakdown") },+ title = { Text(stringResource(R.string.nutrition_breakdown)) }, navigationIcon = { IconNavigation(backStack) }, ) }
health/src/main/java/com/vayunmathur/health/ui/NutritionPage.kt
diff --git a/health/src/main/java/com/vayunmathur/health/ui/NutritionPage.kt b/health/src/main/java/com/vayunmathur/health/ui/NutritionPage.ktindex f191e37d54..d005ade332 100644--- a/health/src/main/java/com/vayunmathur/health/ui/NutritionPage.kt+++ b/health/src/main/java/com/vayunmathur/health/ui/NutritionPage.kt@@ -134,17 +134,17 @@ fun NutritionPage(backStack: NavBackStack<Route>, viewModel: HealthViewModel) { ) { FloatingActionButtonMenuItem( onClick = { fabExpanded = false; showHydrationDialog = true },- text = { Text("Log Hydration") },+ text = { Text(stringResource(R.string.log_hydration)) }, icon = { IconFire() } ) FloatingActionButtonMenuItem( onClick = { fabExpanded = false; showMealDialog = true },- text = { Text("Log Meal") },+ text = { Text(stringResource(R.string.log_meal)) }, icon = { IconFire() } ) FloatingActionButtonMenuItem( onClick = { fabExpanded = false; backStack.add(Route.RecipeManagement) },- text = { Text("Recipes") },+ text = { Text(stringResource(R.string.recipes)) }, icon = { IconAdd() } ) }
health/src/main/java/com/vayunmathur/health/ui/RecipeManagementPage.kt
diff --git a/health/src/main/java/com/vayunmathur/health/ui/RecipeManagementPage.kt b/health/src/main/java/com/vayunmathur/health/ui/RecipeManagementPage.ktindex f2f19b8ddc..86328210d9 100644--- a/health/src/main/java/com/vayunmathur/health/ui/RecipeManagementPage.kt+++ b/health/src/main/java/com/vayunmathur/health/ui/RecipeManagementPage.kt@@ -11,6 +11,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier 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.vayunmathur.health.R@@ -49,7 +50,7 @@ fun RecipeManagementPage(backStack: NavBackStack<Route>, viewModel: HealthViewMo Scaffold( topBar = { TopAppBar(- title = { Text("Recipes") },+ title = { Text(stringResource(R.string.recipes)) }, navigationIcon = { IconNavigation(backStack) }, actions = { BackupButtons() } )@@ -73,8 +74,8 @@ fun RecipeManagementPage(backStack: NavBackStack<Route>, viewModel: HealthViewMo selectedTabIndex = selectedTab, contentColor = HealthColors.Nutrition, ) {- Tab(selected = selectedTab == 0, onClick = { selectedTab = 0 }, selectedContentColor = HealthColors.Nutrition, text = { Text("Recipes") })- Tab(selected = selectedTab == 1, onClick = { selectedTab = 1 }, selectedContentColor = HealthColors.Nutrition, text = { Text("Ingredients") })+ Tab(selected = selectedTab == 0, onClick = { selectedTab = 0 }, selectedContentColor = HealthColors.Nutrition, text = { Text(stringResource(R.string.recipes)) })+ Tab(selected = selectedTab == 1, onClick = { selectedTab = 1 }, selectedContentColor = HealthColors.Nutrition, text = { Text(stringResource(R.string.ingredients)) }) } if (isListEmpty) {@@ -128,7 +129,7 @@ fun IngredientsList(ingredients: List<Ingredient>, viewModel: HealthViewModel) { var customName by remember { mutableStateOf(editingIngredient!!.customName ?: "") } AlertDialog( onDismissRequest = { editingIngredient = null },- title = { Text("Rename Ingredient") },+ title = { Text(stringResource(R.string.rename_ingredient)) }, text = { Column { Text("Original: ${editingIngredient!!.originalName}", style = MaterialTheme.typography.bodySmall)@@ -136,7 +137,7 @@ fun IngredientsList(ingredients: List<Ingredient>, viewModel: HealthViewModel) { OutlinedTextField( value = customName, onValueChange = { customName = it },- label = { Text("Custom Name") }+ label = { Text(stringResource(R.string.custom_name)) } ) } },@@ -145,10 +146,10 @@ fun IngredientsList(ingredients: List<Ingredient>, viewModel: HealthViewModel) { val newIng = editingIngredient!!.copy(customName = customName.ifBlank { null }) viewModel.updateIngredient(newIng) editingIngredient = null- }) { Text("Save") }+ }) { Text(stringResource(R.string.save)) } }, dismissButton = {- TextButton(onClick = { editingIngredient = null }) { Text("Cancel") }+ TextButton(onClick = { editingIngredient = null }) { Text(stringResource(R.string.cancel)) } } ) }@@ -257,16 +258,16 @@ fun RecipeEditorPage(backStack: NavBackStack<Route>, viewModel: HealthViewModel, OutlinedTextField( value = recipeName, onValueChange = { recipeName = it },- label = { Text("Recipe Name") },+ label = { Text(stringResource(R.string.recipe_name)) }, modifier = Modifier.fillMaxWidth() ) Row(modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically) {- Text("Ingredients", style = MaterialTheme.typography.titleMedium)+ Text(stringResource(R.string.ingredients), style = MaterialTheme.typography.titleMedium) TextButton(onClick = { showSearch = true }) { IconAdd() Spacer(Modifier.width(4.dp))- Text("Add")+ Text(stringResource(R.string.add)) } } @@ -305,7 +306,7 @@ fun RecipeEditorPage(backStack: NavBackStack<Route>, viewModel: HealthViewModel, modifier = Modifier.fillMaxWidth(), enabled = recipeName.isNotBlank() && recipeIngredients.isNotEmpty() ) {- Text("Save Recipe")+ Text(stringResource(R.string.save_recipe)) } } }@@ -350,13 +351,13 @@ fun IngredientQuantityDialog( AlertDialog( onDismissRequest = onDismiss,- title = { Text("Set Quantity for ${ingredient.displayName}") },+ title = { Text(stringResource(R.string.set_quantity_for_format, ingredient.displayName)) }, text = { Column(verticalArrangement = Arrangement.spacedBy(16.dp)) { OutlinedTextField( value = quantityStr, onValueChange = { quantityStr = it },- label = { Text("Quantity") },+ label = { Text(stringResource(R.string.quantity)) }, keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number), modifier = Modifier.fillMaxWidth() )@@ -369,7 +370,7 @@ fun IngredientQuantityDialog( value = selectedUnit.name, onValueChange = {}, readOnly = true,- label = { Text("Unit") },+ label = { Text(stringResource(R.string.unit)) }, trailingIcon = { ExposedDropdownMenuDefaults.TrailingIcon(expanded = unitExpanded) }, modifier = Modifier.menuAnchor().fillMaxWidth() )@@ -397,10 +398,10 @@ fun IngredientQuantityDialog( onConfirm(q, selectedUnit) }, enabled = quantityStr.toDoubleOrNull() != null- ) { Text("Confirm") }+ ) { Text(stringResource(R.string.confirm)) } }, dismissButton = {- TextButton(onClick = onDismiss) { Text("Cancel") }+ TextButton(onClick = onDismiss) { Text(stringResource(R.string.cancel)) } } ) }@@ -421,14 +422,14 @@ fun IngredientSearchDialog( AlertDialog( onDismissRequest = onDismiss,- title = { Text("Search Ingredient") },+ title = { Text(stringResource(R.string.search_ingredient)) }, text = { Column(modifier = Modifier.fillMaxWidth().height(400.dp)) { Row(verticalAlignment = Alignment.CenterVertically) { OutlinedTextField( value = query, onValueChange = { query = it },- label = { Text("Search") },+ label = { Text(stringResource(R.string.search)) }, modifier = Modifier.weight(1f) ) Spacer(Modifier.width(8.dp))@@ -441,7 +442,7 @@ fun IngredientSearchDialog( isSearching = false } }) {- Text("Search")+ Text(stringResource(R.string.search)) } } @@ -506,7 +507,7 @@ fun IngredientSearchDialog( } }, confirmButton = {- TextButton(onClick = onDismiss) { Text("Cancel") }+ TextButton(onClick = onDismiss) { Text(stringResource(R.string.cancel)) } } ) }
health/src/main/res/values/strings.xml
diff --git a/health/src/main/res/values/strings.xml b/health/src/main/res/values/strings.xmlindex b98790f426..ef32200805 100644--- a/health/src/main/res/values/strings.xml+++ b/health/src/main/res/values/strings.xml@@ -151,6 +151,28 @@ <string name="label_nutrition_details">Nutrition Details</string> <string name="total_energy_intake">Total energy intake</string> <string name="nutrient_progress_format">%1$s / %2$d %3$s</string>+ <string name="nutrition_breakdown">Nutrition breakdown</string>++ <!-- RecipeManagementPage -->+ <string name="recipes">Recipes</string>+ <string name="ingredients">Ingredients</string>+ <string name="rename_ingredient">Rename Ingredient</string>+ <string name="custom_name">Custom Name</string>+ <string name="save">Save</string>+ <string name="cancel">Cancel</string>+ <string name="recipe_name">Recipe Name</string>+ <string name="add">Add</string>+ <string name="save_recipe">Save Recipe</string>+ <string name="set_quantity_for_format">Set Quantity for %1$s</string>+ <string name="quantity">Quantity</string>+ <string name="unit">Unit</string>+ <string name="confirm">Confirm</string>+ <string name="search_ingredient">Search Ingredient</string>+ <string name="search">Search</string>++ <!-- FoodLoggingDialogs -->+ <string name="log_hydration">Log Hydration</string>+ <string name="log_meal">Log Meal</string> <!-- Bottom navigation --> <string name="nav_today">Today</string>
notes/src/main/java/com/vayunmathur/notes/ui/NotePage.kt
diff --git a/notes/src/main/java/com/vayunmathur/notes/ui/NotePage.kt b/notes/src/main/java/com/vayunmathur/notes/ui/NotePage.ktindex ad648cfe2b..f629077521 100644--- a/notes/src/main/java/com/vayunmathur/notes/ui/NotePage.kt+++ b/notes/src/main/java/com/vayunmathur/notes/ui/NotePage.kt@@ -46,6 +46,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.SolidColor import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.painterResource+import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.text.input.TextFieldValue import androidx.compose.ui.unit.dp@@ -58,6 +59,7 @@ import com.vayunmathur.library.ui.IconShare import com.vayunmathur.library.ui.IconVisible import com.vayunmathur.library.util.NavBackStack import com.vayunmathur.library.R as LibraryR+import com.vayunmathur.notes.R import com.vayunmathur.notes.Route import com.vayunmathur.notes.data.Note import com.vayunmathur.notes.util.NotesViewModel@@ -130,7 +132,7 @@ fun NotePage( modifier = Modifier .fillMaxWidth() .focusRequester(focusRequestor),- placeholder = { Text("Search") },+ placeholder = { Text(stringResource(R.string.search)) }, singleLine = true, keyboardOptions = KeyboardOptions(imeAction = ImeAction.Search), colors = TextFieldDefaults.colors(@@ -215,7 +217,7 @@ fun NotePage( decorationBox = { innerTextField -> Box { if (note.title.isEmpty()) Text(- text = "Title",+ text = stringResource(R.string.title), style = MaterialTheme.typography.headlineMedium.copy(color = MaterialTheme.colorScheme.onSurfaceVariant) ) innerTextField()@@ -251,7 +253,7 @@ fun NotePage( decorationBox = { innerTextField -> Box { if (note.content.isEmpty()) Text(- text = "Content",+ text = stringResource(R.string.content), style = MaterialTheme.typography.bodyMedium.copy(color = MaterialTheme.colorScheme.onSurfaceVariant) ) innerTextField()
notes/src/main/res/values/strings.xml
diff --git a/notes/src/main/res/values/strings.xml b/notes/src/main/res/values/strings.xmlindex 97483cfee0..ef3edf8c34 100644--- a/notes/src/main/res/values/strings.xml+++ b/notes/src/main/res/values/strings.xml@@ -1,3 +1,6 @@ <resources> <string name="app_name">Notes</string>+ <string name="search">Search</string>+ <string name="title">Title</string>+ <string name="content">Content</string> </resources>\ No newline at end of file
openassistant/src/main/java/com/vayunmathur/openassistant/util/InferenceService.kt
diff --git a/openassistant/src/main/java/com/vayunmathur/openassistant/util/InferenceService.kt b/openassistant/src/main/java/com/vayunmathur/openassistant/util/InferenceService.ktindex 4cb93fd310..8a3487b748 100644--- a/openassistant/src/main/java/com/vayunmathur/openassistant/util/InferenceService.kt+++ b/openassistant/src/main/java/com/vayunmathur/openassistant/util/InferenceService.kt@@ -94,7 +94,7 @@ class InferenceService : Service() { val now = System.currentTimeMillis() if (now - intentJob.enqueuedTime > 45000) { Log.w("InferenceService", "Intent job expired in queue, discarding.")- intentJob.receiver.send(-1, Bundle().apply { putString("error", "Request expired in queue") })+ intentJob.receiver.send(-1, Bundle().apply { putString("error", getString(R.string.error_request_expired)) }) } else { executeIntentInference(intentJob) }@@ -110,7 +110,7 @@ class InferenceService : Service() { val now = System.currentTimeMillis() if (now - job.enqueuedTime > 45000) { Log.w("InferenceService", "Intent job expired in queue, discarding.")- job.receiver.send(-1, Bundle().apply { putString("error", "Request expired in queue") })+ job.receiver.send(-1, Bundle().apply { putString("error", getString(R.string.error_request_expired)) }) } else { executeIntentInference(job) }@@ -154,12 +154,12 @@ class InferenceService : Service() { private fun startForegroundTask() { val channelId = "inference_service" val manager = getSystemService(NotificationManager::class.java)- val channel = NotificationChannel(channelId, "Inference Service", NotificationManager.IMPORTANCE_LOW)+ val channel = NotificationChannel(channelId, getString(R.string.inference_service), NotificationManager.IMPORTANCE_LOW) manager?.createNotificationChannel(channel) val notification = NotificationCompat.Builder(this, channelId)- .setContentTitle("OpenAssistant")- .setContentText("Processing AI inference...")+ .setContentTitle(getString(R.string.app_name))+ .setContentText(getString(R.string.processing_ai_inference)) .setSmallIcon(android.R.drawable.stat_notify_sync) .setOngoing(true) .build()@@ -183,13 +183,13 @@ class InferenceService : Service() { } } catch (e: TimeoutCancellationException) { Log.e("InferenceService", "Intent inference timed out after 45 seconds")- job.receiver.send(-1, Bundle().apply { putString("error", "Inference timed out") })+ job.receiver.send(-1, Bundle().apply { putString("error", getString(R.string.error_inference_timeout)) }) } catch (e: CancellationException) { if (e.message != "HALT") throw e Log.i("InferenceService", "Intent inference halted successfully via schema match.") } catch (e: Exception) { Log.e("InferenceService", "Error during intent inference", e)- job.receiver.send(-1, Bundle().apply { putString("error", e.localizedMessage ?: "AI engine failed") })+ job.receiver.send(-1, Bundle().apply { putString("error", e.localizedMessage ?: getString(R.string.error_ai_engine_failed)) }) } finally { currentConversation?.close() currentConversation = null@@ -296,7 +296,7 @@ class InferenceService : Service() { } Log.e("InferenceService", "AI finished generation without providing a schema-matching JSON.")- receiver.send(-1, Bundle().apply { putString("error", "AI failed to return valid JSON matching the schema.") })+ receiver.send(-1, Bundle().apply { putString("error", getString(R.string.error_ai_json_schema_mismatch)) }) } private fun tryExtractLargestJson(text: String): String? {
openassistant/src/main/res/values/strings.xml
diff --git a/openassistant/src/main/res/values/strings.xml b/openassistant/src/main/res/values/strings.xmlindex 05e88ce327..fa07f63a09 100644--- a/openassistant/src/main/res/values/strings.xml+++ b/openassistant/src/main/res/values/strings.xml@@ -7,4 +7,10 @@ <string name="new_conversation">New Conversation</string> <string name="perm_desc_inference">Allows other apps to access the on-device AI inference service for extracting structured data.</string> <string name="error_prefix">Error: %1$s</string>+ <string name="inference_service">Inference Service</string>+ <string name="processing_ai_inference">Processing AI inference...</string>+ <string name="error_request_expired">Request expired in queue</string>+ <string name="error_inference_timeout">Inference timed out</string>+ <string name="error_ai_engine_failed">AI engine failed</string>+ <string name="error_ai_json_schema_mismatch">AI failed to return valid JSON matching the schema.</string> </resources>\ No newline at end of file
weather/src/main/java/com/vayunmathur/weather/ui/HomePage.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/ui/HomePage.kt b/weather/src/main/java/com/vayunmathur/weather/ui/HomePage.ktindex 7d0163e220..794a665a95 100644--- a/weather/src/main/java/com/vayunmathur/weather/ui/HomePage.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/HomePage.kt@@ -33,10 +33,12 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.LocalLayoutDirection import androidx.compose.ui.res.painterResource+import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.LayoutDirection import androidx.compose.ui.unit.dp import com.vayunmathur.library.R as LibraryR import com.vayunmathur.library.util.NavBackStack+import com.vayunmathur.weather.R import com.vayunmathur.weather.Route import com.vayunmathur.weather.data.SavedLocation import com.vayunmathur.weather.ui.components.CreditsBottomSection@@ -245,7 +247,7 @@ private fun EmptyHome(viewModel: WeatherViewModel, onAddLocation: () -> Unit) { } } - Scaffold(topBar = { TopAppBar(title = { Text("Weather") }) }) { padding ->+ Scaffold(topBar = { TopAppBar(title = { Text(stringResource(R.string.weather_title)) }) }) { padding -> Box(modifier = Modifier.fillMaxSize().padding(padding), contentAlignment = Alignment.Center) { Column(horizontalAlignment = Alignment.CenterHorizontally) { Text("No locations yet", style = MaterialTheme.typography.titleMedium)@@ -255,7 +257,7 @@ private fun EmptyHome(viewModel: WeatherViewModel, onAddLocation: () -> Unit) { color = MaterialTheme.colorScheme.onSurfaceVariant, modifier = Modifier.padding(horizontal = 32.dp, vertical = 8.dp), )- Button(onClick = onAddLocation) { Text("Add a location") }+ Button(onClick = onAddLocation) { Text(stringResource(R.string.add_location)) } androidx.compose.foundation.layout.Spacer(Modifier.padding(top = 8.dp)) androidx.compose.material3.OutlinedButton( onClick = { onUseCurrent() },
weather/src/main/java/com/vayunmathur/weather/ui/LocationsScreen.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/ui/LocationsScreen.kt b/weather/src/main/java/com/vayunmathur/weather/ui/LocationsScreen.ktindex 965141b5d2..c508a9bf45 100644--- a/weather/src/main/java/com/vayunmathur/weather/ui/LocationsScreen.kt+++ b/weather/src/main/java/com/vayunmathur/weather/ui/LocationsScreen.kt@@ -45,6 +45,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.painterResource+import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.vayunmathur.library.R as LibraryR import com.vayunmathur.library.util.NavBackStack@@ -166,7 +167,7 @@ fun LocationsScreen( contentDescription = null, ) Spacer(Modifier.width(8.dp))- Text("Search location")+ Text(stringResource(R.string.search_location)) } }, ) { paddingValues ->@@ -243,7 +244,7 @@ fun LocationsScreen( longPressedLocation = null }, modifier = Modifier.padding(start = 16.dp),- ) { Text("Confirm delete") }+ ) { Text(stringResource(R.string.confirm_delete)) } } } }@@ -307,7 +308,7 @@ fun SearchLocationPage(backStack: NavBackStack<Route>, viewModel: WeatherViewMod .heightIn(min = 220.dp, max = 480.dp), ) { Text(- "Search location",+ stringResource(R.string.search_location), style = MaterialTheme.typography.titleMedium, color = MaterialTheme.colorScheme.onSurface, )@@ -315,7 +316,7 @@ fun SearchLocationPage(backStack: NavBackStack<Route>, viewModel: WeatherViewMod androidx.compose.material3.OutlinedTextField( value = query, onValueChange = { query = it },- placeholder = { Text("City name") },+ placeholder = { Text(stringResource(R.string.city_name_hint)) }, leadingIcon = { Icon( painter = painterResource(LibraryR.drawable.outline_search_24),
weather/src/main/res/values/strings.xml
diff --git a/weather/src/main/res/values/strings.xml b/weather/src/main/res/values/strings.xmlindex 46b8b493e9..1c1920c85d 100644--- a/weather/src/main/res/values/strings.xml+++ b/weather/src/main/res/values/strings.xml@@ -1,3 +1,8 @@ <resources> <string name="app_name">Weather</string>+ <string name="search_location">Search location</string>+ <string name="confirm_delete">Confirm delete</string>+ <string name="city_name_hint">City name</string>+ <string name="weather_title">Weather</string>+ <string name="add_location">Add a location</string> </resources>
youpipe/src/main/java/com/vayunmathur/youpipe/ui/VideoPlayer.kt
diff --git a/youpipe/src/main/java/com/vayunmathur/youpipe/ui/VideoPlayer.kt b/youpipe/src/main/java/com/vayunmathur/youpipe/ui/VideoPlayer.ktindex 537c639a77..4cf4fa869e 100644--- a/youpipe/src/main/java/com/vayunmathur/youpipe/ui/VideoPlayer.kt+++ b/youpipe/src/main/java/com/vayunmathur/youpipe/ui/VideoPlayer.kt@@ -53,6 +53,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.painterResource+import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp@@ -297,14 +298,14 @@ fun VideoPlayer( shape = RoundedCornerShape(4.dp) ) { Row(modifier = Modifier.padding(horizontal = 8.dp, vertical = 4.dp), verticalAlignment = Alignment.CenterVertically) {- Text(text = "${currentVideoStream.quality} (${getVideoCodecName(currentVideoStream.codec)})", color = Color.White, style = MaterialTheme.typography.labelMedium)+ Text(text = stringResource(R.string.video_quality_codec, currentVideoStream.quality, getVideoCodecName(currentVideoStream.codec)), color = Color.White, style = MaterialTheme.typography.labelMedium) Icon(painter = painterResource(R.drawable.outline_arrow_drop_down_24), contentDescription = null, tint = Color.White) } } DropdownMenu(expanded = isVideoMenuExpanded, onDismissRequest = { isVideoMenuExpanded = false }) { videoStreams.forEach { stream -> DropdownMenuItem(- text = { Text("${stream.quality} (${stream.fps}fps) ${getVideoCodecName(stream.codec)}") },+ text = { Text(stringResource(R.string.video_quality_fps_codec, stream.quality, stream.fps, getVideoCodecName(stream.codec))) }, onClick = { currentVideoStream = stream; isVideoMenuExpanded = false } ) }@@ -340,14 +341,14 @@ fun VideoPlayer( shape = RoundedCornerShape(4.dp) ) { Row(modifier = Modifier.padding(horizontal = 8.dp, vertical = 4.dp), verticalAlignment = Alignment.CenterVertically) {- Text(text = "${(currentAudioStream?.bitrate ?: 0) / 1000}kbps (${getAudioCodecName(currentAudioStream?.codec ?: "")})", color = Color.White, style = MaterialTheme.typography.labelMedium)+ Text(text = stringResource(R.string.audio_bitrate_codec, (currentAudioStream?.bitrate ?: 0) / 1000, getAudioCodecName(currentAudioStream?.codec ?: "")), color = Color.White, style = MaterialTheme.typography.labelMedium) Icon(painter = painterResource(R.drawable.outline_arrow_drop_down_24), contentDescription = null, tint = Color.White) } }- DropdownMenu(expanded = isAudioMenuExpanded, onDismissRequest = { isAudioMenuExpanded = false }) {+ DropdownMenu(expanded = isAudioMenuExpanded, onDismissRequest = { isAudioMenuExpanded = false }) { audioStreamOptions.forEach { stream -> DropdownMenuItem(- text = { Text("${stream.bitrate / 1000}kbps (${getAudioCodecName(stream.codec)})") },+ text = { Text(stringResource(R.string.audio_bitrate_codec, stream.bitrate / 1000, getAudioCodecName(stream.codec))) }, onClick = { currentAudioStream = stream; isAudioMenuExpanded = false } ) }
youpipe/src/main/res/values/strings.xml
diff --git a/youpipe/src/main/res/values/strings.xml b/youpipe/src/main/res/values/strings.xmlindex 1098c07891..aeab702132 100644--- a/youpipe/src/main/res/values/strings.xml+++ b/youpipe/src/main/res/values/strings.xml@@ -41,4 +41,7 @@ <string name="label_import_newpipe">Import NewPipe subscriptions</string> <string name="label_import_youtube">Import from YouTube (Takeout)</string> <string name="label_export_youpipe">Export Subscriptions</string>+ <string name="video_quality_codec">%1$s (%2$s)</string>+ <string name="video_quality_fps_codec">%1$s (%2$dfps) %3$s</string>+ <string name="audio_bitrate_codec">%1$dkbps (%2$s)</string> </resources>