BIT-304: Add Strings.xml and translations (#43)

This commit is contained in:
Ramsey Smith
2023-09-12 07:34:46 -06:00
committed by Álison Fernandes
parent a5691c88a2
commit f6c49920fa
70 changed files with 53558 additions and 85 deletions

View File

@@ -54,7 +54,7 @@ fun CreateAccountScreen(
modifier = Modifier
.weight(1f)
.padding(16.dp),
text = stringResource(id = R.string.title_create_account),
text = stringResource(id = R.string.create_account),
color = MaterialTheme.colorScheme.onPrimary,
style = MaterialTheme.typography.titleLarge,
)
@@ -64,14 +64,14 @@ fun CreateAccountScreen(
viewModel.trySendAction(CreateAccountAction.SubmitClick)
}
.padding(16.dp),
text = stringResource(id = R.string.button_submit),
text = stringResource(id = R.string.submit),
color = MaterialTheme.colorScheme.onPrimary,
style = MaterialTheme.typography.bodyMedium,
)
}
BitwardenTextField(label = stringResource(id = R.string.input_label_email))
BitwardenTextField(label = stringResource(id = R.string.input_label_master_password))
BitwardenTextField(label = stringResource(id = R.string.input_label_re_type_master_password))
BitwardenTextField(label = stringResource(id = R.string.input_label_master_password_hint))
BitwardenTextField(label = stringResource(id = R.string.email_address))
BitwardenTextField(label = stringResource(id = R.string.master_password))
BitwardenTextField(label = stringResource(id = R.string.retype_master_password))
BitwardenTextField(label = stringResource(id = R.string.master_password_hint))
}
}

View File

@@ -61,7 +61,7 @@ fun LandingScreen(
)
Text(
text = stringResource(id = R.string.log_in_or_create_account),
text = stringResource(id = R.string.login_or_create_new_account),
color = MaterialTheme.colorScheme.primary,
style = MaterialTheme.typography.headlineSmall,
modifier = Modifier
@@ -110,7 +110,7 @@ fun LandingScreen(
enabled = state.isContinueButtonEnabled,
) {
Text(
text = stringResource(id = R.string.continue_button),
text = stringResource(id = R.string.continue_text),
color = MaterialTheme.colorScheme.onPrimary,
style = MaterialTheme.typography.bodyMedium,
)

View File

@@ -77,14 +77,14 @@ fun LoginScreen(
enabled = state.isLoginButtonEnabled,
) {
Text(
text = stringResource(id = R.string.enterprise_single_sign_on),
text = stringResource(id = R.string.log_in_sso),
color = MaterialTheme.colorScheme.primary,
style = MaterialTheme.typography.bodyMedium,
)
}
// TODO Get the "login target" from a dropdown (BIT-202)
Text(
text = stringResource(id = R.string.logging_in_as, state.emailAddress),
text = stringResource(id = R.string.log_in_attempt_by_x_on_y, state.emailAddress, "bitwarden.com"),
color = MaterialTheme.colorScheme.primary,
style = MaterialTheme.typography.bodySmall,
)

View File

@@ -154,8 +154,8 @@ private sealed class VaultUnlockedNavBarTab : Parcelable {
@Parcelize
data object Generator : VaultUnlockedNavBarTab() {
override val iconRes get() = R.drawable.generator_icon
override val labelRes get() = R.string.generator_label
override val contentDescriptionRes get() = R.string.generator_tab_content_description
override val labelRes get() = R.string.generator
override val contentDescriptionRes get() = R.string.generator
override val route get() = GENERATOR_ROUTE
}
@@ -165,8 +165,8 @@ private sealed class VaultUnlockedNavBarTab : Parcelable {
@Parcelize
data object Send : VaultUnlockedNavBarTab() {
override val iconRes get() = R.drawable.send_icon
override val labelRes get() = R.string.send_label
override val contentDescriptionRes get() = R.string.send_tab_content_description
override val labelRes get() = R.string.send
override val contentDescriptionRes get() = R.string.send
override val route get() = SEND_ROUTE
}
@@ -176,8 +176,8 @@ private sealed class VaultUnlockedNavBarTab : Parcelable {
@Parcelize
data object Vault : VaultUnlockedNavBarTab() {
override val iconRes get() = R.drawable.sheild_icon
override val labelRes get() = R.string.vault_label
override val contentDescriptionRes get() = R.string.vault_tab_content_description
override val labelRes get() = R.string.my_vault
override val contentDescriptionRes get() = R.string.my_vault
override val route get() = VAULT_ROUTE
}
@@ -187,8 +187,8 @@ private sealed class VaultUnlockedNavBarTab : Parcelable {
@Parcelize
data object Settings : VaultUnlockedNavBarTab() {
override val iconRes get() = R.drawable.settings_icon
override val labelRes get() = R.string.settings_label
override val contentDescriptionRes get() = R.string.settings_tab_content_description
override val labelRes get() = R.string.settings
override val contentDescriptionRes get() = R.string.settings
override val route get() = SETTINGS_ROUTE
}
}

View File

@@ -57,7 +57,7 @@ fun GeneratorScreen() {
),
title = {
Text(
text = stringResource(id = R.string.generator_label),
text = stringResource(id = R.string.generator),
modifier = Modifier.fillMaxWidth(),
textAlign = TextAlign.Center,
)
@@ -82,7 +82,7 @@ private fun OverflowMenu() {
) {
Icon(
imageVector = Icons.Default.MoreVert,
contentDescription = stringResource(id = R.string.overflow_menu),
contentDescription = stringResource(id = R.string.options),
tint = MaterialTheme.colorScheme.onPrimary,
)
}
@@ -92,15 +92,15 @@ private fun OverflowMenu() {
private fun ScrollContent(modifier: Modifier = Modifier) {
LazyColumn(modifier = modifier.fillMaxSize()) {
item { DynamicStringItem() }
item { TextItem(title = stringResource(id = R.string.generation_prompt)) }
item { TextItem(title = stringResource(id = R.string.what_would_you_like_to_generate)) }
item { TextItem(title = stringResource(id = R.string.password_type), showOptions = true) }
item { LengthSliderItem() }
item { ToggleItem(stringResource(id = R.string.capital_letters_toggle_text)) }
item { ToggleItem(stringResource(id = R.string.lowercase_letters_toggle_text)) }
item { ToggleItem(stringResource(id = R.string.numbers_toggle_text)) }
item { ToggleItem(stringResource(id = R.string.special_characters_toggle_text)) }
item { CounterItem(label = stringResource(id = R.string.minimum_numbers)) }
item { CounterItem(label = stringResource(id = R.string.minimum_special)) }
item { ToggleItem(stringResource(id = R.string.uppercase_ato_z)) }
item { ToggleItem(stringResource(id = R.string.lowercase_ato_z)) }
item { ToggleItem(stringResource(id = R.string.numbers_zero_to_nine)) }
item { ToggleItem(stringResource(id = R.string.special_characters)) }
item { CounterItem(label = stringResource(id = R.string.min_numbers)) }
item { CounterItem(label = stringResource(id = R.string.min_special)) }
item { ToggleItem(stringResource(id = R.string.avoid_ambiguous_characters)) }
}
}
@@ -108,7 +108,7 @@ private fun ScrollContent(modifier: Modifier = Modifier) {
@Composable
private fun DynamicStringItem() {
// TODO(BIT-276): Move this state to ViewModel
val placeholderPassword = stringResource(id = R.string.placeholder_password)
val placeholderPassword = "PLACEHOLDER"
val dynamicString = remember { mutableStateOf(placeholderPassword) }
Box(modifier = Modifier.padding(horizontal = 16.dp)) {
@@ -137,7 +137,7 @@ private fun DynamicStringItem() {
) {
Icon(
imageVector = Icons.Default.Refresh,
contentDescription = stringResource(id = R.string.refresh),
contentDescription = stringResource(id = R.string.generate_password),
tint = MaterialTheme.colorScheme.primary,
)
}