Add string resources for the PIN creation screen.

This commit is contained in:
jeffrey-signal
2026-05-27 14:01:29 -04:00
committed by Michelle Tang
parent b2f8445e1d
commit 4a2e2e0137
2 changed files with 21 additions and 5 deletions
@@ -34,6 +34,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.input.ImeAction
@@ -45,6 +46,7 @@ import androidx.compose.ui.unit.dp
import org.signal.core.ui.compose.AllDevicePreviews
import org.signal.core.ui.compose.Previews
import org.signal.core.ui.compose.SignalIcons
import org.signal.registration.R
import org.signal.registration.screens.attachDebugLogHelper
/**
@@ -72,7 +74,7 @@ fun PinCreationScreen(
Spacer(modifier = Modifier.height(32.dp))
Text(
text = "Create your PIN",
text = stringResource(R.string.PinCreationScreen__create_your_pin),
style = MaterialTheme.typography.headlineMedium,
textAlign = TextAlign.Start,
modifier = Modifier.fillMaxWidth().attachDebugLogHelper()
@@ -81,7 +83,7 @@ fun PinCreationScreen(
Spacer(modifier = Modifier.height(16.dp))
val descriptionText = buildAnnotatedString {
append("PINs can help you restore your account if you lose your phone. ")
append(stringResource(R.string.PinCreationScreen__pins_can_help))
pushStringAnnotation(tag = "LEARN_MORE", annotation = "learn_more")
withStyle(
style = SpanStyle(
@@ -89,7 +91,7 @@ fun PinCreationScreen(
textDecoration = TextDecoration.Underline
)
) {
append("Learn more")
append(stringResource(R.string.PinCreationScreen__learn_more))
}
pop()
}
@@ -154,7 +156,7 @@ fun PinCreationScreen(
modifier = Modifier.padding(end = 8.dp)
)
Text(
text = if (state.isAlphanumericKeyboard) "Switch to numeric" else "Switch to alphanumberic"
text = if (state.isAlphanumericKeyboard) stringResource(R.string.PinCreationScreen__switch_to_numeric) else stringResource(R.string.PinCreationScreen__switch_to_alphanumeric)
)
}
@@ -168,7 +170,7 @@ fun PinCreationScreen(
onClick = { onEvent(PinCreationScreenEvents.PinSubmitted(pin)) },
enabled = pin.length >= 4
) {
Text("Next")
Text(stringResource(R.string.PinCreationScreen__next))
}
}
@@ -310,4 +310,18 @@
<item quantity="one">You are now %1$d step away from submitting a debug log.</item>
<item quantity="other">You are now %1$d steps away from submitting a debug log.</item>
</plurals>
<!-- PIN creation screen title. -->
<string name="PinCreationScreen__create_your_pin">Create your PIN</string>
<!-- Describes the purpose of creating a Signal PIN. -->
<string name="PinCreationScreen__pins_can_help">PINs can help you restore your account if you lose your phone. </string>
<!-- Labels the button to learn more about Signal PINs. -->
<string name="PinCreationScreen__learn_more">Learn more</string>
<!-- Labels the button to switch to the numeric PIN keyboard type. -->
<string name="PinCreationScreen__switch_to_numeric">Switch to numeric</string>
<!-- Labels the button to switch to the alphanumeric PIN keyboard type. -->
<string name="PinCreationScreen__switch_to_alphanumeric">Switch to alphanumeric</string>
<!-- Labels the button to submit a new Signal PIN. -->
<string name="PinCreationScreen__next">Next</string>
</resources>