Skip to content

Commit

Permalink
Add TOS and Privacy localizations
Browse files Browse the repository at this point in the history
  • Loading branch information
aarontitus committed Feb 22, 2024
1 parent b551f76 commit bb70187
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions app/src/main/java/com/crisiscleanup/MainActivityViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class MainActivityViewModel @Inject constructor(

if (!isAcceptingTerms) {
acceptTermsErrorMessage =
translator("~~You must check the box accepting the terms of service.")
translator("termsConditionsModal.must_check_box")
return
}

Expand All @@ -286,9 +286,9 @@ class MainActivityViewModel @Inject constructor(
accountDataRefresher.updateAcceptedTerms()
} else {
val errorMessage = if (networkMonitor.isOnline.first()) {
translator("~~Something went wrong. Please try again later.")
translator("termsConditionsModal.online_but_error")
} else {
translator("~~Connect to the internet and try again.")
translator("termsConditionsModal.offline_error")
}
acceptTermsErrorMessage = errorMessage
}
Expand Down
9 changes: 5 additions & 4 deletions app/src/main/java/com/crisiscleanup/ui/AcceptTermsView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ internal fun AcceptTermsView(
Box {
Column(modifier) {
Text(
t("~~Using the Crisis Cleanup mobile app requires agreement with the following terms."),
t("termsConditionsModal.must_agree_to_use_ccu"),
// TODO Common dimensions
Modifier
.padding(16.dp)
Expand Down Expand Up @@ -90,8 +90,9 @@ internal fun AcceptTermsView(
modifier = Modifier.testTag("acceptTermsAcceptToggle"),
enabled = enable,
)
val acceptText = t("~~I accept the terms of service from {terms_url}")
val acceptText = t("termsConditionsModal.accept_toc_privacy") //TODO: replace string {terms_url} and {privacy_url}, and render HTML. I embedded links in this localization.
.replace("{terms_url}", termsOfServiceUrl)
}
LinkifyUrlText(
acceptText,
Modifier.testTag("acceptTermsAcceptText"),
Expand Down Expand Up @@ -148,10 +149,10 @@ private fun ConfirmRejectTermsDialog(
) {
val t = LocalAppTranslator.current
CrisisCleanupAlertDialog(
title = t("~~Review decision"),
title = t("termsConditionsModal.are_you_sure"),
textContent = {
Text(
t("~~Rejecting the terms of service will log you out from the app. You will not be able to use the app unless you log back in and accept the terms of service."),
t("termsConditionsModal.if_reject_cannot_use"),
Modifier.testTag("rejectTermsConfirmText"),
)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class LoginWithPhoneViewModel @Inject constructor(

InitiatePhoneLoginResult.PhoneNotRegistered -> {
errorMessage =
translator("~~$phoneNumber is not registered. Enter a registered phone number and try again.")
translator("loginWithPhone.phone_number_not_registered") //TODO: Replace {phoneNumber} with $phoneNumber
}

else -> {
Expand Down

0 comments on commit bb70187

Please sign in to comment.