Your phone, on your command. Gotcha is world's first fully on-device AI copilot for Android that turns natural language into real device actions — safely.
refactor(i18n): drawer, inbox, dialogs and overlays in string resources
Durganshu2e81d9b5b3cf
diff --git a/app/src/androidTest/java/com/gotcha/AssistiveBallTest.kt b/app/src/androidTest/java/com/gotcha/AssistiveBallTest.ktindex 6346493..10a7dbd 100644--- a/app/src/androidTest/java/com/gotcha/AssistiveBallTest.kt+++ b/app/src/androidTest/java/com/gotcha/AssistiveBallTest.kt@@ -18,7 +18,6 @@ import com.gotcha.service.AssistiveBallServiceimport com.gotcha.testutil.MockLlmimport com.gotcha.testutil.ShellPermissionsimport com.gotcha.testutil.TestSeed-import com.gotcha.ui.ASSISTIVE_BALL_CONTENT_DESCRIPTIONimport org.junit.Afterimport org.junit.Assert.assertEqualsimport org.junit.Assert.assertTrue@@ -34,6 +33,11 @@ import org.junit.runner.RunWith@RunWith(AndroidJUnit4::class)class AssistiveBallTest {+ /** The ball's accessibility label, in whatever language the device runs the app in. */+ private val ballDescription: String =+ InstrumentationRegistry.getInstrumentation().targetContext+ .getString(R.string.assistive_ball_content_description)+@get:Ruleval composeRule = createEmptyComposeRule()@@ -91,13 +95,13 @@ class AssistiveBallTest {assertTrue("Ball overlay did not appear",- device.wait(Until.hasObject(By.desc(ASSISTIVE_BALL_CONTENT_DESCRIPTION)), 5_000)+ device.wait(Until.hasObject(By.desc(ballDescription)), 5_000))device.pressHome()assertTrue("Ball did not survive returning home",- device.wait(Until.hasObject(By.desc(ASSISTIVE_BALL_CONTENT_DESCRIPTION)), 5_000)+ device.wait(Until.hasObject(By.desc(ballDescription)), 5_000))// The ball auto-docks to the screen edge (mostly off-screen, only a thin@@ -107,7 +111,7 @@ class AssistiveBallTest {var menuOpened = falserepeat(3) {if (!menuOpened) {- device.findObject(By.desc(ASSISTIVE_BALL_CONTENT_DESCRIPTION))?.click()+ device.findObject(By.desc(ballDescription))?.click()menuOpened = device.wait(Until.hasObject(By.textContains("Open App")), 2_000)}}diff --git a/app/src/main/java/com/gotcha/data/ChatImporter.kt b/app/src/main/java/com/gotcha/data/ChatImporter.ktindex 5ac416d..ba56518 100644--- a/app/src/main/java/com/gotcha/data/ChatImporter.kt+++ b/app/src/main/java/com/gotcha/data/ChatImporter.kt@@ -1,5 +1,7 @@package com.gotcha.data+import androidx.annotation.StringRes+import com.gotcha.Rimport com.gotcha.agent.ChatTitleimport com.gotcha.agent.MessageKindimport com.gotcha.llm.ChatMessage@@ -13,15 +15,15 @@ import kotlinx.serialization.json.intOrNullimport java.util.UUID/** Which kind of file an import was read from. */-enum class ImportFormat(val label: String) {+enum class ImportFormat(@StringRes val label: Int) {/** A [ChatArchive]: "Back up chat" or "Back up all chats". Lossless. */- BACKUP("Gotcha backup"),+ BACKUP(R.string.import_format_backup),/** One bare [ChatSession] file, as Gotcha stores it on the device. Lossless. */- CHAT_FILE("Gotcha chat file"),+ CHAT_FILE(R.string.import_format_chat_file),/** The Markdown "Export chat". Text only; see [ChatMarkdown]. */- MARKDOWN("Markdown chat export")+ MARKDOWN(R.string.import_format_markdown)}/** How an incoming chat relates to the ones already on the device. */@@ -37,10 +39,10 @@ enum class ImportStatus {}/** What to do with an incoming chat whose id is already taken by a different chat. */-enum class DuplicateStrategy(val label: String) {- KEEP_BOTH("Keep both"),- REPLACE("Replace mine"),- SKIP("Skip")+enum class DuplicateStrategy(@StringRes val label: Int) {+ KEEP_BOTH(R.string.import_strategy_keep_both),+ REPLACE(R.string.import_strategy_replace),+ SKIP(R.string.import_strategy_skip)}data class ImportItem(val session: ChatSession, val status: ImportStatus)diff --git a/app/src/main/java/com/gotcha/notifications/LocalNotifications.kt b/app/src/main/java/com/gotcha/notifications/LocalNotifications.ktindex c6b7e12..01441d7 100644--- a/app/src/main/java/com/gotcha/notifications/LocalNotifications.kt+++ b/app/src/main/java/com/gotcha/notifications/LocalNotifications.kt@@ -1,5 +1,7 @@package com.gotcha.notifications+import androidx.annotation.StringRes+import com.gotcha.Rimport com.gotcha.data.RunSummaryimport com.gotcha.data.Settingsimport com.gotcha.tools.AgentMode@@ -15,13 +17,13 @@ import java.time.temporal.ChronoUnit* messages answer something already asked for or sent, and only appear here so* the inbox can list them.*/-enum class NotificationCategory(val label: String, val proactive: Boolean) {- UNFINISHED_CHAT("Unfinished chat", proactive = true),- ROUTINE("Routine", proactive = true),- INACTIVITY("Reminder", proactive = true),- DAILY_TIP("Daily tip", proactive = true),- TASK_FINISHED("Task finished", proactive = false),- SERVER("From Samosa AI", proactive = false)+enum class NotificationCategory(@StringRes val label: Int, val proactive: Boolean) {+ UNFINISHED_CHAT(R.string.notification_category_unfinished_chat, proactive = true),+ ROUTINE(R.string.notification_category_routine, proactive = true),+ INACTIVITY(R.string.notification_category_reminder, proactive = true),+ DAILY_TIP(R.string.notification_category_daily_tip, proactive = true),+ TASK_FINISHED(R.string.notification_category_task_finished, proactive = false),+ SERVER(R.string.notification_category_server, proactive = false)}/** Where tapping a notification (or its inbox entry) goes. */diff --git a/app/src/main/java/com/gotcha/service/AssistiveBallService.kt b/app/src/main/java/com/gotcha/service/AssistiveBallService.ktindex ffaccfe..2d1743e 100644--- a/app/src/main/java/com/gotcha/service/AssistiveBallService.kt+++ b/app/src/main/java/com/gotcha/service/AssistiveBallService.kt@@ -16,6 +16,7 @@ import android.os.IBinderimport android.os.PowerManagerimport androidx.core.content.ContextCompatimport com.gotcha.MainActivity+import com.gotcha.Rimport com.gotcha.audio.AudioProviderimport com.gotcha.audio.SttEngineimport com.gotcha.audio.TtsEngine@@ -1116,7 +1117,7 @@ class AssistiveBallService : Service() {PendingIntent.FLAG_IMMUTABLE)val notification: Notification = Notification.Builder(this, CHANNEL_ID)- .setContentTitle("Gotcha assistive ball")+ .setContentTitle(getString(R.string.assistive_ball_content_description)).setContentText("Tap the ball for call controls. Long-press it to start a voice call.").setSmallIcon(android.R.drawable.ic_menu_compass).setContentIntent(tapIntent)diff --git a/app/src/main/java/com/gotcha/ui/AppDrawer.kt b/app/src/main/java/com/gotcha/ui/AppDrawer.ktindex 40ef8b4..4280bbf 100644--- a/app/src/main/java/com/gotcha/ui/AppDrawer.kt+++ b/app/src/main/java/com/gotcha/ui/AppDrawer.kt@@ -34,8 +34,10 @@ import androidx.compose.runtime.rememberimport androidx.compose.runtime.setValueimport androidx.compose.ui.Modifierimport androidx.compose.ui.graphics.Color+import androidx.compose.ui.res.stringResourceimport androidx.compose.ui.text.style.TextOverflowimport androidx.compose.ui.unit.dp+import com.gotcha.Rimport com.gotcha.data.ChatSessionimport com.gotcha.ui.theme.GotchaMonoimport com.gotcha.ui.theme.LocalSkin@@ -96,12 +98,12 @@ fun AppDrawerContent() {Column(modifier = Modifier.fillMaxSize()) {Text(- "Gotcha",+ stringResource(R.string.drawer_gotcha),style = MaterialTheme.typography.titleLarge,modifier = Modifier.padding(horizontal = 28.dp, vertical = 20.dp))NavigationDrawerItem(- label = { Text("New Chat") },+ label = { Text(stringResource(R.string.drawer_new_chat)) },icon = { Icon(Icons.Default.Add, contentDescription = null) },selected = false,onClick = onNewChat,@@ -110,7 +112,7 @@ fun AppDrawerContent()HorizontalDivider(modifier = Modifier.padding(vertical = 8.dp))Text(- "Recent chats",+ stringResource(R.string.drawer_recent_chats),style = MaterialTheme.typography.labelMedium,color = MaterialTheme.colorScheme.onSurfaceVariant,modifier = Modifier.padding(horizontal = 28.dp, vertical = 4.dp)@@ -133,7 +135,7 @@ fun AppDrawerContent(// than only inside, so the list itself is honest.if (session.isSample) {Text(- "Sample chat",+ stringResource(R.string.drawer_sample_chat),style = MaterialTheme.typography.labelSmall,color = MaterialTheme.colorScheme.primary,maxLines = 1@@ -160,7 +162,7 @@ fun AppDrawerContent(IconButton(onClick = { sessionToDelete = session.id }) {Icon(Icons.Outlined.Delete,- contentDescription = "Delete chat",+ contentDescription = stringResource(R.string.drawer_delete_chat_2),tint = MaterialTheme.colorScheme.onSurfaceVariant)}@@ -172,7 +174,7 @@ fun AppDrawerContent(}HorizontalDivider()NavigationDrawerItem(- label = { Text("Import chats") },+ label = { Text(stringResource(R.string.drawer_import_chats)) },icon = { Icon(Icons.Default.FileOpen, contentDescription = null) },selected = false,onClick = onImportChats,@@ -181,7 +183,7 @@ fun AppDrawerContent()if (sessions.isNotEmpty()) {NavigationDrawerItem(- label = { Text("Back up all chats") },+ label = { Text(stringResource(R.string.drawer_back_up_all_chats)) },icon = { Icon(Icons.Default.Save, contentDescription = null) },selected = false,onClick = onBackupAllChats,@@ -190,7 +192,7 @@ fun AppDrawerContent()}NavigationDrawerItem(- label = { Text("Connectors") },+ label = { Text(stringResource(R.string.drawer_connectors)) },icon = { Icon(Icons.Default.Link, contentDescription = null) },selected = false,onClick = onOpenConnectors,@@ -198,7 +200,7 @@ fun AppDrawerContent(modifier = itemModifier)NavigationDrawerItem(- label = { Text("Settings") },+ label = { Text(stringResource(R.string.drawer_settings)) },icon = { Icon(Icons.Default.Settings, contentDescription = null) },selected = false,onClick = onOpenSettings,@@ -210,11 +212,11 @@ fun AppDrawerContent(}sessionToDelete?.let { id ->- val title = sessions.find { it.id == id }?.title ?: "this chat"+ val title = sessions.find { it.id == id }?.title ?: stringResource(R.string.drawer_this_chat)SkinAlertDialog(onDismissRequest = { sessionToDelete = null },- title = { Text("Delete Chat?") },- text = { Text("Are you sure you want to permanently delete \"$title\"? This action cannot be undone.") },+ title = { Text(stringResource(R.string.drawer_delete_chat)) },+ text = { Text(stringResource(R.string.drawer_delete_confirm, title)) },confirmButton = {Button(onClick = {@@ -223,12 +225,12 @@ fun AppDrawerContent(},colors = ButtonDefaults.buttonColors(containerColor = MaterialTheme.colorScheme.error)) {- Text("Delete")+ Text(stringResource(R.string.drawer_delete))}},dismissButton = {TextButton(onClick = { sessionToDelete = null }) {- Text("Cancel")+ Text(stringResource(R.string.drawer_cancel))}})@@ -239,14 +241,15 @@ fun AppDrawerContent(* Formats a per-chat context readout like "12,345 / 70,000 tokens (18%)".* Returns null when there's nothing meaningful to show yet.*/+@Composableprivate fun formatContextUsage(tokens: Int, maxContextTokens: Int): String? {if (tokens <= 0) return nullfun grouped(n: Int): String = "%,d".format(n)return if (maxContextTokens > 0) {val percent = (tokens.toFloat() / maxContextTokens * 100f).coerceIn(0f, 100f).toInt()- "${grouped(tokens)} / ${grouped(maxContextTokens)} · $percent%"+ stringResource(R.string.drawer_context_usage, grouped(tokens), grouped(maxContextTokens), percent)} else {- "${grouped(tokens)} tokens"+ stringResource(R.string.drawer_context_tokens, grouped(tokens))}}diff --git a/app/src/main/java/com/gotcha/ui/AssistiveBallOverlay.kt b/app/src/main/java/com/gotcha/ui/AssistiveBallOverlay.ktindex 0b8a189..ef0a81d 100644--- a/app/src/main/java/com/gotcha/ui/AssistiveBallOverlay.kt+++ b/app/src/main/java/com/gotcha/ui/AssistiveBallOverlay.kt@@ -36,7 +36,6 @@ import kotlin.math.absimport kotlin.math.hypot/** Accessibility label for the ball root view — used by UiAutomator to find the overlay. */-const val ASSISTIVE_BALL_CONTENT_DESCRIPTION = "Gotcha assistive ball"/*** What the agent is doing, as far as the ball is concerned.@@ -373,7 +372,12 @@ class AssistiveBallOverlay(context: Context) {if (showClose) {// Not a menu row: nothing to line up with, so it stays centred.container.addView(- tapButton("Close", colors, iconRes = null, asMenuRow = false) { hideCard() }+ tapButton(+ appContext.getString(R.string.action_close),+ colors,+ iconRes = null,+ asMenuRow = false+ ) { hideCard() })}try {@@ -429,7 +433,7 @@ class AssistiveBallOverlay(context: Context) {val size = dp(BALL_SIZE_DP)appliedSkinId = currentSkinId()return android.widget.ImageView(appContext).apply {- contentDescription = ASSISTIVE_BALL_CONTENT_DESCRIPTION+ contentDescription = appContext.getString(R.string.assistive_ball_content_description)// The in-app mark. The launcher icon is adaptive now, so it would// draw at two-thirds size inside its own safe zone.setImageResource(R.drawable.gotcha_logo)@@ -490,19 +494,29 @@ class AssistiveBallOverlay(context: Context) {orientation = LinearLayout.VERTICAL}appNavRow.addView(- tapButton("Open App", colors, R.drawable.ic_overlay_open_app, bold = true) {+ tapButton(+ appContext.getString(R.string.ball_open_app),+ colors,+ R.drawable.ic_overlay_open_app,+ bold = true+ ) {removeMenu()onOpenApp()})appNavRow.addView(- tapButton("Screenshot", colors, R.drawable.ic_overlay_screenshot, bold = true) {+ tapButton(+ appContext.getString(R.string.ball_screenshot),+ colors,+ R.drawable.ic_overlay_screenshot,+ bold = true+ ) {removeMenu()onTakeScreenshot()})appNavRow.addView(- tapButton("Lens", colors, R.drawable.ic_overlay_lens, bold = true) {+ tapButton(appContext.getString(R.string.ball_lens), colors, R.drawable.ic_overlay_lens, bold = true) {removeMenu()onStartLens()}diff --git a/app/src/main/java/com/gotcha/ui/AttachmentViews.kt b/app/src/main/java/com/gotcha/ui/AttachmentViews.ktindex 30c4f0d..e4c2a68 100644--- a/app/src/main/java/com/gotcha/ui/AttachmentViews.kt+++ b/app/src/main/java/com/gotcha/ui/AttachmentViews.kt@@ -36,10 +36,12 @@ import androidx.compose.ui.graphics.Colorimport androidx.compose.ui.graphics.asImageBitmapimport androidx.compose.ui.layout.ContentScaleimport androidx.compose.ui.platform.testTag+import androidx.compose.ui.res.stringResourceimport androidx.compose.ui.text.font.FontWeightimport androidx.compose.ui.text.style.TextOverflowimport androidx.compose.ui.unit.Dpimport androidx.compose.ui.unit.dp+import com.gotcha.Rimport com.gotcha.agent.Attachmentimport com.gotcha.agent.ComposerAttachmentimport com.gotcha.tools.FileResolver@@ -117,7 +119,7 @@ fun ComposerAttachmentStrip(IconButton(onClick = { onRemove(attachment.id) }) {Icon(Icons.Default.Close,- contentDescription = "Remove ${attachment.name}",+ contentDescription = stringResource(R.string.attachment_remove, attachment.name),tint = MaterialTheme.colorScheme.onSecondaryContainer)}@@ -126,7 +128,7 @@ fun ComposerAttachmentStrip(}}Text(- "${attachments.size} / ${ComposerAttachment.MAX_PER_MESSAGE} files",+ stringResource(R.string.attachment_count, attachments.size, ComposerAttachment.MAX_PER_MESSAGE),style = MaterialTheme.typography.labelSmall,color = MaterialTheme.colorScheme.onSurfaceVariant,modifier = Modifier.padding(start = 16.dp, top = 2.dp)@@ -147,7 +149,7 @@ private fun RemoveButton(name: String, onClick: () -> Unit, modifier: Modifier =) {Icon(Icons.Default.Close,- contentDescription = "Remove $name",+ contentDescription = stringResource(R.string.attachment_remove, name),tint = Color.White,modifier = Modifier.size(14.dp))@@ -222,12 +224,14 @@ private fun DocumentSummary(attachment: Attachment, color: Color, modifier: ModimaxLines = 1,overflow = TextOverflow.Ellipsis)+ val document = stringResource(R.string.attachment_document)+ val truncated = stringResource(R.string.attachment_truncated)Text(buildString {- append(attachment.mimeType.ifBlank { "document" })+ append(attachment.mimeType.ifBlank { document })append(" · ")append(FileResolver.formatSizeStatic(attachment.size))- if (attachment.truncated) append(" · truncated")+ if (attachment.truncated) append(truncated)},style = MaterialTheme.typography.bodySmall,color = color.copy(alpha = 0.7f),diff --git a/app/src/main/java/com/gotcha/ui/CallChatWindow.kt b/app/src/main/java/com/gotcha/ui/CallChatWindow.ktindex 5270ae8..e65cefa 100644--- a/app/src/main/java/com/gotcha/ui/CallChatWindow.kt+++ b/app/src/main/java/com/gotcha/ui/CallChatWindow.kt@@ -24,6 +24,7 @@ import android.widget.FrameLayoutimport android.widget.LinearLayoutimport android.widget.TextViewimport androidx.core.graphics.ColorUtils+import com.gotcha.Rimport com.gotcha.data.SettingsRepositoryimport com.gotcha.service.CallStateimport com.gotcha.ui.theme.Skins@@ -264,11 +265,11 @@ class CallChatWindow(context: Context) {private fun updateStatusPillAndRing(s: CallState) {val pill = statusPill as? TextView ?: returnval (text, ringColor) = when (s) {- CallState.STARTING -> "✨ Connecting…" to Color.parseColor("#00E5FF")- CallState.LISTENING -> "🎙️ Listening…" to Color.parseColor("#00E5FF")- CallState.THINKING -> "🧠 Processing…" to Color.parseColor("#7C4DFF")- CallState.SPEAKING -> "🔊 Replying…" to Color.parseColor("#00E676")- CallState.WAITING_USER -> "❓ Awaiting input…" to Color.parseColor("#FFD600")+ CallState.STARTING -> appContext.getString(R.string.call_status_connecting) to Color.parseColor("#00E5FF")+ CallState.LISTENING -> appContext.getString(R.string.call_status_listening) to Color.parseColor("#00E5FF")+ CallState.THINKING -> appContext.getString(R.string.call_status_processing) to Color.parseColor("#7C4DFF")+ CallState.SPEAKING -> appContext.getString(R.string.call_status_replying) to Color.parseColor("#00E676")+ CallState.WAITING_USER -> appContext.getString(R.string.call_status_awaiting_input) to Color.parseColor("#FFD600")else -> null to null}if (text != null) {diff --git a/app/src/main/java/com/gotcha/ui/ChatTransferController.kt b/app/src/main/java/com/gotcha/ui/ChatTransferController.ktindex e6d7c64..ca2acfe 100644--- a/app/src/main/java/com/gotcha/ui/ChatTransferController.kt+++ b/app/src/main/java/com/gotcha/ui/ChatTransferController.kt@@ -28,8 +28,11 @@ import androidx.compose.runtime.saveable.rememberSaveableimport androidx.compose.runtime.setValueimport androidx.compose.ui.Alignmentimport androidx.compose.ui.Modifier+import androidx.compose.ui.res.pluralStringResource+import androidx.compose.ui.res.stringResourceimport androidx.compose.ui.semantics.Roleimport androidx.compose.ui.unit.dp+import com.gotcha.Rimport com.gotcha.agent.BackupRequestimport com.gotcha.agent.ChatTransferStateimport com.gotcha.agent.ChatViewModel@@ -145,14 +148,14 @@ fun ChatTransferDialogs(Text(state.summary)state.details.forEach { detail ->Text(- "• $detail",+ stringResource(R.string.bullet_item, detail),style = MaterialTheme.typography.bodySmall,color = MaterialTheme.colorScheme.onSurfaceVariant)}}},- confirmButton = { TextButton(onClick = onDismiss) { Text("OK") } }+ confirmButton = { TextButton(onClick = onDismiss) { Text(stringResource(R.string.chat_transfer_ok)) } })}}@@ -171,13 +174,17 @@ private fun BackupOptionsDialog(var includeImages by rememberSaveable { mutableStateOf(true) }SkinAlertDialog(onDismissRequest = onDismiss,- title = { Text(if (allChats) "Back up all chats" else "Back up this chat") },+ title = {+ Text(+ stringResource(+ if (allChats) R.string.chat_transfer_back_up_all_chats else R.string.chat_transfer_back_up_this_chat+ )+ )+ },text = {Column(verticalArrangement = Arrangement.spacedBy(12.dp)) {Text(- "The backup holds the whole conversation, including what tools returned: " +- "messages, contacts or text read from your screen. Anyone with the file " +- "can read it, so keep it somewhere private."+ stringResource(R.string.chat_transfer_the_backup_holds_the_whole))Row(verticalAlignment = Alignment.CenterVertically,@@ -186,12 +193,19 @@ private fun BackupOptionsDialog(.toggleable(value = includeImages, role = Role.Checkbox, onValueChange = { includeImages = it })) {Checkbox(checked = includeImages, onCheckedChange = null)- Text("Include images and screenshots", modifier = Modifier.padding(start = 8.dp))+ Text(+ stringResource(R.string.chat_transfer_include_images_and_screenshots),+ modifier = Modifier.padding(start = 8.dp)+ )}}},- confirmButton = { Button(onClick = { onConfirm(includeImages) }) { Text("Choose where to save") } },- dismissButton = { TextButton(onClick = onDismiss) { Text("Cancel") } }+ confirmButton = {+ Button(+ onClick = { onConfirm(includeImages) }+ ) { Text(stringResource(R.string.chat_transfer_choose_where_to_save)) }+ },+ dismissButton = { TextButton(onClick = onDismiss) { Text(stringResource(R.string.chat_transfer_cancel)) } })}@@ -205,7 +219,7 @@ private fun ImportPreviewDialog(val importable = preview.newCount + preview.conflictCountSkinAlertDialog(onDismissRequest = onDismiss,- title = { Text("Import chats") },+ title = { Text(stringResource(R.string.chat_transfer_import_chats)) },text = {Column(modifier = Modifier.heightIn(max = 420.dp).verticalScroll(rememberScrollState()),@@ -214,11 +228,7 @@ private fun ImportPreviewDialog(Text(importSummary(preview))if (preview.conflictCount > 0) {Text(- if (preview.conflictCount == 1) {- "1 chat is already here in a different version:"- } else {- "${preview.conflictCount} chats are already here in a different version:"- },+ pluralStringResource(R.plurals.import_conflicts, preview.conflictCount, preview.conflictCount),style = MaterialTheme.typography.labelLarge)DuplicateStrategy.entries.forEach { option ->@@ -233,20 +243,23 @@ private fun ImportPreviewDialog()) {RadioButton(selected = strategy == option, onClick = null)- Text(option.label, modifier = Modifier.padding(start = 8.dp))+ Text(stringResource(option.label), modifier = Modifier.padding(start = 8.dp))}}if (strategy == DuplicateStrategy.REPLACE && preview.format == ImportFormat.MARKDOWN) {Text(- "Replacing with a Markdown export drops the images and attachments your copy has.",+ stringResource(R.string.chat_transfer_replacing_with_a_markdown_export),style = MaterialTheme.typography.bodySmall,color = MaterialTheme.colorScheme.error)}}- (preview.rejected.map { "${it.title}: ${it.reason}" } + preview.warnings).forEach { note ->+ val notes = preview.rejected.map {+ stringResource(R.string.import_rejected_note, it.title, it.reason)+ } + preview.warnings+ notes.forEach { note ->Text(- "• $note",+ stringResource(R.string.bullet_item, note),style = MaterialTheme.typography.bodySmall,color = MaterialTheme.colorScheme.onSurfaceVariant)@@ -254,20 +267,29 @@ private fun ImportPreviewDialog(}},confirmButton = {- Button(onClick = { onConfirm(strategy) }, enabled = importable > 0) { Text("Import") }+ Button(+ onClick = { onConfirm(strategy) },+ enabled = importable > 0+ ) { Text(stringResource(R.string.chat_transfer_import)) }},- dismissButton = { TextButton(onClick = onDismiss) { Text("Cancel") } }+ dismissButton = { TextButton(onClick = onDismiss) { Text(stringResource(R.string.chat_transfer_cancel)) } })}+@Composableprivate fun importSummary(preview: ImportPreview): String {val total = preview.items.size + preview.rejected.size- val parts = listOfNotNull(- preview.newCount.takeIf { it > 0 }?.let { "$it new" },- preview.identicalCount.takeIf { it > 0 }?.let { "$it already here" },- preview.conflictCount.takeIf { it > 0 }?.let { "$it changed" },- preview.rejected.size.takeIf { it > 0 }?.let { "$it can't be read" }+ val parts = listOf(+ R.plurals.import_new to preview.newCount,+ R.plurals.import_identical to preview.identicalCount,+ R.plurals.import_changed to preview.conflictCount,+ R.plurals.import_unreadable to preview.rejected.size+ ).filter { (_, count) -> count > 0 }+ .map { (id, count) -> pluralStringResource(id, count, count) }+ return stringResource(+ R.string.import_summary,+ stringResource(preview.format.label),+ pluralStringResource(R.plurals.import_chats, total, total),+ parts.joinToString(", "))- val chats = if (total == 1) "1 chat" else "$total chats"- return "${preview.format.label}: $chats (${parts.joinToString(", ")})."}diff --git a/app/src/main/java/com/gotcha/ui/CodeBox.kt b/app/src/main/java/com/gotcha/ui/CodeBox.ktindex 7f531c3..8b6289a 100644--- a/app/src/main/java/com/gotcha/ui/CodeBox.kt+++ b/app/src/main/java/com/gotcha/ui/CodeBox.kt@@ -24,7 +24,9 @@ import androidx.compose.runtime.Composableimport androidx.compose.ui.Alignmentimport androidx.compose.ui.Modifierimport androidx.compose.ui.platform.LocalContext+import androidx.compose.ui.res.stringResourceimport androidx.compose.ui.unit.dp+import com.gotcha.Rimport com.gotcha.ui.theme.GotchaMonoimport com.gotcha.ui.theme.LocalSkinimport com.halilibo.richtext.markdown.Markdown@@ -78,7 +80,7 @@ fun CodeBox(code: String, language: String?, modifier: Modifier = Modifier) {contentDescription = null,modifier = Modifier.size(16.dp))- Text("Copy", modifier = Modifier.padding(start = 6.dp))+ Text(stringResource(R.string.code_box_copy), modifier = Modifier.padding(start = 6.dp))}}Text(@@ -97,5 +99,5 @@ fun CodeBox(code: String, language: String?, modifier: Modifier = Modifier) {private fun copyCode(context: Context, code: String) {val cm = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManagercm.setPrimaryClip(ClipData.newPlainText("Code", code))- Toast.makeText(context, "Copied", Toast.LENGTH_SHORT).show()+ Toast.makeText(context, context.getString(R.string.code_box_copied), Toast.LENGTH_SHORT).show()}diff --git a/app/src/main/java/com/gotcha/ui/ConfirmationOverlay.kt b/app/src/main/java/com/gotcha/ui/ConfirmationOverlay.ktindex d317dbf..9fad30c 100644--- a/app/src/main/java/com/gotcha/ui/ConfirmationOverlay.kt+++ b/app/src/main/java/com/gotcha/ui/ConfirmationOverlay.kt@@ -11,6 +11,7 @@ import android.view.Viewimport android.view.WindowManagerimport android.widget.LinearLayoutimport android.widget.TextView+import com.gotcha.Rimport com.gotcha.data.SettingsRepositoryimport com.gotcha.ui.theme.OverlaySkinimport com.gotcha.ui.theme.Skins@@ -42,9 +43,9 @@ class ConfirmationOverlay(context: Context) {summary: String,onAllow: () -> Unit,onDeny: () -> Unit,- title: String = "Gotcha — confirm action",- allowLabel: String = "Allow",- denyLabel: String = "Deny"+ title: String = appContext.getString(R.string.confirmation_title),+ allowLabel: String = appContext.getString(R.string.action_allow),+ denyLabel: String = appContext.getString(R.string.action_deny)) {mainHandler.post {removeView()diff --git a/app/src/main/java/com/gotcha/ui/FeedbackSheet.kt b/app/src/main/java/com/gotcha/ui/FeedbackSheet.ktindex 0d36b52..cd1144f 100644--- a/app/src/main/java/com/gotcha/ui/FeedbackSheet.kt+++ b/app/src/main/java/com/gotcha/ui/FeedbackSheet.kt@@ -15,7 +15,9 @@ import androidx.compose.runtime.rememberimport androidx.compose.runtime.setValueimport androidx.compose.ui.Alignmentimport androidx.compose.ui.Modifier+import androidx.compose.ui.res.stringResourceimport androidx.compose.ui.unit.dp+import com.gotcha.Rimport com.gotcha.ui.theme.SkinAlertDialog/**@@ -40,26 +42,31 @@ fun FeedbackSheet(SkinAlertDialog(onDismissRequest = onDismiss,- title = { Text("Send feedback") },+ title = { Text(stringResource(R.string.feedback_send_feedback)) },text = {Column {Text(- text = "If you provide successful feedback, after validation you may be " +- "eligible for 100 credits per feedback, up to 500 credits per day.",+ text = stringResource(R.string.feedback_if_you_provide_successful_feedback),style = MaterialTheme.typography.bodySmall,color = MaterialTheme.colorScheme.primary,modifier = Modifier.padding(bottom = 8.dp))- FeedbackToggle("App info (version, device, Android)", includeAppInfo) { includeAppInfo = it }- FeedbackToggle("Usage stats (chats, tool calls, runs)", includeUsageStats) { includeUsageStats = it }+ FeedbackToggle(stringResource(R.string.feedback_app_info_version_device_android), includeAppInfo) {+ includeAppInfo = it+ }+ FeedbackToggle(stringResource(R.string.feedback_usage_stats_chats_tool_calls), includeUsageStats) {+ includeUsageStats = it+ }FeedbackToggle(- "Chat log excerpt (recent chat, sized to fit the form)",+ stringResource(R.string.feedback_chat_log_excerpt_recent_chat),includeChatLog) { includeChatLog = it }- FeedbackToggle("User ID (for cross-checking your feedback)", includeUserId) { includeUserId = it }+ FeedbackToggle(+ stringResource(R.string.feedback_user_id_for_cross_checking),+ includeUserId+ ) { includeUserId = it }Text(- text = "This is pre-filled into the form — you can edit or remove anything before " +- "submitting. Nothing is sent until you press Submit in the form.",+ text = stringResource(R.string.feedback_this_is_pre_filled_into),style = MaterialTheme.typography.bodySmall,color = MaterialTheme.colorScheme.onSurfaceVariant,modifier = Modifier.padding(top = 8.dp)@@ -72,11 +79,11 @@ fun FeedbackSheet(onSubmit(includeAppInfo, includeUsageStats, includeChatLog, includeUserId)}) {- Text("Open form")+ Text(stringResource(R.string.feedback_open_form))}},dismissButton = {- TextButton(onClick = onDismiss) { Text("Cancel") }+ TextButton(onClick = onDismiss) { Text(stringResource(R.string.feedback_cancel)) }})}diff --git a/app/src/main/java/com/gotcha/ui/InboxScreen.kt b/app/src/main/java/com/gotcha/ui/InboxScreen.ktindex 9038e22..3b47f5c 100644--- a/app/src/main/java/com/gotcha/ui/InboxScreen.kt+++ b/app/src/main/java/com/gotcha/ui/InboxScreen.kt@@ -24,8 +24,10 @@ import androidx.compose.runtime.setValueimport androidx.compose.ui.Alignmentimport androidx.compose.ui.Modifierimport androidx.compose.ui.platform.testTag+import androidx.compose.ui.res.stringResourceimport androidx.compose.ui.text.style.TextOverflowimport androidx.compose.ui.unit.dp+import com.gotcha.Rimport com.gotcha.notifications.InboxEntry/**@@ -51,7 +53,7 @@ fun InboxScreen(LaunchedEffect(Unit) { onOpened() }SettingsScaffold(- title = "Notifications",+ title = stringResource(R.string.inbox_notifications),onBack = onBack,overlay = overlay,header = if (entries.isEmpty()) {@@ -62,15 +64,14 @@ fun InboxScreen(TextButton(onClick = { confirmClear = true },modifier = Modifier.testTag("inbox_clear")- ) { Text("Clear history") }+ ) { Text(stringResource(R.string.inbox_clear_history)) }}}}) {if (entries.isEmpty()) {Text(- "Nothing here yet. Reminders, daily tips, finished tasks and messages from " +- "Samosa AI are listed here for 30 days.",+ stringResource(R.string.inbox_nothing_here_yet_reminders_daily),style = MaterialTheme.typography.bodyMedium,color = MaterialTheme.colorScheme.onSurfaceVariant,modifier = Modifier.testTag("inbox_empty")@@ -82,9 +83,9 @@ fun InboxScreen(if (confirmClear) {AlertDialog(onDismissRequest = { confirmClear = false },- title = { Text("Clear notification history?") },+ title = { Text(stringResource(R.string.inbox_clear_notification_history)) },text = {- Text("This empties the list. Reminders Gotcha has already sent won't be sent again.")+ Text(stringResource(R.string.inbox_this_empties_the_list_reminders))},confirmButton = {TextButton(@@ -94,9 +95,13 @@ fun InboxScreen(confirmClear = false},modifier = Modifier.testTag("inbox_clear_confirm")- ) { Text("Clear") }+ ) { Text(stringResource(R.string.inbox_clear)) }},- dismissButton = { TextButton(onClick = { confirmClear = false }) { Text("Cancel") } }+ dismissButton = {+ TextButton(+ onClick = { confirmClear = false }+ ) { Text(stringResource(R.string.inbox_cancel)) }+ })}}@@ -120,7 +125,11 @@ private fun InboxRow(entry: InboxEntry, onClick: () -> Unit) {}Column(modifier = Modifier.weight(1f)) {Text(- "${entry.categoryOrNull?.label ?: "Notification"} · ${inboxTime(entry.postedAt)}",+ stringResource(+ R.string.inbox_entry_header,+ stringResource(entry.categoryOrNull?.label ?: R.string.inbox_notification),+ relativeTime(entry.postedAt)+ ),style = MaterialTheme.typography.labelSmall,color = scheme.onSurfaceVariant)@@ -141,14 +150,3 @@ private fun InboxRow(entry: InboxEntry, onClick: () -> Unit) {}}}--/** "just now", "5m ago", "3h ago", "2d ago". */-internal fun inboxTime(epochMillis: Long, now: Long = System.currentTimeMillis()): String {- val minutes = (now - epochMillis) / 60_000L- return when {- minutes < 1L -> "just now"- minutes < 60L -> "${minutes}m ago"- minutes < 24L * 60L -> "${minutes / 60L}h ago"- else -> "${minutes / (24L * 60L)}d ago"- }-}diff --git a/app/src/main/java/com/gotcha/ui/MessageBubble.kt b/app/src/main/java/com/gotcha/ui/MessageBubble.ktindex a656eca..b06006a 100644--- a/app/src/main/java/com/gotcha/ui/MessageBubble.kt+++ b/app/src/main/java/com/gotcha/ui/MessageBubble.kt@@ -49,10 +49,13 @@ import androidx.compose.ui.graphics.Colorimport androidx.compose.ui.graphics.asImageBitmapimport androidx.compose.ui.layout.ContentScaleimport androidx.compose.ui.platform.LocalContext+import androidx.compose.ui.res.pluralStringResource+import androidx.compose.ui.res.stringResourceimport androidx.compose.ui.text.font.FontFamilyimport androidx.compose.ui.text.font.FontWeightimport androidx.compose.ui.text.style.TextOverflowimport androidx.compose.ui.unit.dp+import com.gotcha.Rimport com.gotcha.agent.MessageKindimport com.gotcha.agent.UiMessageimport com.gotcha.ui.theme.GotchaMono@@ -154,7 +157,7 @@ fun MessageBubble(if (bitmap != null) {Image(bitmap = bitmap.asImageBitmap(),- contentDescription = "Attached image",+ contentDescription = stringResource(R.string.message_attached_image),modifier = Modifier.fillMaxWidth().height(160.dp)@@ -183,14 +186,14 @@ fun MessageBubble(verticalAlignment = Alignment.CenterVertically) {Text(- text = "💭 Reasoning process",+ text = stringResource(R.string.message_reasoning_process),style = MaterialTheme.typography.labelMedium,color = contentColor.copy(alpha = 0.7f))Spacer(modifier = Modifier.weight(1f))Icon(imageVector = if (reasoningExpanded) Icons.Default.ExpandLess else Icons.Default.ExpandMore,- contentDescription = "Toggle reasoning",+ contentDescription = stringResource(R.string.message_toggle_reasoning),modifier = Modifier.size(16.dp),tint = contentColor.copy(alpha = 0.7f))@@ -216,7 +219,13 @@ fun MessageBubble(if (isTool || isToolFailure) {ToolLedger(text = if (expanded.value) displayText else firstLine,- hint = if (!expanded.value && hasMore) "tap to expand" else null,+ hint = if (!expanded.value && hasMore) {+ stringResource(+ R.string.message_tap_to_expand+ )+ } else {+ null+ },railColor = if (isToolFailure) colors.error else colors.primary,contentColor = contentColor,collapsed = !expanded.value@@ -253,7 +262,9 @@ fun MessageBubble(} else {Icons.AutoMirrored.Rounded.VolumeUp},- contentDescription = if (isSpeaking) "Stop reading" else "Speak",+ contentDescription = stringResource(+ if (isSpeaking) R.string.message_stop_reading else R.string.message_speak+ ),modifier = Modifier.size(18.dp),tint = if (isSpeaking) {MaterialTheme.colorScheme.error@@ -273,14 +284,14 @@ fun MessageBubble() {if (isUser) {DropdownMenuItem(- text = { Text("Edit message") },+ text = { Text(stringResource(R.string.message_edit_message)) },onClick = {showMenu = falseonEdit(message)})DropdownMenuItem(- text = { Text("Revert to this message") },+ text = { Text(stringResource(R.string.message_revert_to_this_message)) },onClick = {showMenu = falseonRevert(message)@@ -288,14 +299,14 @@ fun MessageBubble()}DropdownMenuItem(- text = { Text("Copy as text") },+ text = { Text(stringResource(R.string.message_copy_as_text)) },onClick = {copyPlainText(context, message.text, isTool || isSubAgent)showMenu = false})DropdownMenuItem(- text = { Text("Copy as markdown") },+ text = { Text(stringResource(R.string.message_copy_as_markdown)) },onClick = {copyMarkdown(context, message.text, isTool || isSubAgent)showMenu = false@@ -361,7 +372,7 @@ private fun ToolLedger() {val softCap = 8192val display = if (!collapsed && text.length > softCap) {- text.take(softCap) + "\n…truncated ${text.length - softCap} chars — Copy as text for full output"+ text.take(softCap) + "\n" + stringResource(R.string.message_truncated, text.length - softCap)} else {text}@@ -403,7 +414,7 @@ private fun SubAgentContent(verticalAlignment = Alignment.CenterVertically) {Text(- text = "⚡ General Agent",+ text = stringResource(R.string.message_general_agent),style = MaterialTheme.typography.labelLarge,fontWeight = FontWeight.Bold,color = contentColor@@ -411,7 +422,7 @@ private fun SubAgentContent(Spacer(modifier = Modifier.weight(1f))if (steps.isNotEmpty()) {Text(- text = "${steps.size} step${if (steps.size != 1) "s" else ""}",+ text = pluralStringResource(R.plurals.message_steps, steps.size, steps.size),style = MaterialTheme.typography.labelSmall,color = contentColor.copy(alpha = 0.6f))@@ -419,7 +430,9 @@ private fun SubAgentContent(}Icon(imageVector = if (expanded.value) Icons.Default.ExpandLess else Icons.Default.ExpandMore,- contentDescription = if (expanded.value) "Collapse" else "Expand",+ contentDescription = stringResource(+ if (expanded.value) R.string.message_collapse else R.string.message_expand+ ),modifier = Modifier.size(20.dp),tint = contentColor.copy(alpha = 0.7f))@@ -480,14 +493,14 @@ private fun copyPlainText(context: Context, text: String, isTool: Boolean) {val plain = stripMarkdown(source)val cm = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManagercm.setPrimaryClip(ClipData.newPlainText("Gotcha", plain))- Toast.makeText(context, "Copied as plain text", Toast.LENGTH_SHORT).show()+ Toast.makeText(context, context.getString(R.string.message_copied_as_plain_text), Toast.LENGTH_SHORT).show()}private fun copyMarkdown(context: Context, text: String, isTool: Boolean) {val source = if (isTool) text else textval cm = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManagercm.setPrimaryClip(ClipData.newPlainText("Gotcha (Markdown)", source))- Toast.makeText(context, "Copied as markdown", Toast.LENGTH_SHORT).show()+ Toast.makeText(context, context.getString(R.string.message_copied_as_markdown), Toast.LENGTH_SHORT).show()}private fun stripMarkdown(md: String): String {diff --git a/app/src/main/java/com/gotcha/ui/NotificationDetailDialog.kt b/app/src/main/java/com/gotcha/ui/NotificationDetailDialog.ktindex 8e2664a..d24a783 100644--- a/app/src/main/java/com/gotcha/ui/NotificationDetailDialog.kt+++ b/app/src/main/java/com/gotcha/ui/NotificationDetailDialog.kt@@ -14,7 +14,9 @@ import androidx.compose.material3.TextButtonimport androidx.compose.runtime.Composableimport androidx.compose.ui.Modifierimport androidx.compose.ui.platform.LocalContext+import androidx.compose.ui.res.stringResourceimport androidx.compose.ui.unit.dp+import com.gotcha.Rimport com.gotcha.notifications.NotificationPayloadimport com.gotcha.ui.theme.SkinAlertDialog@@ -62,11 +64,11 @@ fun NotificationDetailDialog(} catch (_: Exception) {}}) {- Text("Open Link")+ Text(stringResource(R.string.notification_detail_open_link))}} else {Button(onClick = onDismiss) {- Text("OK")+ Text(stringResource(R.string.notification_detail_ok))}}},@@ -74,7 +76,7 @@ fun NotificationDetailDialog(val hasValidUrl = !payload.url.isNullOrBlank() && payload.url.startsWith("https://")if (hasValidUrl) {TextButton(onClick = onDismiss) {- Text("Close")+ Text(stringResource(R.string.notification_detail_close))}}}diff --git a/app/src/main/java/com/gotcha/ui/NotificationsScreen.kt b/app/src/main/java/com/gotcha/ui/NotificationsScreen.ktindex ca3efb6..5907432 100644--- a/app/src/main/java/com/gotcha/ui/NotificationsScreen.kt+++ b/app/src/main/java/com/gotcha/ui/NotificationsScreen.kt@@ -3,7 +3,6 @@ package com.gotcha.uiimport android.content.Intentimport android.content.pm.PackageManagerimport android.os.Build-import android.text.format.DateUtilsimport androidx.activity.compose.rememberLauncherForActivityResultimport androidx.activity.result.contract.ActivityResultContractsimport androidx.compose.foundation.layout.Column@@ -278,13 +277,9 @@ private fun CompletionPreviewRow(}}-/** "never", or Android's own "5 minutes ago" in the display language. */+/** "never", or how long ago, in the display language. */@Composableprivate fun formatRelative(epochMillis: Long): String {if (epochMillis <= 0L) return stringResource(R.string.notifications_never_synced)- return DateUtils.getRelativeTimeSpanString(- epochMillis,- System.currentTimeMillis(),- DateUtils.MINUTE_IN_MILLIS- ).toString()+ return relativeTime(epochMillis)}diff --git a/app/src/main/java/com/gotcha/ui/QuestionDialog.kt b/app/src/main/java/com/gotcha/ui/QuestionDialog.ktindex 2b8b1af..a5443c3 100644--- a/app/src/main/java/com/gotcha/ui/QuestionDialog.kt+++ b/app/src/main/java/com/gotcha/ui/QuestionDialog.kt@@ -15,12 +15,12 @@ import androidx.compose.runtime.mutableStateOfimport androidx.compose.runtime.rememberimport androidx.compose.runtime.setValueimport androidx.compose.ui.Modifier+import androidx.compose.ui.res.stringResourceimport androidx.compose.ui.unit.dp+import com.gotcha.Rimport com.gotcha.agent.PendingQuestionimport com.gotcha.ui.theme.SkinAlertDialog-const val QUESTION_DIALOG_TITLE = "Gotcha has a question"-/*** The agent's question to the user (the `question` tool). The question can run* to several paragraphs with steps and commands, so it is Markdown in the@@ -33,7 +33,7 @@ fun QuestionDialog(pending: PendingQuestion, onAnswer: (String?) -> Unit) {var customAnswer by remember(pending) { mutableStateOf("") }SkinAlertDialog(onDismissRequest = { onAnswer(null) },- title = { Text(QUESTION_DIALOG_TITLE) },+ title = { Text(stringResource(R.string.question_dialog_title)) },text = {Column(modifier = Modifier.verticalScroll(rememberScrollState()),@@ -49,7 +49,7 @@ fun QuestionDialog(pending: PendingQuestion, onAnswer: (String?) -> Unit) {OutlinedTextField(value = customAnswer,onValueChange = { customAnswer = it },- label = { Text("Your answer") },+ label = { Text(stringResource(R.string.question_your_answer)) },modifier = Modifier.fillMaxWidth())Button(@@ -57,11 +57,11 @@ fun QuestionDialog(pending: PendingQuestion, onAnswer: (String?) -> Unit) {enabled = customAnswer.isNotBlank(),modifier = Modifier.fillMaxWidth()) {- Text("Submit")+ Text(stringResource(R.string.question_submit))}}}},- confirmButton = { TextButton(onClick = { onAnswer(null) }) { Text("Skip") } }+ confirmButton = { TextButton(onClick = { onAnswer(null) }) { Text(stringResource(R.string.question_skip)) } })}diff --git a/app/src/main/java/com/gotcha/ui/ReferralInviteDialog.kt b/app/src/main/java/com/gotcha/ui/ReferralInviteDialog.ktindex c173aea..ba480ff 100644--- a/app/src/main/java/com/gotcha/ui/ReferralInviteDialog.kt+++ b/app/src/main/java/com/gotcha/ui/ReferralInviteDialog.kt@@ -20,8 +20,10 @@ import androidx.compose.runtime.rememberimport androidx.compose.runtime.setValueimport androidx.compose.ui.Alignmentimport androidx.compose.ui.Modifier+import androidx.compose.ui.res.stringResourceimport androidx.compose.ui.text.font.FontWeightimport androidx.compose.ui.unit.dp+import com.gotcha.Rimport com.gotcha.ui.theme.SkinAlertDialog/**@@ -42,7 +44,7 @@ fun ReferralInviteDialog(onDismissRequest = { if (!busy) onSkip() },title = {Text(- text = "🎁 Have an Invite Code?",+ text = stringResource(R.string.referral_invite_have_an_invite_code),style = MaterialTheme.typography.titleLarge,fontWeight = FontWeight.Bold)@@ -53,7 +55,7 @@ fun ReferralInviteDialog(verticalArrangement = Arrangement.spacedBy(8.dp)) {Text(- text = "Enter a friend's code to earn bonus credits.",+ text = stringResource(R.string.referral_invite_enter_a_friend_s_code),style = MaterialTheme.typography.bodyMedium,color = MaterialTheme.colorScheme.onSurfaceVariant)@@ -63,8 +65,8 @@ fun ReferralInviteDialog(OutlinedTextField(value = codeText,onValueChange = { codeText = it.uppercase().trim() },- label = { Text("Invite Code (e.g. AIR-K9X2P7)") },- placeholder = { Text("AIR-XXXXXX") },+ label = { Text(stringResource(R.string.referral_invite_invite_code_e_g_air)) },+ placeholder = { Text(stringResource(R.string.referral_invite_air_xxxxxx)) },singleLine = true,enabled = !busy,modifier = Modifier.fillMaxWidth()@@ -94,10 +96,10 @@ fun ReferralInviteDialog(strokeWidth = 2.dp,color = MaterialTheme.colorScheme.onPrimary)- Text("Applying…")+ Text(stringResource(R.string.referral_invite_applying))}} else {- Text("Apply Code")+ Text(stringResource(R.string.referral_invite_apply_code))}}},@@ -106,7 +108,7 @@ fun ReferralInviteDialog(onClick = onSkip,enabled = !busy) {- Text("Skip")+ Text(stringResource(R.string.referral_invite_skip))}})diff --git a/app/src/main/java/com/gotcha/ui/RelativeTime.kt b/app/src/main/java/com/gotcha/ui/RelativeTime.ktnew file mode 100644index 0000000..5280ced--- /dev/null+++ b/app/src/main/java/com/gotcha/ui/RelativeTime.kt@@ -0,0 +1,23 @@+package com.gotcha.ui++import android.text.format.DateUtils+import androidx.compose.runtime.Composable+import androidx.compose.ui.res.stringResource+import com.gotcha.R++/**+ * "Just now" under a minute, then Android's own "5 min. ago", "3 hours ago",+ * "2 days ago" — in the app's display language either way.+ */+@Composable+fun relativeTime(epochMillis: Long, now: Long = System.currentTimeMillis()): String =+ if (now - epochMillis < DateUtils.MINUTE_IN_MILLIS) {+ stringResource(R.string.time_just_now)+ } else {+ DateUtils.getRelativeTimeSpanString(+ epochMillis,+ now,+ DateUtils.MINUTE_IN_MILLIS,+ DateUtils.FORMAT_ABBREV_RELATIVE+ ).toString()+ }diff --git a/app/src/main/java/com/gotcha/ui/ScreenCompanionPanelOverlay.kt b/app/src/main/java/com/gotcha/ui/ScreenCompanionPanelOverlay.ktindex f170aac..87a137b 100644--- a/app/src/main/java/com/gotcha/ui/ScreenCompanionPanelOverlay.kt+++ b/app/src/main/java/com/gotcha/ui/ScreenCompanionPanelOverlay.kt@@ -18,6 +18,7 @@ import android.widget.EditTextimport android.widget.LinearLayoutimport android.widget.ScrollViewimport android.widget.TextView+import com.gotcha.Rimport com.gotcha.data.SettingsRepositoryimport com.gotcha.ui.theme.OverlaySkinimport com.gotcha.ui.theme.Skins@@ -104,7 +105,7 @@ class ScreenCompanionPanelOverlay(private val context: Context) {setPadding(0, 0, 0, dp(12))}val titleText = TextView(appContext).apply {- text = "Screen Companion"+ text = context.getString(R.string.companion_panel_screen_companion)setTextColor(colors.onSurface)textSize = colors.titleSptypeface = Typeface.create(colors.sans, Typeface.BOLD)@@ -162,7 +163,7 @@ class ScreenCompanionPanelOverlay(private val context: Context) {chatContainer.addView(promptView)responseTextView = TextView(appContext).apply {- text = resultText ?: "Thinking..."+ text = resultText ?: context.getString(R.string.companion_panel_thinking)setTextColor(colors.onSurface)textSize = colors.bodySptypeface = colors.sans@@ -178,17 +179,21 @@ class ScreenCompanionPanelOverlay(private val context: Context) {orientation = LinearLayout.HORIZONTALsetPadding(0, 0, 0, dp(12))}- val copyChip = createChip("Copy").apply {+ val copyChip = createChip(context.getString(R.string.action_copy)).apply {setOnClickListener {val text = responseTextView?.text?.toString()if (!text.isNullOrBlank()) {val cm = appContext.getSystemService(Context.CLIPBOARD_SERVICE) as android.content.ClipboardManagercm.setPrimaryClip(android.content.ClipData.newPlainText("Copied from Assistant", text))- android.widget.Toast.makeText(appContext, "Copied!", android.widget.Toast.LENGTH_SHORT).show()+ android.widget.Toast.makeText(+ appContext,+ context.getString(R.string.action_copied),+ android.widget.Toast.LENGTH_SHORT+ ).show()}}}- val shareChip = createChip("Share").apply {+ val shareChip = createChip(context.getString(R.string.action_share)).apply {setOnClickListener {val text = responseTextView?.text?.toString()if (!text.isNullOrBlank()) {@@ -197,7 +202,7 @@ class ScreenCompanionPanelOverlay(private val context: Context) {putExtra(android.content.Intent.EXTRA_TEXT, text)addFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK)}- val chooser = android.content.Intent.createChooser(intent, "Share")+ val chooser = android.content.Intent.createChooser(intent, context.getString(R.string.action_share))chooser.addFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK)appContext.startActivity(chooser)}@@ -218,7 +223,7 @@ class ScreenCompanionPanelOverlay(private val context: Context) {}val editText = EditText(appContext).apply {- hint = "Ask a follow-up..."+ hint = context.getString(R.string.companion_panel_follow_up_hint)setHintTextColor(colors.onSurfaceVariant)setTextColor(colors.onSurface)typeface = colors.sans@@ -247,7 +252,7 @@ class ScreenCompanionPanelOverlay(private val context: Context) {micButton = micBtnval sendButton = Button(appContext).apply {- text = "Send"+ text = context.getString(R.string.companion_panel_send)// Was Color.CYAN — Deep Space, from before there was a second theme.setTextColor(colors.accent)typeface = colors.sansdiff --git a/app/src/main/java/com/gotcha/ui/SharePosterSheet.kt b/app/src/main/java/com/gotcha/ui/SharePosterSheet.ktindex ba238ff..c660006 100644--- a/app/src/main/java/com/gotcha/ui/SharePosterSheet.kt+++ b/app/src/main/java/com/gotcha/ui/SharePosterSheet.kt@@ -22,8 +22,11 @@ import androidx.compose.ui.Alignmentimport androidx.compose.ui.Modifierimport androidx.compose.ui.graphics.asImageBitmapimport androidx.compose.ui.layout.ContentScale+import androidx.compose.ui.res.pluralStringResource+import androidx.compose.ui.res.stringResourceimport androidx.compose.ui.text.style.TextAlignimport androidx.compose.ui.unit.dp+import com.gotcha.Rimport com.gotcha.data.RunSummaryimport com.gotcha.ui.theme.SkinAlertDialog@@ -52,7 +55,7 @@ fun SharePosterSheet(onDismissRequest = { if (!loading) onDismiss() },title = {Text(- if (runs.size == 1) "Share this moment" else "Share your ${runs.size} moments"+ pluralStringResource(R.plurals.share_poster_title, runs.size, runs.size))},text = {@@ -63,7 +66,7 @@ fun SharePosterSheet(verticalArrangement = Arrangement.spacedBy(12.dp)) {Text(- "Turn what Gotcha just did into a shareable Instagram poster.",+ stringResource(R.string.share_poster_turn_what_gotcha_just_did),style = MaterialTheme.typography.bodyMedium)@@ -78,7 +81,7 @@ fun SharePosterSheet(CircularProgressIndicator()Spacer(modifier = Modifier.height(12.dp))Text(- "Writing your poster…",+ stringResource(R.string.share_poster_writing_your_poster),style = MaterialTheme.typography.bodySmall)}@@ -86,7 +89,7 @@ fun SharePosterSheet(preview != null -> {Image(bitmap = preview.asImageBitmap(),- contentDescription = "Your share poster",+ contentDescription = stringResource(R.string.share_poster_your_share_poster),modifier = Modifier.fillMaxWidth().height(340.dp),@@ -105,10 +108,10 @@ fun SharePosterSheet(horizontalArrangement = Arrangement.spacedBy(8.dp)) {Button(onClick = onShare, modifier = Modifier.weight(1f)) {- Text("Share")+ Text(stringResource(R.string.share_poster_share))}Button(onClick = onSave, modifier = Modifier.weight(1f)) {- Text("Save")+ Text(stringResource(R.string.share_poster_save))}}TextButton(@@ -116,7 +119,7 @@ fun SharePosterSheet(modifier = Modifier.align(Alignment.CenterHorizontally),enabled = !loading) {- Text("Regenerate")+ Text(stringResource(R.string.share_poster_regenerate))}}else -> {@@ -131,7 +134,7 @@ fun SharePosterSheet(onClick = onGenerate,modifier = Modifier.align(Alignment.CenterHorizontally)) {- Text("Generate poster")+ Text(stringResource(R.string.share_poster_generate_poster))}}}@@ -139,7 +142,7 @@ fun SharePosterSheet(},confirmButton = {if (preview == null && !loading) {- TextButton(onClick = onDismiss) { Text("Cancel") }+ TextButton(onClick = onDismiss) { Text(stringResource(R.string.share_poster_cancel)) }}})diff --git a/app/src/main/java/com/gotcha/ui/tour/TourOverlay.kt b/app/src/main/java/com/gotcha/ui/tour/TourOverlay.ktindex 518009e..344aaba 100644--- a/app/src/main/java/com/gotcha/ui/tour/TourOverlay.kt+++ b/app/src/main/java/com/gotcha/ui/tour/TourOverlay.kt@@ -46,6 +46,7 @@ import androidx.compose.ui.layout.onSizeChangedimport androidx.compose.ui.platform.LocalContextimport androidx.compose.ui.platform.LocalDensityimport androidx.compose.ui.platform.testTag+import androidx.compose.ui.res.stringResourceimport androidx.compose.ui.semantics.LiveRegionModeimport androidx.compose.ui.semantics.clearAndSetSemanticsimport androidx.compose.ui.semantics.liveRegion@@ -53,6 +54,7 @@ import androidx.compose.ui.semantics.semanticsimport androidx.compose.ui.text.font.FontWeightimport androidx.compose.ui.unit.IntOffsetimport androidx.compose.ui.unit.dp+import com.gotcha.Rimport com.gotcha.ui.openSpecialAccessimport com.gotcha.ui.theme.GotchaMonoimport kotlinx.coroutines.delay@@ -259,7 +261,7 @@ private fun Pulse(spotlight: Rect) {animation = tween(durationMillis = 1800, easing = LinearEasing),repeatMode = RepeatMode.Restart),- label = "tour_pulse_progress"+ label = stringResource(R.string.tour_tour_pulse_progress)).value} else {0f@@ -303,7 +305,7 @@ private fun CoachCard(verticalArrangement = Arrangement.spacedBy(6.dp)) {Text(- text = "STEP ${controller.stepNumber} OF ${controller.stepCount}",+ text = stringResource(R.string.tour_step_of, controller.stepNumber, controller.stepCount),style = MaterialTheme.typography.labelSmall,fontFamily = GotchaMono,color = MaterialTheme.colorScheme.primary@@ -347,7 +349,7 @@ private fun CoachCard(TextButton(onClick = { controller.cancel() },modifier = Modifier.testTag("tour_skip_all")- ) { Text("Skip tour") }+ ) { Text(stringResource(R.string.tour_skip_tour)) }if (step.ackLabel != null) {TextButton(onClick = { controller.acknowledge() },@@ -355,7 +357,7 @@ private fun CoachCard() { Text(step.ackLabel) }} else {Text(- text = "Waiting for you…",+ text = stringResource(R.string.tour_waiting_for_you),style = MaterialTheme.typography.labelMedium,color = MaterialTheme.colorScheme.onSurfaceVariant,modifier = Modifier.padding(end = 12.dp)diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xmlindex 739bdd8..5805df7 100644--- a/app/src/main/res/values/strings.xml+++ b/app/src/main/res/values/strings.xml@@ -709,4 +709,206 @@<item quantity="one">Refreshed %1$d connector: %2$s</item><item quantity="other">Refreshed %1$d connectors: %2$s</item></plurals>++ <!-- AppDrawer -->+ <string name="drawer_new_chat">New Chat</string>+ <string name="drawer_import_chats">Import chats</string>+ <string name="drawer_back_up_all_chats">Back up all chats</string>+ <string name="drawer_connectors">Connectors</string>+ <string name="drawer_settings">Settings</string>+ <string name="drawer_delete_chat">Delete Chat?</string>+ <string name="drawer_delete">Delete</string>+ <string name="drawer_cancel">Cancel</string>+ <string name="drawer_delete_chat_2">Delete chat</string>+ <string name="drawer_gotcha">Gotcha</string>+ <string name="drawer_recent_chats">Recent chats</string>+ <string name="drawer_sample_chat">Sample chat</string>++ <!-- InboxScreen -->+ <string name="inbox_clear_history">Clear history</string>+ <string name="inbox_clear_notification_history">Clear notification history?</string>+ <string name="inbox_this_empties_the_list_reminders">This empties the list. Reminders Gotcha has already sent won\'t be sent again.</string>+ <string name="inbox_clear">Clear</string>+ <string name="inbox_cancel">Cancel</string>+ <string name="inbox_notifications">Notifications</string>+ <string name="inbox_nothing_here_yet_reminders_daily">Nothing here yet. Reminders, daily tips, finished tasks and messages from Samosa AI are listed here for 30 days.</string>++ <!-- MessageBubble -->+ <string name="message_edit_message">Edit message</string>+ <string name="message_revert_to_this_message">Revert to this message</string>+ <string name="message_copy_as_text">Copy as text</string>+ <string name="message_copy_as_markdown">Copy as markdown</string>+ <string name="message_attached_image">Attached image</string>+ <string name="message_reasoning_process">💭 Reasoning process</string>+ <string name="message_toggle_reasoning">Toggle reasoning</string>+ <string name="message_general_agent">⚡ General Agent</string>+ <string name="message_copied_as_plain_text">Copied as plain text</string>+ <string name="message_copied_as_markdown">Copied as markdown</string>+ <string name="message_stop_reading">Stop reading</string>+ <string name="message_speak">Speak</string>+ <string name="message_collapse">Collapse</string>+ <string name="message_expand">Expand</string>++ <!-- ScreenCompanionPanelOverlay -->+ <string name="companion_panel_screen_companion">Screen Companion</string>+ <string name="companion_panel_send">Send</string>++ <!-- SharePosterSheet -->+ <string name="share_poster_share">Share</string>+ <string name="share_poster_save">Save</string>+ <string name="share_poster_regenerate">Regenerate</string>+ <string name="share_poster_generate_poster">Generate poster</string>+ <string name="share_poster_cancel">Cancel</string>+ <string name="share_poster_your_share_poster">Your share poster</string>+ <string name="share_poster_turn_what_gotcha_just_did">Turn what Gotcha just did into a shareable Instagram poster.</string>+ <string name="share_poster_writing_your_poster">Writing your poster…</string>++ <!-- FeedbackSheet -->+ <string name="feedback_send_feedback">Send feedback</string>+ <string name="feedback_open_form">Open form</string>+ <string name="feedback_cancel">Cancel</string>+ <string name="feedback_if_you_provide_successful_feedback">If you provide successful feedback, after validation you may be eligible for 100 credits per feedback, up to 500 credits per day.</string>+ <string name="feedback_this_is_pre_filled_into">This is pre-filled into the form — you can edit or remove anything before submitting. Nothing is sent until you press Submit in the form.</string>++ <!-- ChatTransferController -->+ <string name="chat_transfer_ok">OK</string>+ <string name="chat_transfer_include_images_and_screenshots">Include images and screenshots</string>+ <string name="chat_transfer_choose_where_to_save">Choose where to save</string>+ <string name="chat_transfer_cancel">Cancel</string>+ <string name="chat_transfer_import_chats">Import chats</string>+ <string name="chat_transfer_import">Import</string>+ <string name="chat_transfer_the_backup_holds_the_whole">The backup holds the whole conversation, including what tools returned: messages, contacts or text read from your screen. Anyone with the file can read it, so keep it somewhere private.</string>+ <string name="chat_transfer_replacing_with_a_markdown_export">Replacing with a Markdown export drops the images and attachments your copy has.</string>+ <string name="chat_transfer_back_up_all_chats">Back up all chats</string>+ <string name="chat_transfer_back_up_this_chat">Back up this chat</string>++ <!-- ReferralInviteDialog -->+ <string name="referral_invite_invite_code_e_g_air">Invite Code (e.g. AIR-K9X2P7)</string>+ <string name="referral_invite_air_xxxxxx">AIR-XXXXXX</string>+ <string name="referral_invite_applying">Applying…</string>+ <string name="referral_invite_apply_code">Apply Code</string>+ <string name="referral_invite_skip">Skip</string>+ <string name="referral_invite_have_an_invite_code">🎁 Have an Invite Code?</string>+ <string name="referral_invite_enter_a_friend_s_code">Enter a friend\'s code to earn bonus credits.</string>++ <!-- QuestionDialog -->+ <string name="question_your_answer">Your answer</string>+ <string name="question_submit">Submit</string>+ <string name="question_skip">Skip</string>++ <!-- CodeBox -->+ <string name="code_box_copy">Copy</string>+ <string name="code_box_copied">Copied</string>++ <!-- NotificationDetailDialog -->+ <string name="notification_detail_open_link">Open Link</string>+ <string name="notification_detail_ok">OK</string>+ <string name="notification_detail_close">Close</string>++ <!-- TourOverlay -->+ <string name="tour_skip_tour">Skip tour</string>+ <string name="tour_tour_pulse_progress">tour_pulse_progress</string>+ <string name="tour_waiting_for_you">Waiting for you…</string>++ <!-- Screen companion panel -->+ <string name="companion_panel_thinking">Thinking...</string>+ <string name="action_copy">Copy</string>+ <string name="action_copied">Copied!</string>+ <string name="action_share">Share</string>+ <string name="companion_panel_follow_up_hint">Ask a follow-up...</string>++ <!-- Drawer and inbox -->+ <string name="drawer_this_chat">this chat</string>+ <string name="drawer_delete_confirm">Are you sure you want to permanently delete \"%1$s\"? This action cannot be undone.</string>+ <string name="drawer_context_usage">%1$s / %2$s · %3$d%%</string>+ <string name="drawer_context_tokens">%1$s tokens</string>+ <string name="notification_category_unfinished_chat">Unfinished chat</string>+ <string name="notification_category_routine">Routine</string>+ <string name="notification_category_reminder">Reminder</string>+ <string name="notification_category_daily_tip">Daily tip</string>+ <string name="notification_category_task_finished">Task finished</string>+ <string name="notification_category_server">From Samosa AI</string>+ <string name="inbox_notification">Notification</string>+ <string name="inbox_entry_header">%1$s · %2$s</string>++ <!-- Relative time -->+ <string name="time_just_now">Just now</string>++ <!-- Message bubbles -->+ <string name="message_tap_to_expand">tap to expand</string>+ <string name="message_truncated">…truncated %1$d chars — Copy as text for full output</string>+ <plurals name="message_steps">+ <item quantity="one">%1$d step</item>+ <item quantity="other">%1$d steps</item>+ </plurals>++ <!-- FeedbackSheet -->+ <string name="feedback_app_info_version_device_android">App info (version, device, Android)</string>+ <string name="feedback_usage_stats_chats_tool_calls">Usage stats (chats, tool calls, runs)</string>+ <string name="feedback_user_id_for_cross_checking">User ID (for cross-checking your feedback)</string>+ <string name="feedback_chat_log_excerpt_recent_chat">Chat log excerpt (recent chat, sized to fit the form)</string>++ <!-- Share poster -->+ <plurals name="share_poster_title">+ <item quantity="one">Share this moment</item>+ <item quantity="other">Share your %1$d moments</item>+ </plurals>++ <!-- Chat import -->+ <string name="import_format_backup">Gotcha backup</string>+ <string name="import_format_chat_file">Gotcha chat file</string>+ <string name="import_format_markdown">Markdown chat export</string>+ <string name="import_strategy_keep_both">Keep both</string>+ <string name="import_strategy_replace">Replace mine</string>+ <string name="import_strategy_skip">Skip</string>+ <string name="import_summary">%1$s: %2$s (%3$s).</string>+ <string name="import_rejected_note">%1$s: %2$s</string>+ <string name="bullet_item">• %1$s</string>+ <plurals name="import_conflicts">+ <item quantity="one">%1$d chat is already here in a different version:</item>+ <item quantity="other">%1$d chats are already here in a different version:</item>+ </plurals>+ <plurals name="import_chats">+ <item quantity="one">%1$d chat</item>+ <item quantity="other">%1$d chats</item>+ </plurals>+ <plurals name="import_new">+ <item quantity="one">%1$d new</item>+ <item quantity="other">%1$d new</item>+ </plurals>+ <plurals name="import_identical">+ <item quantity="one">%1$d already here</item>+ <item quantity="other">%1$d already here</item>+ </plurals>+ <plurals name="import_changed">+ <item quantity="one">%1$d changed</item>+ <item quantity="other">%1$d changed</item>+ </plurals>+ <plurals name="import_unreadable">+ <item quantity="one">%1$d can\'t be read</item>+ <item quantity="other">%1$d can\'t be read</item>+ </plurals>++ <!-- Assistive ball overlay and confirmation -->+ <string name="assistive_ball_content_description">Gotcha assistive ball</string>+ <string name="action_close">Close</string>+ <string name="ball_open_app">Open App</string>+ <string name="ball_screenshot">Screenshot</string>+ <string name="ball_lens">Lens</string>+ <string name="confirmation_title">Gotcha — confirm action</string>+ <string name="action_allow">Allow</string>+ <string name="action_deny">Deny</string>+ <string name="question_dialog_title">Gotcha has a question</string>++ <!-- Call window, attachments, tour -->+ <string name="call_status_connecting">✨ Connecting…</string>+ <string name="call_status_listening">🎙️ Listening…</string>+ <string name="call_status_processing">🧠 Processing…</string>+ <string name="call_status_replying">🔊 Replying…</string>+ <string name="call_status_awaiting_input">❓ Awaiting input…</string>+ <string name="attachment_remove">Remove %1$s</string>+ <string name="attachment_count">%1$d / %2$d files</string>+ <string name="attachment_document">document</string>+ <string name="attachment_truncated"> · truncated</string>+ <string name="tour_step_of">STEP %1$d OF %2$d</string></resources>