From 015d75d19a5f0939b9a1a569653bfb3f1524f58d Mon Sep 17 00:00:00 2001 From: Aaron Titus Date: Thu, 4 Jan 2024 21:20:31 -0700 Subject: [PATCH] Add android localizations --- .../feature/authentication/LoginWithPhoneViewModel.kt | 6 +++--- .../feature/authentication/OrgPersistentInviteViewModel.kt | 4 ++-- .../feature/authentication/PasteOrgInviteViewModel.kt | 2 +- .../feature/authentication/RequestOrgAccessViewModel.kt | 2 +- .../feature/authentication/ui/AuthComposables.kt | 2 +- .../feature/caseeditor/ui/EditExistingCaseScreen.kt | 4 ++-- .../feature/organizationmanage/InviteTeammateViewModel.kt | 4 ++-- .../feature/organizationmanage/ui/InviteTeammateScreen.kt | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/feature/authentication/src/main/java/com/crisiscleanup/feature/authentication/LoginWithPhoneViewModel.kt b/feature/authentication/src/main/java/com/crisiscleanup/feature/authentication/LoginWithPhoneViewModel.kt index 4e87b805d..1f6560587 100644 --- a/feature/authentication/src/main/java/com/crisiscleanup/feature/authentication/LoginWithPhoneViewModel.kt +++ b/feature/authentication/src/main/java/com/crisiscleanup/feature/authentication/LoginWithPhoneViewModel.kt @@ -141,7 +141,7 @@ class LoginWithPhoneViewModel @Inject constructor( } fun onIncompleteCode() { - errorMessage = translator("~~Enter a full phone code.") + errorMessage = translator("loginWithPhone.please_enter_full_phone") } fun requestPhoneCode(phoneNumber: String) { @@ -166,7 +166,7 @@ class LoginWithPhoneViewModel @Inject constructor( // TODO Be more specific // TODO Capture error and report to backend errorMessage = - translator("loginWithPhone.invalid_phone_unavailable_try_again") + translator("loginWithPhone.please_enter_full_code") } } finally { isRequestingCode.value = false @@ -300,7 +300,7 @@ class LoginWithPhoneViewModel @Inject constructor( } catch (e: Exception) { // TODO Be more specific on the failure where possible errorMessage = - translator("~~Check the phone number and code is correct. If login continues to fail try again later or request a new code.") + translator("loginWithPhone.check_number_try_again") } finally { isVerifyingCode.value = false } diff --git a/feature/authentication/src/main/java/com/crisiscleanup/feature/authentication/OrgPersistentInviteViewModel.kt b/feature/authentication/src/main/java/com/crisiscleanup/feature/authentication/OrgPersistentInviteViewModel.kt index 34d0183a2..e21337015 100644 --- a/feature/authentication/src/main/java/com/crisiscleanup/feature/authentication/OrgPersistentInviteViewModel.kt +++ b/feature/authentication/src/main/java/com/crisiscleanup/feature/authentication/OrgPersistentInviteViewModel.kt @@ -138,7 +138,7 @@ class OrgPersistentInviteViewModel @Inject constructor( } catch (e: Exception) { logger.logException(e) inviteFailMessage.value = - translator("~~There are issues with invitations. Please try again later.") + translator("persistentInvitations.invitation_error_try_again_later") } finally { isJoiningOrg.value = false } @@ -207,7 +207,7 @@ class OrgPersistentInviteViewModel @Inject constructor( } catch (e: Exception) { logger.logException(e) inviteFailMessage.value = - translator("~~There are issues with invitations. Please try again later.") + translator("persistentInvitations.invitation_error_try_again_later") } finally { isJoiningOrg.value = false } diff --git a/feature/authentication/src/main/java/com/crisiscleanup/feature/authentication/PasteOrgInviteViewModel.kt b/feature/authentication/src/main/java/com/crisiscleanup/feature/authentication/PasteOrgInviteViewModel.kt index b68cf6b46..cc6d3405b 100644 --- a/feature/authentication/src/main/java/com/crisiscleanup/feature/authentication/PasteOrgInviteViewModel.kt +++ b/feature/authentication/src/main/java/com/crisiscleanup/feature/authentication/PasteOrgInviteViewModel.kt @@ -69,7 +69,7 @@ class PasteOrgInviteViewModel @Inject constructor( } } catch (e: Exception) { inviteCodeError.value = - translator("~~Invites are not working at the moment. Please try again later.") + translator("pasteInvite.invite_not_working_try_again") logger.logException(e) } finally { isVerifyingCode.value = false diff --git a/feature/authentication/src/main/java/com/crisiscleanup/feature/authentication/RequestOrgAccessViewModel.kt b/feature/authentication/src/main/java/com/crisiscleanup/feature/authentication/RequestOrgAccessViewModel.kt index a4030d25a..ea54857fb 100644 --- a/feature/authentication/src/main/java/com/crisiscleanup/feature/authentication/RequestOrgAccessViewModel.kt +++ b/feature/authentication/src/main/java/com/crisiscleanup/feature/authentication/RequestOrgAccessViewModel.kt @@ -264,7 +264,7 @@ class RequestOrgAccessViewModel @Inject constructor( } } catch (e: Exception) { inviteInfoErrorMessage.value = - translator("~~Invite is not working at the moment. Please try again alter.") + translator("requestAccess.request_access_not_working") logger.logException(e) } finally { isRequestingInvite.value = false diff --git a/feature/authentication/src/main/java/com/crisiscleanup/feature/authentication/ui/AuthComposables.kt b/feature/authentication/src/main/java/com/crisiscleanup/feature/authentication/ui/AuthComposables.kt index 1854b99de..301a42f1d 100644 --- a/feature/authentication/src/main/java/com/crisiscleanup/feature/authentication/ui/AuthComposables.kt +++ b/feature/authentication/src/main/java/com/crisiscleanup/feature/authentication/ui/AuthComposables.kt @@ -80,7 +80,7 @@ fun LoginWithDifferentMethod( enabled = enabled, ) { val text = translator( - "~~Login using different method", + "loginForm.use_different_method", R.string.loginUsingDifferentMethod, ) Row( diff --git a/feature/caseeditor/src/main/java/com/crisiscleanup/feature/caseeditor/ui/EditExistingCaseScreen.kt b/feature/caseeditor/src/main/java/com/crisiscleanup/feature/caseeditor/ui/EditExistingCaseScreen.kt index 76749c191..9955b3d67 100644 --- a/feature/caseeditor/src/main/java/com/crisiscleanup/feature/caseeditor/ui/EditExistingCaseScreen.kt +++ b/feature/caseeditor/src/main/java/com/crisiscleanup/feature/caseeditor/ui/EditExistingCaseScreen.kt @@ -818,7 +818,7 @@ private fun LazyListScope.propertyInfoItems( Image( modifier = Modifier.size(24.dp), painter = painterResource(R.drawable.ic_jump_to_case_on_map), - contentDescription = LocalAppTranslator.current.translate("~~Center Case on map"), + contentDescription = LocalAppTranslator.current.translate("actions.jump_to_case"), ) if (distanceAwayText.isNotBlank()) { @@ -1121,7 +1121,7 @@ internal fun EditExistingCaseNotesView( ) { Icon( imageVector = CrisisCleanupIcons.CaretUp, - contentDescription = t("~~Scroll to top"), + contentDescription = t("actions.scroll_to_top"), ) } } diff --git a/feature/organizationmanage/src/main/java/com/crisiscleanup/feature/organizationmanage/InviteTeammateViewModel.kt b/feature/organizationmanage/src/main/java/com/crisiscleanup/feature/organizationmanage/InviteTeammateViewModel.kt index 49d2f7f82..b6b1a1090 100644 --- a/feature/organizationmanage/src/main/java/com/crisiscleanup/feature/organizationmanage/InviteTeammateViewModel.kt +++ b/feature/organizationmanage/src/main/java/com/crisiscleanup/feature/organizationmanage/InviteTeammateViewModel.kt @@ -599,7 +599,7 @@ class InviteTeammateViewModel @Inject constructor( sendInvites() } catch (e: Exception) { sendInviteErrorMessage.value = - translator("~~Invites are not working at the moment. Please try again later.") + translator("inviteTeammates.invite_error") logger.logException(e) } finally { isSendingInvite.value = false @@ -714,7 +714,7 @@ class InviteTeammateViewModel @Inject constructor( if (!isInviteSuccessful) { sendInviteErrorMessage.value = - translator("~~Invites are not working at the moment. Please try again later.") + translator("inviteTeammates.invite_error") } } } diff --git a/feature/organizationmanage/src/main/java/com/crisiscleanup/feature/organizationmanage/ui/InviteTeammateScreen.kt b/feature/organizationmanage/src/main/java/com/crisiscleanup/feature/organizationmanage/ui/InviteTeammateScreen.kt index 8487e5c40..d1050e9ae 100644 --- a/feature/organizationmanage/src/main/java/com/crisiscleanup/feature/organizationmanage/ui/InviteTeammateScreen.kt +++ b/feature/organizationmanage/src/main/java/com/crisiscleanup/feature/organizationmanage/ui/InviteTeammateScreen.kt @@ -188,7 +188,7 @@ fun InviteTeammateContent( }, ) { Text( - t("~~Invite new user via email invitation link"), + t("inviteTeammates.invite_new_user_via_email"), listItemModifier, style = LocalFontStyles.current.header4, ) @@ -513,7 +513,7 @@ private fun NewOrganizationInput( UserInfoErrorText(viewModel.selectedIncidentError) val incidentLookup by viewModel.incidentLookup.collectAsStateWithLifecycle() val selectedIncident = incidentLookup[viewModel.selectedIncidentId] ?: EmptyIncident - val selectIncidentHint = t("~~Select Incident") + val selectIncidentHint = t("actions.select_incident") val incidents by viewModel.incidents.collectAsStateWithLifecycle() Box( Modifier