feat(join by alias) : use localazy strings

This commit is contained in:
ganfra 2025-02-25 09:47:02 +01:00
parent cd0190fa2a
commit 57808aec46
4 changed files with 16 additions and 8 deletions

View file

@ -29,6 +29,7 @@ import androidx.compose.ui.text.input.KeyboardCapitalization
import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.tooling.preview.PreviewParameter
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import io.element.android.features.createroom.impl.R
import io.element.android.libraries.designsystem.preview.ElementPreview import io.element.android.libraries.designsystem.preview.ElementPreview
import io.element.android.libraries.designsystem.preview.PreviewsDayNight import io.element.android.libraries.designsystem.preview.PreviewsDayNight
import io.element.android.libraries.designsystem.theme.components.Button import io.element.android.libraries.designsystem.theme.components.Button
@ -97,13 +98,13 @@ private fun RoomAddressField(
TextField( TextField(
modifier = modifier.focusRequester(focusRequester), modifier = modifier.focusRequester(focusRequester),
value = address, value = address,
label = "Join room by address", label = stringResource(R.string.screen_start_chat_join_room_by_address_action),
placeholder = "Enter...", placeholder = stringResource(R.string.screen_start_chat_join_room_by_address_placeholder),
supportingText = when (addressState) { supportingText = when (addressState) {
RoomAddressState.Invalid -> "Not a valid address" RoomAddressState.Invalid -> stringResource(R.string.screen_start_chat_join_room_by_address_invalid_address)
is RoomAddressState.RoomFound -> "Matching room found" is RoomAddressState.RoomFound -> stringResource(R.string.screen_start_chat_join_room_by_address_room_found)
RoomAddressState.RoomNotFound -> "Room not found" RoomAddressState.RoomNotFound -> stringResource(R.string.screen_start_chat_join_room_by_address_room_not_found)
RoomAddressState.Unknown, RoomAddressState.Resolving -> "e.g. #room-name:matrix.org" RoomAddressState.Unknown, RoomAddressState.Resolving -> stringResource(R.string.screen_start_chat_join_room_by_address_supporting_text)
}, },
validity = when (addressState) { validity = when (addressState) {
RoomAddressState.Unknown, RoomAddressState.Resolving -> null RoomAddressState.Unknown, RoomAddressState.Resolving -> null

View file

@ -176,7 +176,7 @@ private fun CreateRoomActionButtonsList(
item { item {
CreateRoomActionButton( CreateRoomActionButton(
iconRes = CompoundDrawables.ic_compound_room, iconRes = CompoundDrawables.ic_compound_room,
text = "Join room by address", text = stringResource(R.string.screen_start_chat_join_room_by_address_action),
onClick = onJoinByAddressClick, onClick = onJoinByAddressClick,
) )
} }

View file

@ -20,4 +20,10 @@ You can change this anytime in room settings."</string>
<string name="screen_create_room_title">"Create a room"</string> <string name="screen_create_room_title">"Create a room"</string>
<string name="screen_create_room_topic_label">"Topic (optional)"</string> <string name="screen_create_room_topic_label">"Topic (optional)"</string>
<string name="screen_start_chat_error_starting_chat">"An error occurred when trying to start a chat"</string> <string name="screen_start_chat_error_starting_chat">"An error occurred when trying to start a chat"</string>
<string name="screen_start_chat_join_room_by_address_action">"Join room by address"</string>
<string name="screen_start_chat_join_room_by_address_invalid_address">"Not a valid address"</string>
<string name="screen_start_chat_join_room_by_address_placeholder">"Enter…"</string>
<string name="screen_start_chat_join_room_by_address_room_found">"Matching room found"</string>
<string name="screen_start_chat_join_room_by_address_room_not_found">"Room not found"</string>
<string name="screen_start_chat_join_room_by_address_supporting_text">"e.g. #room-name:matrix.org"</string>
</resources> </resources>

View file

@ -64,7 +64,8 @@
"includeRegex" : [ "includeRegex" : [
"screen_create_room_.*", "screen_create_room_.*",
"screen\\.create_room\\..*", "screen\\.create_room\\..*",
"screen_start_chat_.*" "screen_start_chat_.*",
"screen\\.start_chat\\..*"
] ]
}, },
{ {