diff --git a/core/common/src/main/java/com/crisiscleanup/core/common/QueryParameter.kt b/core/common/src/main/java/com/crisiscleanup/core/common/QueryParameter.kt index 0ae4b4724..2ece48163 100644 --- a/core/common/src/main/java/com/crisiscleanup/core/common/QueryParameter.kt +++ b/core/common/src/main/java/com/crisiscleanup/core/common/QueryParameter.kt @@ -11,4 +11,4 @@ val Uri.queryParamMap: Map } } return params - } \ No newline at end of file + } diff --git a/feature/lists/src/main/kotlin/com/crisiscleanup/feature/crisiscleanuplists/ViewListViewModel.kt b/feature/lists/src/main/kotlin/com/crisiscleanup/feature/crisiscleanuplists/ViewListViewModel.kt index 939862150..ddcf15377 100644 --- a/feature/lists/src/main/kotlin/com/crisiscleanup/feature/crisiscleanuplists/ViewListViewModel.kt +++ b/feature/lists/src/main/kotlin/com/crisiscleanup/feature/crisiscleanuplists/ViewListViewModel.kt @@ -65,7 +65,7 @@ class ViewListViewModel @Inject constructor( .mapLatest { list -> if (list == EmptyList) { val listNotFound = - translator("~~List was not found. It is likely deleted.") + translator("list.not_found_deleted") return@mapLatest ViewListViewState.Error(listNotFound) } @@ -91,7 +91,7 @@ class ViewListViewModel @Inject constructor( return@map list.name } - translator("~~List") + translator("list.list") } .stateIn( scope = viewModelScope, @@ -175,19 +175,19 @@ class ViewListViewModel @Inject constructor( val cachedIncident = incidentsRepository.getIncident(targetIncidentId) if (cachedIncident == null) { openWorksiteError = - translator("~~This incident needs downloading.") + translator("list.incident_not_downloaded_error") } else { openWorksiteChangeIncident = cachedIncident pendingOpenWorksite = worksite changeIncidentConfirmMessage = - translator("~~Would you like to change to {incident_name} and open Case {case_number}?") + translator("list.change_incident_confirm") .replace("{incident_name}", cachedIncident.shortName) .replace("{case_number}", worksite.caseNumber) } } } else { openWorksiteError = - translator("~~Case {case_number} does not belong in Incident {incident_name}") + translator("list.case_number_not_in_this_incident") .replace("{case_number}", worksite.caseNumber) .replace("{incident_name}", list?.incident?.shortName ?: "") .trim() diff --git a/feature/lists/src/main/kotlin/com/crisiscleanup/feature/crisiscleanuplists/ui/ListsScreen.kt b/feature/lists/src/main/kotlin/com/crisiscleanup/feature/crisiscleanuplists/ui/ListsScreen.kt index 5629c0492..ad6d0ce19 100644 --- a/feature/lists/src/main/kotlin/com/crisiscleanup/feature/crisiscleanuplists/ui/ListsScreen.kt +++ b/feature/lists/src/main/kotlin/com/crisiscleanup/feature/crisiscleanuplists/ui/ListsScreen.kt @@ -84,8 +84,8 @@ internal fun ListsRoute( val allLists = viewModel.allLists.collectAsLazyPagingItems() val tabTitles = remember(incidentLists, allLists.itemCount) { - val incidentText = t("~~Incident") - val allText = t("~~All") + val incidentText = t("list.incident") + val allText = t("actions.all") val listCount = allLists.itemCount listOf( if (incidentLists.isEmpty()) incidentText else "$incidentText (${incidentLists.size})", @@ -101,7 +101,7 @@ internal fun ListsRoute( Column { TopAppBarBackCaretAction( - title = t("~~Lists"), + title = t("list.lists"), onAction = onBack, actions = { CrisisCleanupIconButton( @@ -217,8 +217,8 @@ internal fun ListsRoute( val dismissExplanation = { explainSupportList = EmptyList } // TODO Different title and message for list type none CrisisCleanupAlertDialog( - title = t("~~Unsupported list"), - text = t("~~{list_name} list is not yet supported on this app.") + title = t("list.unsupported_list_title"), + text = t("list.unsupported_list_explanation") .replace("{list_name}", explainSupportList.name), onDismissRequest = dismissExplanation, confirmButton = { @@ -232,9 +232,9 @@ internal fun ListsRoute( } if (showReadOnlyDescription) { - val readOnlyTitle = t("~~Lists are read-only") + val readOnlyTitle = t("list.list_read_only") val readOnlyDescription = - t("~~Lists (in this app) are currently read-only. Manage lists using Crisis Cleanup in a web browser.") + t("list.read_only_in_app_manage_on_web") CrisisCleanupAlertDialog( onDismissRequest = { showReadOnlyDescription = false }, title = readOnlyTitle, @@ -282,7 +282,7 @@ private fun IncidentListsView( if (incidentLists.isEmpty()) { item(key = "static-text") { Text( - t("~~No lists have been created for this Incident."), + t("list.no_lists_for_this_incident"), listItemModifier, ) } diff --git a/feature/lists/src/main/kotlin/com/crisiscleanup/feature/crisiscleanuplists/ui/ViewListScreen.kt b/feature/lists/src/main/kotlin/com/crisiscleanup/feature/crisiscleanuplists/ui/ViewListScreen.kt index 2d888e0bd..09603dba8 100644 --- a/feature/lists/src/main/kotlin/com/crisiscleanup/feature/crisiscleanuplists/ui/ViewListScreen.kt +++ b/feature/lists/src/main/kotlin/com/crisiscleanup/feature/crisiscleanuplists/ui/ViewListScreen.kt @@ -133,7 +133,7 @@ internal fun ViewListRoute( if (changeIncidentConfirmMessage.isNotBlank()) { val closeDialog = viewModel::clearChangeIncident CrisisCleanupAlertDialog( - title = t("~~Confirm change Incident"), + title = t("list.confirm_change_incident"), text = changeIncidentConfirmMessage, onDismissRequest = closeDialog, confirmButton = { @@ -165,7 +165,8 @@ private fun ListDetailsView( if (objectData.isEmpty()) { Text( - t("~~This list is not supported by the app or has no items."), + t("list.unsupported_list_explanation") + .replace("{list_name}", list.name), listItemModifier, ) } else { @@ -238,6 +239,7 @@ private fun ListDetailsView( ListModel.Worksite -> { worksiteItems( list.incident?.id ?: EmptyIncident.id, + list.incident?.shortName ?: "", objectData, setPhoneNumberList, onOpenWorksite, @@ -246,7 +248,7 @@ private fun ListDetailsView( else -> { item { - Text(t("~~This list is not supported by the app.")) + Text(t("list.not_supported_by_app")) } } } @@ -261,7 +263,7 @@ private fun MissingItem() { contentAlignment = Alignment.CenterStart, ) { Text( - LocalAppTranslator.current("~~Missing list data."), + LocalAppTranslator.current("list.missing_list_data"), ) } } @@ -372,6 +374,7 @@ private fun LazyListScope.userItems( private fun LazyListScope.worksiteItems( incidentId: Long, + incidentName: String, listData: List, showPhoneNumbers: (List) -> Unit, onOpenWorksite: (Worksite) -> Unit = {}, @@ -391,8 +394,9 @@ private fun LazyListScope.worksiteItems( contentAlignment = Alignment.CenterStart, ) { Text( - LocalAppTranslator.current("~~Case {case_number} is not under this Incident.") - .replace("{case_number}", worksite.caseNumber), + LocalAppTranslator.current("list.cannot_access_case_wrong_incident") + .replace("{case_number}", worksite.caseNumber) + .replace("{incident_name}", incidentName), ) } } else { diff --git a/feature/menu/src/main/java/com/crisiscleanup/feature/menu/MenuScreen.kt b/feature/menu/src/main/java/com/crisiscleanup/feature/menu/MenuScreen.kt index 4622a2725..cd07cfd48 100644 --- a/feature/menu/src/main/java/com/crisiscleanup/feature/menu/MenuScreen.kt +++ b/feature/menu/src/main/java/com/crisiscleanup/feature/menu/MenuScreen.kt @@ -144,7 +144,7 @@ internal fun MenuScreen( CrisisCleanupOutlinedButton( modifier = listItemModifier.actionHeight(), - text = t("~~Lists"), + text = t("list.lists"), onClick = openLists, enabled = true, )