Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various localizations #86

Merged
merged 2 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class PasswordRecoverViewModel @Inject constructor(
isPasswordResetInitiated.value = true
} else {
forgotPasswordErrorMessage.value = result.errorMessage.ifBlank {
translator("~~There was an issue with starting the reset password process. Try again later.")
translator("info.reset_password_start_error")
}
}
} finally {
Expand Down Expand Up @@ -137,7 +137,7 @@ class PasswordRecoverViewModel @Inject constructor(
isMagicLinkInitiated.value = true
} else {
magicLinkErrorMessage.value =
translator("~~There was an issue with sending a magic link. Try again later.")
translator("info.magic_link_error")
}
} finally {
isInitiatingMagicLink.value = false
Expand Down Expand Up @@ -182,7 +182,7 @@ class PasswordRecoverViewModel @Inject constructor(
clearState()
} else {
resetPasswordErrorMessage.value =
translator("~~There was an issue with reset password. Restart from Forgot Password or try again later.")
translator("info.reset_password_error")
}
} finally {
isResettingPassword.value = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fun PasswordRecoverRoute(
if (showForgotPassword) {
titleKey = "invitationSignup.forgot_password"
} else if (showResetPassword) {
titleKey = "~~Reset Password"
titleKey = "actions.reset_password"
}

val emailAddress by viewModel.emailAddress.collectAsStateWithLifecycle()
Expand Down Expand Up @@ -180,7 +180,7 @@ private fun ForgotPasswordView(
modifier = fillWidthPadded.testTag("forgotPasswordBtn"),
onClick = viewModel::onInitiatePasswordReset,
enabled = isEditable,
text = translator("~~Reset Password"),
text = translator("actions.reset_password"),
indicateBusy = isBusy,
)
}
Expand Down Expand Up @@ -279,7 +279,7 @@ private fun PasswordResetNotPossibleView() {
val translator = LocalAppTranslator.current

Text(
translator("~~Password reset is not possible. Retry Forgot Password again."),
translator("resetPassword.password_reset_not_possible"),
listItemModifier,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,15 @@ private fun NotAuthenticatedScreen(
.fillMaxWidth()
.testTag("loginLoginWithEmailBtn"),
onClick = openLoginWithEmail,
text = translator("~~Login with Email", R.string.loginWithEmail),
text = translator("loginForm.login_with_email", R.string.loginWithEmail),
)
BusyButton(
modifier = Modifier
.fillMaxWidth()
.testTag("loginLoginWithPhoneBtn"),
onClick = {},
enabled = false, // !isBusy,
text = translator("~~Login with Cell Phone", R.string.loginWithPhone),
text = translator("loginForm.login_with_cell", R.string.loginWithPhone),
)
CrisisCleanupOutlinedButton(
modifier = Modifier
Expand All @@ -192,7 +192,7 @@ private fun NotAuthenticatedScreen(
onClick = {},
enabled = false, // !isBusy,
text = translator(
"~~Volunteer with Your Org",
"actions.request_access",
R.string.volunteerWithYourOrg,
),
)
Expand All @@ -206,7 +206,7 @@ private fun NotAuthenticatedScreen(
},
enabled = true,
text = translator(
"~~I need help cleaning up",
"loginForm.need_help_cleaning_up",
R.string.iNeedHelpCleaningUp,
),
)
Expand All @@ -215,7 +215,7 @@ private fun NotAuthenticatedScreen(
Column(
modifier = fillWidthPadded,
) {
val linkText = translator("~~Register here", R.string.registerHere)
val linkText = translator("actions.register", R.string.registerHere)
val spannableString = SpannableString(linkText).apply {
setSpan(
URLSpan(registerHereLink),
Expand All @@ -227,7 +227,7 @@ private fun NotAuthenticatedScreen(
Text(
modifier = Modifier.testTag("loginReliefOrgAndGovText"),
text = translator(
"~~Relief organizations and government only.",
"publicNav.relief_orgs_only",
R.string.reliefOrgAndGovOnly,
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ class ExistingCaseViewModel @Inject constructor(
val messageTranslateKey = if (changedWorksite.isLocalFavorite) {
"caseView.member_my_org"
} else {
"~~Not member of my organization"
"actions.not_member_of_my_org"
}
actionDescriptionMessage.value = translate(messageTranslateKey)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ internal fun PhotosSection(
.size(24.dp)
.padding(4.dp),
imageVector = CrisisCleanupIcons.Cloud,
contentDescription = translator("~~Awaiting cloud sync"),
contentDescription = translator("info.awaiting_cloud_sync"),
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,8 @@ private fun LazyListScope.distanceOptions(
if (showRequestLocationPermission) {
item {
val translator = LocalAppTranslator.current
val messageKey = "~~Filtering by distance requires access to location"
val actionKey = "~~Grant access to location"
val messageKey = "info.distance_filter_requires_location"
val actionKey = "actions.grant_access_location"

Column(
listItemModifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ internal fun MenuScreen(
verticalAlignment = Alignment.CenterVertically,
) {
Text(
"~~Share analytics",
translator("actions.share_analytics"),
Modifier.weight(1f),
)
Switch(
Expand Down
Loading