general: strings.xml refactoring
- Commit
dffd9536f00a406c6afd5f05e1501cf53230c4ec- Author
- Vayun Mathur <[email protected]>
- When
- 2026-04-26 20:48 UTC (7 months ago)
- Parents
d7f4615
Diff
calendar/src/main/java/com/vayunmathur/calendar/ui/dialogs/SettingsChangeColorDialog.kt
diff --git a/calendar/src/main/java/com/vayunmathur/calendar/ui/dialogs/SettingsChangeColorDialog.kt b/calendar/src/main/java/com/vayunmathur/calendar/ui/dialogs/SettingsChangeColorDialog.ktindex 36b978d317..7d1c1d4f4b 100644--- a/calendar/src/main/java/com/vayunmathur/calendar/ui/dialogs/SettingsChangeColorDialog.kt+++ b/calendar/src/main/java/com/vayunmathur/calendar/ui/dialogs/SettingsChangeColorDialog.kt@@ -56,7 +56,7 @@ fun SettingsChangeColorDialog(viewModel: CalendarViewModel, backStack: NavBackSt AlertDialog( onDismissRequest = { backStack.pop() },- title = { Text(stringResource(R.string.change_color_for, cal.displayName)) },+ title = { Text(stringResource(R.string.change_color_for)) }, text = { Column { // swatches row
calendar/src/main/java/com/vayunmathur/calendar/ui/dialogs/SettingsDeleteCalendarDialog.kt
diff --git a/calendar/src/main/java/com/vayunmathur/calendar/ui/dialogs/SettingsDeleteCalendarDialog.kt b/calendar/src/main/java/com/vayunmathur/calendar/ui/dialogs/SettingsDeleteCalendarDialog.ktindex 0c5d734c13..f854210623 100644--- a/calendar/src/main/java/com/vayunmathur/calendar/ui/dialogs/SettingsDeleteCalendarDialog.kt+++ b/calendar/src/main/java/com/vayunmathur/calendar/ui/dialogs/SettingsDeleteCalendarDialog.kt@@ -17,12 +17,19 @@ import com.vayunmathur.calendar.Route fun SettingsDeleteCalendarDialog(viewModel: CalendarViewModel, backStack: NavBackStack<Route>, calendarId: Long) { val calendars by viewModel.calendars.collectAsState() val cal = calendars.find { it.id == calendarId }- val thisCalendar = stringResource(R.string.this_calendar) AlertDialog( onDismissRequest = { backStack.pop() }, title = { Text(stringResource(R.string.delete_calendar)) },- text = { Text(stringResource(R.string.delete_calendar_confirm, cal?.displayName ?: thisCalendar)) },+ text = {+ Text(+ if (cal?.displayName.isNullOrBlank()) {+ stringResource(R.string.delete_calendar_confirm)+ } else {+ stringResource(R.string.delete_calendar_name_confirm, cal!!.displayName)+ }+ )+ }, confirmButton = { Button(onClick = { viewModel.deleteCalendar(calendarId)
calendar/src/main/res/values-pt-rBR/strings.xml
diff --git a/calendar/src/main/res/values-pt-rBR/strings.xml b/calendar/src/main/res/values-pt-rBR/strings.xmlindex 849e1eb0f4..dc06ce79df 100644--- a/calendar/src/main/res/values-pt-rBR/strings.xml+++ b/calendar/src/main/res/values-pt-rBR/strings.xml@@ -37,11 +37,8 @@ <string name="new_local_calendar">Novo calendário local</string> <string name="calendar_name">Nome do calendário</string> <string name="choose_color">Escolher cor:</string>- <string name="change_color_for">Mudar cor para \"%1$s\"</string> <string name="change_color">Mudar cor</string> <string name="delete_calendar">Excluir calendário</string>- <string name="delete_calendar_confirm">Tem certeza de que deseja excluir \"%1$s\"? Isso removerá todos os eventos no calendário.</string>- <string name="this_calendar">este calendário</string> <string name="rename_calendar">Renomear calendário</string> <string name="new_name">Nome novo</string> <string name="create_a_calendar">Criar um calendário</string>
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 6cfd7c3bbb..da04105feb 100644--- a/calendar/src/main/res/values/strings.xml+++ b/calendar/src/main/res/values/strings.xml@@ -65,13 +65,13 @@ <string name="choose_color">Choose color:</string> <!-- Change color dialog -->- <string name="change_color_for">Change color for \"%1$s\"</string>+ <string name="change_color_for">Change color for this calendar</string> <string name="change_color">Change color</string> <!-- Delete calendar dialog --> <string name="delete_calendar">Delete calendar</string>- <string name="delete_calendar_confirm">Are you sure you want to delete \"%1$s\"? This will remove all events in the calendar.</string>- <string name="this_calendar">this calendar</string>+ <string name="delete_calendar_confirm">Are you sure you want to delete this calendar? This will remove all events in the calendar.</string>+ <string name="delete_calendar_name_confirm">Are you sure you want to delete \"%1$s\"? This will remove all events in the calendar.</string> <!-- Rename calendar dialog --> <string name="rename_calendar">Rename calendar</string>
contacts/src/main/java/com/vayunmathur/contacts/intents/GetIntent.kt
diff --git a/contacts/src/main/java/com/vayunmathur/contacts/intents/GetIntent.kt b/contacts/src/main/java/com/vayunmathur/contacts/intents/GetIntent.ktindex 9339f85285..b2aff9fef9 100644--- a/contacts/src/main/java/com/vayunmathur/contacts/intents/GetIntent.kt+++ b/contacts/src/main/java/com/vayunmathur/contacts/intents/GetIntent.kt@@ -1,5 +1,6 @@ package com.vayunmathur.contacts.intents +import com.vayunmathur.contacts.R import com.vayunmathur.contacts.data.Contact import com.vayunmathur.library.intents.contacts.ContactData import com.vayunmathur.library.util.AssistantIntent@@ -12,7 +13,7 @@ class GetIntent: AssistantIntent<Unit, List<ContactData>>(serializer<Unit>(), se override suspend fun performCalculation(input: Unit): List<ContactData> { return Contact.getAllContacts(this).map { contact -> ContactData(- name = contact.name.firstName + " " + contact.name.lastName,+ name = getString(R.string.full_name_format, contact.name.firstName, contact.name.lastName), phoneNumber = contact.details.phoneNumbers.firstOrNull()?.number ?: "" ) }
contacts/src/main/java/com/vayunmathur/contacts/ui/EditContactPage.kt
diff --git a/contacts/src/main/java/com/vayunmathur/contacts/ui/EditContactPage.kt b/contacts/src/main/java/com/vayunmathur/contacts/ui/EditContactPage.ktindex 77fbe8ca54..2ef9935b4b 100644--- a/contacts/src/main/java/com/vayunmathur/contacts/ui/EditContactPage.kt+++ b/contacts/src/main/java/com/vayunmathur/contacts/ui/EditContactPage.kt@@ -276,6 +276,8 @@ fun EditContactPage(backStack: NavBackStack<Route>, viewModel: ContactViewModel, DetailsSection( stringResource(R.string.phone),+ R.string.add_phone,+ R.string.remove_phone, phoneNumbers, painterResource(R.drawable.outline_call_24), KeyboardType.Phone,@@ -286,6 +288,8 @@ fun EditContactPage(backStack: NavBackStack<Route>, viewModel: ContactViewModel, DetailsSection( stringResource(R.string.email),+ R.string.add_email,+ R.string.remove_email, emails, painterResource(R.drawable.outline_mail_24), KeyboardType.Email,@@ -308,6 +312,8 @@ fun EditContactPage(backStack: NavBackStack<Route>, viewModel: ContactViewModel, DetailsSection( stringResource(R.string.addresses),+ R.string.add_address,+ R.string.remove_address, addresses, painterResource(R.drawable.outline_event_24), KeyboardType.Text,@@ -357,7 +363,7 @@ fun AccountChooser( DropdownMenu(expanded, { expanded = false }) { accounts.forEach { account -> DropdownMenuItem(- text = { Text(account.name.ifEmpty { onDevice } + " (${account.type})") },+ text = { Text(stringResource(R.string.account_display_format, account.name.ifEmpty { onDevice }, account.type)) }, onClick = { onAccountChange(account.name, account.type) expanded = false@@ -519,7 +525,7 @@ private fun ColumnScope.DateDetailsSection( IconButton(onClick = { details.removeAt(index) }) { Icon( painterResource(R.drawable.baseline_remove_circle_outline_24),- stringResource(R.string.remove_detail_type, detailType)+ stringResource(R.string.remove_date) ) } }@@ -543,14 +549,14 @@ private fun ColumnScope.DateDetailsSection( ) { Icon(icon, contentDescription = null) Spacer(Modifier.width(8.dp))- Text(stringResource(R.string.add_detail_type, detailType))+ Text(stringResource(R.string.add_date)) } } else { TextButton( onClick = { details += ContactDetail.default<Event>() }, modifier = Modifier.align(Alignment.Start) ) {- Text(stringResource(R.string.add_detail_type, detailType))+ Text(stringResource(R.string.add_date)) } } }@@ -558,6 +564,8 @@ private fun ColumnScope.DateDetailsSection( @Composable private inline fun <reified T : ContactDetail<T>> ColumnScope.DetailsSection( detailType: String,+ addLabelRes: Int,+ removeLabelRes: Int, details: SnapshotStateList<T>, icon: Painter, keyboardType: KeyboardType,@@ -604,7 +612,7 @@ private inline fun <reified T : ContactDetail<T>> ColumnScope.DetailsSection( IconButton(onClick = { details.removeAt(index) }) { Icon( painterResource(R.drawable.baseline_remove_circle_outline_24),- stringResource(R.string.remove_detail_type, detailType)+ stringResource(removeLabelRes) ) } }@@ -621,14 +629,14 @@ private inline fun <reified T : ContactDetail<T>> ColumnScope.DetailsSection( ) { Icon(icon, contentDescription = null) Spacer(Modifier.width(8.dp))- Text(stringResource(R.string.add_detail_type, detailType))+ Text(stringResource(addLabelRes)) } } else { TextButton( onClick = { details += ContactDetail.default<T>() }, modifier = Modifier.align(Alignment.Start) ) {- Text(stringResource(R.string.add_detail_type, detailType))+ Text(stringResource(addLabelRes)) } } }
contacts/src/main/java/com/vayunmathur/contacts/ui/dialogs/EventDeleteConfirmDialog.kt
diff --git a/contacts/src/main/java/com/vayunmathur/contacts/ui/dialogs/EventDeleteConfirmDialog.kt b/contacts/src/main/java/com/vayunmathur/contacts/ui/dialogs/EventDeleteConfirmDialog.ktindex 09df07b3cf..298dd2d315 100644--- a/contacts/src/main/java/com/vayunmathur/contacts/ui/dialogs/EventDeleteConfirmDialog.kt+++ b/contacts/src/main/java/com/vayunmathur/contacts/ui/dialogs/EventDeleteConfirmDialog.kt@@ -24,9 +24,12 @@ fun EventDeleteConfirmDialog( onDismissRequest = { onDismiss() }, title = { Text(text = stringResource(R.string.delete_contact_title)) }, text = {- val thisContact = stringResource(R.string.this_contact) Text(- text = stringResource(R.string.delete_contact_confirm, contactName ?: thisContact)+ text = if (contactName.isNullOrBlank()) {+ stringResource(R.string.delete_contact_confirm)+ } else {+ stringResource(R.string.delete_contact_name_confirm, contactName)+ } ) }, confirmButton = {
contacts/src/main/res/values-et/strings.xml
diff --git a/contacts/src/main/res/values-et/strings.xml b/contacts/src/main/res/values-et/strings.xmlindex 2e54521472..d89d40da1e 100644--- a/contacts/src/main/res/values-et/strings.xml+++ b/contacts/src/main/res/values-et/strings.xml@@ -26,8 +26,6 @@ <string name="account">Kasutajakonto</string> <string name="choose_account">Vali kasutajakonto</string> <string name="remove_birthday">Eemalda sünnipäev</string>- <string name="add_detail_type">Lisa %1$s</string>- <string name="remove_detail_type">Eemalda %1$s</string> <string name="dates">Kuupäevad</string> <string name="phone">Telefon</string> <string name="email">E-posti aadress</string>@@ -45,8 +43,6 @@ <string name="cancel">Katkesta</string> <string name="ok">Sobib</string> <string name="delete_contact_title">Kustuta kontakt</string>- <string name="delete_contact_confirm">Kas sa oled kindel, et soovid %1$s kontakti kustutada? Seda tegevust ei saa tagasi pöörata.</string>- <string name="this_contact">selle kontakti</string> <string name="delete">Kustuta</string> <string name="grant_contacts_permission">Palun anna õigused kontaktide kasutamiseks</string> <string name="select_contact_hint">Üksikasjade vaatamiseks palun vali kontakt</string>
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 fb5e758873..083c0bc85d 100644--- a/contacts/src/main/res/values/strings.xml+++ b/contacts/src/main/res/values/strings.xml@@ -24,9 +24,17 @@ <string name="company">Company</string> <string name="account">Account</string> <string name="choose_account">Choose account</string>+ <string name="account_display_format">%1$s (%2$s)</string>+ <string name="full_name_format">%1$s %2$s</string> <string name="remove_birthday">Remove birthday</string>- <string name="add_detail_type">Add %1$s</string>- <string name="remove_detail_type">Remove %1$s</string>+ <string name="add_phone">Add phone</string>+ <string name="remove_phone">Remove phone</string>+ <string name="add_email">Add email</string>+ <string name="remove_email">Remove email</string>+ <string name="add_address">Add address</string>+ <string name="remove_address">Remove address</string>+ <string name="add_date">Add date</string>+ <string name="remove_date">Remove date</string> <string name="dates">Dates</string> <string name="phone">Phone</string> <string name="email">Email</string>@@ -44,8 +52,8 @@ <string name="cancel">Cancel</string> <string name="ok">OK</string> <string name="delete_contact_title">Delete contact</string>- <string name="delete_contact_confirm">Are you sure you want to delete %1$s? This action cannot be undone.</string>- <string name="this_contact">this contact</string>+ <string name="delete_contact_confirm">Are you sure you want to delete this contact? This action cannot be undone.</string>+ <string name="delete_contact_name_confirm">Are you sure you want to delete \"%1$s\"? This action cannot be undone.</string> <string name="delete">Delete</string> <string name="grant_contacts_permission">Please grant contacts permission</string> <string name="select_contact_hint">Select a contact to view details</string>
crypto/src/main/java/com/vayunmathur/crypto/ui/LendDetailScreen.kt
diff --git a/crypto/src/main/java/com/vayunmathur/crypto/ui/LendDetailScreen.kt b/crypto/src/main/java/com/vayunmathur/crypto/ui/LendDetailScreen.ktindex ce58aebd78..9a777e11e1 100644--- a/crypto/src/main/java/com/vayunmathur/crypto/ui/LendDetailScreen.kt+++ b/crypto/src/main/java/com/vayunmathur/crypto/ui/LendDetailScreen.kt@@ -60,11 +60,11 @@ fun LendDetailScreen(viewModel: PortfolioViewModel, backStack: NavBackStack<NavK ) Spacer(modifier = Modifier.height(8.dp)) Text(- text = "$${jlToken.totalValue.round(2)}",+ text = stringResource(R.string.usd_format, jlToken.totalValue.round(2)), style = MaterialTheme.typography.titleLarge, fontWeight = FontWeight.Bold, )- Text(text = "${jlToken.amount.displayAmount()} ${jlToken.tokenInfo.symbol}")+ Text(text = stringResource(R.string.token_amount_format, jlToken.amount.displayAmount(), jlToken.tokenInfo.symbol)) Spacer(modifier = Modifier.height(32.dp))
crypto/src/main/java/com/vayunmathur/crypto/ui/PortfolioScreen.kt
diff --git a/crypto/src/main/java/com/vayunmathur/crypto/ui/PortfolioScreen.kt b/crypto/src/main/java/com/vayunmathur/crypto/ui/PortfolioScreen.ktindex ab55c995bf..05bfeef09d 100644--- a/crypto/src/main/java/com/vayunmathur/crypto/ui/PortfolioScreen.kt+++ b/crypto/src/main/java/com/vayunmathur/crypto/ui/PortfolioScreen.kt@@ -166,7 +166,7 @@ fun TokenListScreen(viewModel: PortfolioViewModel, backStack: NavBackStack<NavKe } Spacer(Modifier.height(8.dp)) Text(- text = "$${totalValue.round(2)}",+ text = stringResource(R.string.usd_format, totalValue.round(2)), style = MaterialTheme.typography.headlineLarge, fontWeight = FontWeight.Bold, )@@ -257,9 +257,14 @@ fun TokenCard(token: Token, onClick: () -> Unit = {}) { Text(text = token.tokenInfo.name, fontWeight = FontWeight.Bold) when(token.tokenInfo.category) { TokenInfo.Companion.Category.NORMAL, TokenInfo.Companion.Category.XSTOCK -> {- val tpr = TokenPriceRepository[token.tokenInfo] ?: return@Column+ val priceStr = tpr.price.round(2)+ val changeStr = tpr.change.round(2) Text(- text = "$${tpr.price.round(2)} ${if (tpr.change >= 0) "+" else ""}${tpr.change.round(2)}%",+ text = if (tpr.change >= 0) {+ stringResource(R.string.price_change_positive_format, priceStr, changeStr)+ } else {+ stringResource(R.string.price_change_negative_format, priceStr, changeStr)+ }, color = if (tpr.change >= 0) Color.Green else Color.Red ) }@@ -274,8 +279,8 @@ fun TokenCard(token: Token, onClick: () -> Unit = {}) { } } Column(horizontalAlignment = Alignment.End) {- Text(text = "$${token.totalValue.round(2)}")- Text(text = "${token.amount.displayAmount()} ${token.tokenInfo.symbol}")+ Text(text = stringResource(R.string.usd_format, token.totalValue.round(2)))+ Text(text = stringResource(R.string.token_amount_format, token.amount.displayAmount(), token.tokenInfo.symbol)) } } }
crypto/src/main/java/com/vayunmathur/crypto/ui/PredictionMarketDetailScreen.kt
diff --git a/crypto/src/main/java/com/vayunmathur/crypto/ui/PredictionMarketDetailScreen.kt b/crypto/src/main/java/com/vayunmathur/crypto/ui/PredictionMarketDetailScreen.ktindex 7342725d8f..9b94bb4151 100644--- a/crypto/src/main/java/com/vayunmathur/crypto/ui/PredictionMarketDetailScreen.kt+++ b/crypto/src/main/java/com/vayunmathur/crypto/ui/PredictionMarketDetailScreen.kt@@ -94,7 +94,7 @@ fun PredictionMarketDetailScreen(viewModel: PortfolioViewModel, backStack: NavBa ) Row(Modifier, Arrangement.spacedBy(8.dp), Alignment.CenterVertically) { Text(- "${(marketItem.chance * 100).toInt()}%",+ stringResource(R.string.percent_format, (marketItem.chance * 100).toInt()), fontSize = 16.sp, fontWeight = FontWeight.Bold, )@@ -165,13 +165,13 @@ fun PredictionMarketDetailScreen(viewModel: PortfolioViewModel, backStack: NavBa { Row { Text(- stringResource(R.string.buy_choice, if (isYes) stringResource(R.string.yes) else stringResource(R.string.no)),+ if (isYes) stringResource(R.string.buy_yes) else stringResource(R.string.buy_no), color = if (isYes) Color(0xFF25D366) else Color(0xFFF44336) ) Text(stringResource(R.string.market_subtitle_separator, marketItem.subtitle)) } },- { outputAmount -> Text(stringResource(R.string.buy_win_format, if (isYes) stringResource(R.string.yes) else stringResource(R.string.no), outputAmount.round(2))) },+ { outputAmount -> Text(if (isYes) stringResource(R.string.buy_yes_win_format, outputAmount.round(2)) else stringResource(R.string.buy_no_win_format, outputAmount.round(2))) }, { selectedMarket = null }, ) }
crypto/src/main/java/com/vayunmathur/crypto/ui/PredictionMarketScreen.kt
diff --git a/crypto/src/main/java/com/vayunmathur/crypto/ui/PredictionMarketScreen.kt b/crypto/src/main/java/com/vayunmathur/crypto/ui/PredictionMarketScreen.ktindex 90d546b6b1..5af3c294ba 100644--- a/crypto/src/main/java/com/vayunmathur/crypto/ui/PredictionMarketScreen.kt+++ b/crypto/src/main/java/com/vayunmathur/crypto/ui/PredictionMarketScreen.kt@@ -93,13 +93,13 @@ fun PredictionMarketScreen(viewModel: PortfolioViewModel, backStack: NavBackStac { Row { Text(- stringResource(R.string.buy_choice, if (isYes) stringResource(R.string.yes) else stringResource(R.string.no)),+ if (isYes) stringResource(R.string.buy_yes) else stringResource(R.string.buy_no), color = if (isYes) Color(0xFF25D366) else Color(0xFFF44336) ) Text(stringResource(R.string.market_subtitle_separator, marketItem.subtitle)) } },- { outputAmount -> Text(stringResource(R.string.buy_win_format, if (isYes) stringResource(R.string.yes) else stringResource(R.string.no), outputAmount.round(2))) },+ { outputAmount -> Text(if (isYes) stringResource(R.string.buy_yes_win_format, outputAmount.round(2)) else stringResource(R.string.buy_no_win_format, outputAmount.round(2))) }, { selectedMarket = null }, ) }@@ -120,7 +120,7 @@ fun PredictionMarketCard(market: PredictionMarket.Event, backStack: NavBackStack MaximizedRow { Text(marketItem.subtitle, fontSize = 14.sp) Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp)) {- Text("${(marketItem.chance * 100).toInt()}%", fontSize = 14.sp, fontWeight = FontWeight.Bold)+ Text(stringResource(R.string.percent_format, (marketItem.chance * 100).toInt()), fontSize = 14.sp, fontWeight = FontWeight.Bold) SingleChoiceSegmentedButtonRow { SegmentedButton(selectedMarket == Pair(marketItem, true), { setSelectedMarket(Pair(marketItem, true))
crypto/src/main/java/com/vayunmathur/crypto/ui/SendScreen.kt
diff --git a/crypto/src/main/java/com/vayunmathur/crypto/ui/SendScreen.kt b/crypto/src/main/java/com/vayunmathur/crypto/ui/SendScreen.ktindex 65a18b5950..8ed10dac45 100644--- a/crypto/src/main/java/com/vayunmathur/crypto/ui/SendScreen.kt+++ b/crypto/src/main/java/com/vayunmathur/crypto/ui/SendScreen.kt@@ -123,7 +123,7 @@ fun SendScreen(viewModel: PortfolioViewModel, backStack: NavBackStack<NavKey>) { ) val fromValue = (fromAmount.toDoubleOrNull() ?: 0.0) * (TokenPriceRepository[fromTokenInfo]?.price ?: 0.0)- Text("$${fromValue.round(2)}", style = MaterialTheme.typography.bodySmall)+ Text(stringResource(R.string.usd_format, fromValue.round(2)), style = MaterialTheme.typography.bodySmall) } } }
crypto/src/main/java/com/vayunmathur/crypto/ui/StockDetailScreen.kt
diff --git a/crypto/src/main/java/com/vayunmathur/crypto/ui/StockDetailScreen.kt b/crypto/src/main/java/com/vayunmathur/crypto/ui/StockDetailScreen.ktindex e7ca40856e..3666a3806c 100644--- a/crypto/src/main/java/com/vayunmathur/crypto/ui/StockDetailScreen.kt+++ b/crypto/src/main/java/com/vayunmathur/crypto/ui/StockDetailScreen.kt@@ -59,11 +59,11 @@ fun StockDetailScreen(viewModel: PortfolioViewModel, backStack: NavBackStack<Nav ) Spacer(modifier = Modifier.height(8.dp)) Text(- text = "$${stockToken.totalValue.round(2)}",+ text = stringResource(R.string.usd_format, stockToken.totalValue.round(2)), style = MaterialTheme.typography.titleLarge, fontWeight = FontWeight.Bold, )- Text(text = "${stockToken.amount.displayAmount()} ${stockToken.tokenInfo.symbol}")+ Text(text = stringResource(R.string.token_amount_format, stockToken.amount.displayAmount(), stockToken.tokenInfo.symbol)) Spacer(modifier = Modifier.height(32.dp))
crypto/src/main/java/com/vayunmathur/crypto/ui/SwapScreen.kt
diff --git a/crypto/src/main/java/com/vayunmathur/crypto/ui/SwapScreen.kt b/crypto/src/main/java/com/vayunmathur/crypto/ui/SwapScreen.ktindex a98722e998..fdcbd93547 100644--- a/crypto/src/main/java/com/vayunmathur/crypto/ui/SwapScreen.kt+++ b/crypto/src/main/java/com/vayunmathur/crypto/ui/SwapScreen.kt@@ -165,7 +165,7 @@ fun SwapScreen(viewModel: PortfolioViewModel, backStack: NavBackStack<NavKey>) { ) val fromValue = (fromAmount.toDoubleOrNull() ?: 0.0) * (TokenPriceRepository[fromTokenInfo]?.price ?: 0.0)- Text("$${fromValue.round(2)}", style = MaterialTheme.typography.bodySmall)+ Text(stringResource(R.string.usd_format, fromValue.round(2)), style = MaterialTheme.typography.bodySmall) } } }@@ -206,7 +206,7 @@ fun SwapScreen(viewModel: PortfolioViewModel, backStack: NavBackStack<NavKey>) { Spacer(Modifier.weight(1f)) val toValue = if(toAmount != null) toAmount * (TokenPriceRepository[toTokenInfo]?.price ?: 0.0) else null Text(- toValue?.let { "$${it.round(2)}" } ?: "—",+ toValue?.let { stringResource(R.string.usd_format, it.round(2)) } ?: "—", style = MaterialTheme.typography.bodySmall, ) }
crypto/src/main/java/com/vayunmathur/crypto/ui/dialogs/OrderDialog.kt
diff --git a/crypto/src/main/java/com/vayunmathur/crypto/ui/dialogs/OrderDialog.kt b/crypto/src/main/java/com/vayunmathur/crypto/ui/dialogs/OrderDialog.ktindex 3646498bdb..f3960523db 100644--- a/crypto/src/main/java/com/vayunmathur/crypto/ui/dialogs/OrderDialog.kt+++ b/crypto/src/main/java/com/vayunmathur/crypto/ui/dialogs/OrderDialog.kt@@ -33,6 +33,7 @@ import androidx.compose.ui.unit.dp import com.vayunmathur.crypto.R import com.vayunmathur.crypto.util.PortfolioViewModel import com.vayunmathur.crypto.util.api.PendingOrder+import com.vayunmathur.crypto.util.displayAmount import com.vayunmathur.crypto.data.TokenInfo import kotlinx.coroutines.Job import kotlinx.coroutines.delay@@ -101,8 +102,10 @@ fun OrderDialog( ) Spacer(Modifier.width(16.dp)) order?.let {- if(inputTheOutput) Text(stringResource(R.string.token_exchange_display, "$outputAmount", outputToken.symbol, "$inputAmount", inputToken.symbol))- else Text(stringResource(R.string.token_exchange_display, "$inputAmount", inputToken.symbol, "$outputAmount", outputToken.symbol))+ val inputStr = inputAmount?.displayAmount() ?: ""+ val outputStr = outputAmount?.displayAmount() ?: ""+ if(inputTheOutput) Text(stringResource(R.string.token_exchange_display, outputStr, outputToken.symbol, inputStr, inputToken.symbol))+ else Text(stringResource(R.string.token_exchange_display, inputStr, inputToken.symbol, outputStr, outputToken.symbol)) } } Spacer(Modifier.height(24.dp))
crypto/src/main/java/com/vayunmathur/crypto/util/PortfolioViewModel.kt
diff --git a/crypto/src/main/java/com/vayunmathur/crypto/util/PortfolioViewModel.kt b/crypto/src/main/java/com/vayunmathur/crypto/util/PortfolioViewModel.ktindex 03c2bb9b92..678e84e320 100644--- a/crypto/src/main/java/com/vayunmathur/crypto/util/PortfolioViewModel.kt+++ b/crypto/src/main/java/com/vayunmathur/crypto/util/PortfolioViewModel.kt@@ -157,7 +157,7 @@ class PortfolioViewModel(private val application: Application) : AndroidViewMode listOf( TokenInfo( symbol = "Contracts",- name = "Yes ${market.subtitle}: ${event.title}",+ name = application.getString(com.vayunmathur.crypto.R.string.prediction_yes_name_format, market.subtitle, event.title), category = TokenInfo.Companion.Category.PRED_MARKET, mintAddress = market.yesMint, decimals = 6,@@ -165,7 +165,7 @@ class PortfolioViewModel(private val application: Application) : AndroidViewMode ), TokenInfo( symbol = "Contracts",- name = "No ${market.subtitle}: ${event.title}",+ name = application.getString(com.vayunmathur.crypto.R.string.prediction_no_name_format, market.subtitle, event.title), category = TokenInfo.Companion.Category.PRED_MARKET, mintAddress = market.noMint, decimals = 6,
crypto/src/main/res/values/strings.xml
diff --git a/crypto/src/main/res/values/strings.xml b/crypto/src/main/res/values/strings.xmlindex 9e0e2e7c69..b0eb0aa05d 100644--- a/crypto/src/main/res/values/strings.xml+++ b/crypto/src/main/res/values/strings.xml@@ -62,8 +62,12 @@ <string name="prediction_market_notice">Prediction Market viewing is available, but trading currently is unavailable until our provider increases liquidity</string> <string name="live_indicator">● Live</string> <string name="show_more">Show More ></string>- <string name="buy_choice">Buy %1$s</string>- <string name="buy_win_format">Buy %1$s -> Win $%2$s</string>+ <string name="buy_yes">Buy Yes</string>+ <string name="buy_no">Buy No</string>+ <string name="buy_yes_win_format">Buy Yes -> Win $%1$s</string>+ <string name="buy_no_win_format">Buy No -> Win $%1$s</string>+ <string name="prediction_yes_name_format">Yes %1$s: %2$s</string>+ <string name="prediction_no_name_format">No %1$s: %2$s</string> <string name="market_subtitle_separator"> — %1$s</string> <string name="yes_price_cents">Yes %1$s¢</string> <string name="no_price_cents">No %1$s¢</string>@@ -73,4 +77,9 @@ <string name="balance_format">Balance: %1$s</string> <string name="apy_format">%1$s%% APY</string> <string name="token_name_apy_format">%1$s - %2$s%% APY</string>+ <string name="usd_format">$%1$s</string>+ <string name="token_amount_format">%1$s %2$s</string>+ <string name="percent_format">%1$s%%</string>+ <string name="price_change_positive_format">$%1$s +%2$s%%</string>+ <string name="price_change_negative_format">$%1$s %2$s%%</string> </resources>\ No newline at end of file
games/chess/src/main/java/com/vayunmathur/games/chess/MainActivity.kt
diff --git a/games/chess/src/main/java/com/vayunmathur/games/chess/MainActivity.kt b/games/chess/src/main/java/com/vayunmathur/games/chess/MainActivity.ktindex ed930b16bb..a46f3ac5b5 100644--- a/games/chess/src/main/java/com/vayunmathur/games/chess/MainActivity.kt+++ b/games/chess/src/main/java/com/vayunmathur/games/chess/MainActivity.kt@@ -362,9 +362,27 @@ fun ChessBoard( @Composable fun ChessPiece(piece: Piece, size: Dp? = null, isFlipped: Boolean = false) {+ val description = when(piece.color) {+ PieceColor.WHITE -> when(piece.type) {+ PieceType.KING -> stringResource(R.string.piece_white_king)+ PieceType.QUEEN -> stringResource(R.string.piece_white_queen)+ PieceType.ROOK -> stringResource(R.string.piece_white_rook)+ PieceType.BISHOP -> stringResource(R.string.piece_white_bishop)+ PieceType.KNIGHT -> stringResource(R.string.piece_white_knight)+ PieceType.PAWN -> stringResource(R.string.piece_white_pawn)+ }+ PieceColor.BLACK -> when(piece.type) {+ PieceType.KING -> stringResource(R.string.piece_black_king)+ PieceType.QUEEN -> stringResource(R.string.piece_black_queen)+ PieceType.ROOK -> stringResource(R.string.piece_black_rook)+ PieceType.BISHOP -> stringResource(R.string.piece_black_bishop)+ PieceType.KNIGHT -> stringResource(R.string.piece_black_knight)+ PieceType.PAWN -> stringResource(R.string.piece_black_pawn)+ }+ } Image( painterResource(id = piece.type.resID),- "${piece.color} ${piece.type}",+ description, (if (size != null) Modifier.size(size) else Modifier.fillMaxSize()) .graphicsLayer { if (isFlipped) rotationZ = 180f }, colorFilter = ColorFilter.tint(if (piece.color == PieceColor.WHITE) Color.White else Color.Black)
games/chess/src/main/java/com/vayunmathur/games/chess/util/ChessViewModel.kt
diff --git a/games/chess/src/main/java/com/vayunmathur/games/chess/util/ChessViewModel.kt b/games/chess/src/main/java/com/vayunmathur/games/chess/util/ChessViewModel.ktindex 33123f885c..655278b399 100644--- a/games/chess/src/main/java/com/vayunmathur/games/chess/util/ChessViewModel.kt+++ b/games/chess/src/main/java/com/vayunmathur/games/chess/util/ChessViewModel.kt@@ -134,10 +134,7 @@ class ChessViewModel(application: Application) : AndroidViewModel(application) { val turn = if (_uiState.value.turn == PieceColor.WHITE) PieceColor.BLACK else PieceColor.WHITE val ctx = getApplication<Application>() return when {- board.isCheckmate(turn) -> ctx.getString(- R.string.checkmate_wins,- if (turn == PieceColor.WHITE) ctx.getString(R.string.color_black) else ctx.getString(R.string.color_white)- )+ board.isCheckmate(turn) -> if (turn == PieceColor.WHITE) ctx.getString(R.string.black_wins) else ctx.getString(R.string.white_wins) board.isKingInCheck(turn) -> ctx.getString(R.string.check) else -> null }
games/chess/src/main/res/values/strings.xml
diff --git a/games/chess/src/main/res/values/strings.xml b/games/chess/src/main/res/values/strings.xmlindex 4abc33cbfe..f50507e1f5 100644--- a/games/chess/src/main/res/values/strings.xml+++ b/games/chess/src/main/res/values/strings.xml@@ -15,4 +15,19 @@ <string name="promote_pawn">Promote Pawn</string> <string name="check">Check!</string> <string name="checkmate_wins">Checkmate! %1$s wins.</string>+ <string name="white_wins">Checkmate! White wins.</string>+ <string name="black_wins">Checkmate! Black wins.</string>++ <string name="piece_white_king">White King</string>+ <string name="piece_white_queen">White Queen</string>+ <string name="piece_white_rook">White Rook</string>+ <string name="piece_white_bishop">White Bishop</string>+ <string name="piece_white_knight">White Knight</string>+ <string name="piece_white_pawn">White Pawn</string>+ <string name="piece_black_king">Black King</string>+ <string name="piece_black_queen">Black Queen</string>+ <string name="piece_black_rook">Black Rook</string>+ <string name="piece_black_bishop">Black Bishop</string>+ <string name="piece_black_knight">Black Knight</string>+ <string name="piece_black_pawn">Black Pawn</string> </resources>\ No newline at end of file
health/src/main/java/com/vayunmathur/health/ui/BarChartDetails.kt
diff --git a/health/src/main/java/com/vayunmathur/health/ui/BarChartDetails.kt b/health/src/main/java/com/vayunmathur/health/ui/BarChartDetails.ktindex 716fbd08e9..9a5d08f872 100644--- a/health/src/main/java/com/vayunmathur/health/ui/BarChartDetails.kt+++ b/health/src/main/java/com/vayunmathur/health/ui/BarChartDetails.kt@@ -386,9 +386,8 @@ fun BarChartDetails( style = MaterialTheme.typography.displayMedium, fontWeight = FontWeight.Light )- val perDayAvg = stringResource(R.string.per_day_avg) Text(- text = if (selectedTab != 0 && !config.isLineChart) stringResource(R.string.unit_per_day_avg_format, config.unit, perDayAvg) else stringResource(R.string.unit_only_format, config.unit),+ text = if (selectedTab != 0 && !config.isLineChart) stringResource(R.string.unit_per_day_avg_format, config.unit) else stringResource(R.string.unit_only_format, config.unit), style = MaterialTheme.typography.bodyLarge, modifier = Modifier.padding(bottom = 12.dp, start = 4.dp), color = LocalContentColor.current.copy(alpha = 0.6f)
health/src/main/java/com/vayunmathur/health/ui/ImmunizationsPage.kt
diff --git a/health/src/main/java/com/vayunmathur/health/ui/ImmunizationsPage.kt b/health/src/main/java/com/vayunmathur/health/ui/ImmunizationsPage.ktindex fea06b3f37..674e69cc95 100644--- a/health/src/main/java/com/vayunmathur/health/ui/ImmunizationsPage.kt+++ b/health/src/main/java/com/vayunmathur/health/ui/ImmunizationsPage.kt@@ -61,20 +61,20 @@ fun ImmunizationsPage(backStack: NavBackStack<Route>) { if (showInstallDialog) { AlertDialog( onDismissRequest = { showInstallDialog = false },- title = { Text("OpenAssistant Required") },- text = { Text("The OpenAssistant app is required for offline, secure, medical document extraction. Please install it from GitHub.") },+ title = { Text(stringResource(R.string.open_assistant_required)) },+ text = { Text(stringResource(R.string.open_assistant_rationale)) }, confirmButton = { TextButton(onClick = { val intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/vayun-mathur/Modern-Apps")) context.startActivity(intent) showInstallDialog = false }) {- Text("View on GitHub")+ Text(stringResource(R.string.view_on_github)) } }, dismissButton = { TextButton(onClick = { showInstallDialog = false }) {- Text("Cancel")+ Text(stringResource(R.string.cancel)) } } )@@ -202,19 +202,19 @@ fun ImmunizationCard(immunization: Immunization) { ) Spacer(Modifier.width(16.dp)) Column {- Text(immunization.vaccineCode.text?.value ?: "Unknown Vaccine", style = MaterialTheme.typography.titleLarge)- Text("Status: ${immunization.status.value?.getDisplay() ?: "Unknown"}", style = MaterialTheme.typography.bodyMedium)+ Text(immunization.vaccineCode.text?.value ?: stringResource(R.string.unknown), style = MaterialTheme.typography.titleLarge)+ Text(stringResource(R.string.status_format, immunization.status.value?.getDisplay() ?: stringResource(R.string.unknown)), style = MaterialTheme.typography.bodyMedium) val occurrenceDisplay = when (val occ = immunization.occurrence) { is Immunization.Occurrence.DateTime -> occ.value.value?.toString() is Immunization.Occurrence.String -> occ.value.value } if (occurrenceDisplay != null) {- Text("Date: $occurrenceDisplay", style = MaterialTheme.typography.bodyMedium)+ Text(stringResource(R.string.date_format_label, occurrenceDisplay), style = MaterialTheme.typography.bodyMedium) } if (immunization.lotNumber?.value != null) {- Text("Lot: ${immunization.lotNumber!!.value}", style = MaterialTheme.typography.bodySmall)+ Text(stringResource(R.string.lot_format, immunization.lotNumber!!.value), style = MaterialTheme.typography.bodySmall) } } }
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 3e84d2607d..b37999aa92 100644--- a/health/src/main/res/values/strings.xml+++ b/health/src/main/res/values/strings.xml@@ -23,8 +23,7 @@ <string name="history_month_label">Month %1$d</string> <!-- BarChartDetails – unit suffix -->- <string name="per_day_avg">per day (avg)</string>- <string name="unit_per_day_avg_format">\u0020%1$s\u0020%2$s</string>+ <string name="unit_per_day_avg_format">%1$s per day (avg)</string> <string name="unit_only_format">\u0020%1$s</string> <string name="hour_am_pm_format">%1$d %2$s</string> <string name="month_year_format">%1$s %2$d</string>@@ -149,6 +148,7 @@ <string name="status_format">Status: %1$s</string> <string name="result_format">Result: %1$s</string> <string name="date_format_label">Date: %1$s</string>+ <string name="lot_format">Lot: %1$s</string> <string name="open_assistant_required">OpenAssistant Required</string> <string name="open_assistant_rationale">The OpenAssistant app is required for offline, secure, medical document extraction. Please install it from GitHub.</string> <string name="view_on_github">View on GitHub</string>
maps/src/main/java/com/vayunmathur/maps/ui/BottomSheetContent.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/ui/BottomSheetContent.kt b/maps/src/main/java/com/vayunmathur/maps/ui/BottomSheetContent.ktindex 5d242f616e..e5159b549c 100644--- a/maps/src/main/java/com/vayunmathur/maps/ui/BottomSheetContent.kt+++ b/maps/src/main/java/com/vayunmathur/maps/ui/BottomSheetContent.kt@@ -86,9 +86,13 @@ fun BottomSheetContent(selectedFeature: SpecificFeature?, setSelectedFeature: (S Tab( selectedRouteType == it.key, { setSelectedRouteType(it.key) }) {- Text(- it.key.name.lowercase()- .replaceFirstChar { it.uppercase() })+ val label = when(it.key) {+ RouteService.TravelMode.WALK -> stringResource(R.string.travel_mode_walk)+ RouteService.TravelMode.BICYCLE -> stringResource(R.string.travel_mode_bicycle)+ RouteService.TravelMode.DRIVE -> stringResource(R.string.travel_mode_drive)+ RouteService.TravelMode.TRANSIT -> stringResource(R.string.travel_mode_transit)+ }+ Text(label) } } }
maps/src/main/java/com/vayunmathur/maps/util/OfflineRouter.kt
diff --git a/maps/src/main/java/com/vayunmathur/maps/util/OfflineRouter.kt b/maps/src/main/java/com/vayunmathur/maps/util/OfflineRouter.ktindex c9b90395d4..1abe69580c 100644--- a/maps/src/main/java/com/vayunmathur/maps/util/OfflineRouter.kt+++ b/maps/src/main/java/com/vayunmathur/maps/util/OfflineRouter.kt@@ -73,10 +73,24 @@ object OfflineRouter { } val maneuver = RouteService.API.Maneuver.entries.getOrElse(raw.maneuverId) { RouteService.API.Maneuver.MANEUVER_UNSPECIFIED }+ val hasName = raw.roadName.isNotBlank() val instructionText = when (maneuver) {- RouteService.API.Maneuver.DEPART -> "Head toward ${raw.roadName}"- RouteService.API.Maneuver.STRAIGHT -> "Continue on ${raw.roadName}"- else -> "Turn ${maneuver.name.replace("TURN_", "").lowercase().replace("_", " ")} onto ${raw.roadName}"+ RouteService.API.Maneuver.DEPART -> if (hasName) context.getString(R.string.maneuver_depart, raw.roadName) else context.getString(R.string.maneuver_depart_unnamed)+ RouteService.API.Maneuver.STRAIGHT -> if (hasName) context.getString(R.string.maneuver_straight, raw.roadName) else context.getString(R.string.maneuver_straight_unnamed)+ RouteService.API.Maneuver.TURN_LEFT -> if (hasName) context.getString(R.string.maneuver_turn_left, raw.roadName) else context.getString(R.string.maneuver_turn_left_unnamed)+ RouteService.API.Maneuver.TURN_RIGHT -> if (hasName) context.getString(R.string.maneuver_turn_right, raw.roadName) else context.getString(R.string.maneuver_turn_right_unnamed)+ RouteService.API.Maneuver.TURN_SLIGHT_LEFT -> if (hasName) context.getString(R.string.maneuver_turn_slight_left, raw.roadName) else context.getString(R.string.maneuver_turn_slight_left_unnamed)+ RouteService.API.Maneuver.TURN_SLIGHT_RIGHT -> if (hasName) context.getString(R.string.maneuver_turn_slight_right, raw.roadName) else context.getString(R.string.maneuver_turn_slight_right_unnamed)+ RouteService.API.Maneuver.TURN_SHARP_LEFT -> if (hasName) context.getString(R.string.maneuver_turn_sharp_left, raw.roadName) else context.getString(R.string.maneuver_turn_sharp_left_unnamed)+ RouteService.API.Maneuver.TURN_SHARP_RIGHT -> if (hasName) context.getString(R.string.maneuver_turn_sharp_right, raw.roadName) else context.getString(R.string.maneuver_turn_sharp_right_unnamed)+ RouteService.API.Maneuver.UTURN_LEFT, RouteService.API.Maneuver.UTURN_RIGHT -> if (hasName) context.getString(R.string.maneuver_uturn, raw.roadName) else context.getString(R.string.maneuver_uturn_unnamed)+ RouteService.API.Maneuver.MERGE -> if (hasName) context.getString(R.string.maneuver_merge, raw.roadName) else context.getString(R.string.maneuver_merge_unnamed)+ RouteService.API.Maneuver.RAMP_LEFT -> if (hasName) context.getString(R.string.maneuver_ramp_left, raw.roadName) else context.getString(R.string.maneuver_ramp_left_unnamed)+ RouteService.API.Maneuver.RAMP_RIGHT -> if (hasName) context.getString(R.string.maneuver_ramp_right, raw.roadName) else context.getString(R.string.maneuver_ramp_right_unnamed)+ RouteService.API.Maneuver.FORK_LEFT -> if (hasName) context.getString(R.string.maneuver_fork_left, raw.roadName) else context.getString(R.string.maneuver_fork_left_unnamed)+ RouteService.API.Maneuver.FORK_RIGHT -> if (hasName) context.getString(R.string.maneuver_fork_right, raw.roadName) else context.getString(R.string.maneuver_fork_right_unnamed)+ RouteService.API.Maneuver.ROUNDABOUT_LEFT, RouteService.API.Maneuver.ROUNDABOUT_RIGHT -> if (hasName) context.getString(R.string.maneuver_roundabout, raw.roadName) else context.getString(R.string.maneuver_roundabout_unnamed)+ else -> if (hasName) context.getString(R.string.maneuver_unspecified, raw.roadName) else context.getString(R.string.maneuver_unspecified_unnamed) } RouteService.Step(
maps/src/main/res/values/strings.xml
diff --git a/maps/src/main/res/values/strings.xml b/maps/src/main/res/values/strings.xmlindex c5b3f2dc71..f83e6928ba 100644--- a/maps/src/main/res/values/strings.xml+++ b/maps/src/main/res/values/strings.xml@@ -47,4 +47,44 @@ <string name="downloading_navigation_metadata">Downloading Navigation Tiling Metadata...</string> <string name="downloading_road_data">Downloading Road Data...</string> <string name="grant_location_permission">Grant Location Permission</string>++ <!-- Navigation Maneuvers -->+ <string name="maneuver_depart">Head toward %1$s</string>+ <string name="maneuver_depart_unnamed">Head toward destination</string>+ <string name="maneuver_straight">Continue on %1$s</string>+ <string name="maneuver_straight_unnamed">Continue straight</string>+ <string name="maneuver_turn_left">Turn left onto %1$s</string>+ <string name="maneuver_turn_left_unnamed">Turn left</string>+ <string name="maneuver_turn_right">Turn right onto %1$s</string>+ <string name="maneuver_turn_right_unnamed">Turn right</string>+ <string name="maneuver_turn_slight_left">Turn slight left onto %1$s</string>+ <string name="maneuver_turn_slight_left_unnamed">Turn slight left</string>+ <string name="maneuver_turn_slight_right">Turn slight right onto %1$s</string>+ <string name="maneuver_turn_slight_right_unnamed">Turn slight right</string>+ <string name="maneuver_turn_sharp_left">Turn sharp left onto %1$s</string>+ <string name="maneuver_turn_sharp_left_unnamed">Turn sharp left</string>+ <string name="maneuver_turn_sharp_right">Turn sharp right onto %1$s</string>+ <string name="maneuver_turn_sharp_right_unnamed">Turn sharp right</string>+ <string name="maneuver_uturn">Make a U-turn onto %1$s</string>+ <string name="maneuver_uturn_unnamed">Make a U-turn</string>+ <string name="maneuver_merge">Merge onto %1$s</string>+ <string name="maneuver_merge_unnamed">Merge</string>+ <string name="maneuver_ramp_left">Take the ramp on the left toward %1$s</string>+ <string name="maneuver_ramp_left_unnamed">Take the ramp on the left</string>+ <string name="maneuver_ramp_right">Take the ramp on the right toward %1$s</string>+ <string name="maneuver_ramp_right_unnamed">Take the ramp on the right</string>+ <string name="maneuver_fork_left">Keep left toward %1$s</string>+ <string name="maneuver_fork_left_unnamed">Keep left</string>+ <string name="maneuver_fork_right">Keep right toward %1$s</string>+ <string name="maneuver_fork_right_unnamed">Keep right</string>+ <string name="maneuver_roundabout">At the roundabout, continue onto %1$s</string>+ <string name="maneuver_roundabout_unnamed">At the roundabout, continue</string>+ <string name="maneuver_unspecified">Continue onto %1$s</string>+ <string name="maneuver_unspecified_unnamed">Continue</string>++ <!-- Travel Modes -->+ <string name="travel_mode_walk">Walk</string>+ <string name="travel_mode_bicycle">Bicycle</string>+ <string name="travel_mode_drive">Drive</string>+ <string name="travel_mode_transit">Transit</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 6745124ffd..9c416d345f 100644--- a/openassistant/src/main/java/com/vayunmathur/openassistant/util/InferenceService.kt+++ b/openassistant/src/main/java/com/vayunmathur/openassistant/util/InferenceService.kt@@ -177,7 +177,7 @@ class InferenceService : Service() { Log.e("InferenceService", "Error during standard inference", e) upsertMessageToDb(Message( conversationId = job.conversationId,- text = "Error: ${e.localizedMessage}",+ text = getString(R.string.error_prefix, e.localizedMessage ?: ""), role = "assistant", timestamp = Clock.System.now().toEpochMilliseconds() ))@@ -347,7 +347,7 @@ class InferenceService : Service() { val stream = conv.sendMessageAsync(com.google.ai.edge.litertlm.Message.user(Contents.of(contents))) stream.catch { e ->- updateMessageInDb(aiMsgId, "Error: ${e.message}")+ updateMessageInDb(aiMsgId, getString(R.string.error_prefix, e.message ?: "")) }.collect { chunk -> val chunkText = chunk.contents.contents.filterIsInstance<Content.Text>().joinToString("") { it.text } fullResponseText += chunkText
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 08927607ef..05e88ce327 100644--- a/openassistant/src/main/res/values/strings.xml+++ b/openassistant/src/main/res/values/strings.xml@@ -6,4 +6,5 @@ <string name="mic_error_format">Mic error: %1$s</string> <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> </resources>\ No newline at end of file
pdf/src/main/java/com/vayunmathur/pdf/MainActivity.kt
diff --git a/pdf/src/main/java/com/vayunmathur/pdf/MainActivity.kt b/pdf/src/main/java/com/vayunmathur/pdf/MainActivity.ktindex 6c92dc4818..4eedd3abed 100644--- a/pdf/src/main/java/com/vayunmathur/pdf/MainActivity.kt+++ b/pdf/src/main/java/com/vayunmathur/pdf/MainActivity.kt@@ -582,7 +582,10 @@ fun PdfViewerScreen(pdfDocument: EditablePdfDocument, pdfName: String) { } } else { if (searchResults.isNotEmpty()) {- Text(stringResource(R.string.search_result_counter, searchIndex + 1, searchResults.size) + " ")+ Text(+ stringResource(R.string.search_result_counter, searchIndex + 1, searchResults.size),+ modifier = Modifier.padding(end = 12.dp)+ ) } } })
photos/src/main/java/com/vayunmathur/photos/ui/PhotoPage.kt
diff --git a/photos/src/main/java/com/vayunmathur/photos/ui/PhotoPage.kt b/photos/src/main/java/com/vayunmathur/photos/ui/PhotoPage.ktindex ac47c0bf08..bb78f390ca 100644--- a/photos/src/main/java/com/vayunmathur/photos/ui/PhotoPage.kt+++ b/photos/src/main/java/com/vayunmathur/photos/ui/PhotoPage.kt@@ -51,6 +51,7 @@ import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.layout.onGloballyPositioned import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.painterResource+import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.IntSize import androidx.compose.ui.unit.dp import androidx.core.net.toUri@@ -301,14 +302,17 @@ fun PhotoDetailView( val dateFormatted = remember(photo.date) { Instant.fromEpochMilliseconds(photo.date) .toLocalDateTime(TimeZone.currentSystemDefault())- .let { "${it.day} ${it.month.name.lowercase().replaceFirstChar { c -> c.uppercase() }} ${it.year}" }+ .let {+ // Simple formatting for now, better to use localized date formatter+ "${it.day} ${it.month.name.lowercase().replaceFirstChar { c -> c.uppercase() }} ${it.year}"+ } } - Text(text = "Taken on: $dateFormatted", color = Color.LightGray)+ Text(text = stringResource(R.string.taken_on, dateFormatted), color = Color.LightGray) if (photo.exifSet) {- Text(text = "Location: ${countryName ?: "Detecting..."}", color = Color.LightGray)+ Text(text = stringResource(R.string.location, countryName ?: stringResource(R.string.detecting)), color = Color.LightGray) }- Text(text = "Resolution: ${photo.width} x ${photo.height}", color = Color.LightGray)+ Text(text = stringResource(R.string.resolution, photo.width, photo.height), color = Color.LightGray) if (photo.videoData == null) { IconButton(