Sync user status strings with Localazy and tidy formatting

# Conflicts:
#	libraries/ui-strings/src/main/res/values/temporary.xml
This commit is contained in:
ganfra
2026-07-16 16:23:08 +02:00
parent 06a903718b
commit 2a86c69b9d
20 changed files with 44 additions and 52 deletions
@@ -64,8 +64,8 @@ import io.element.android.libraries.designsystem.theme.unreadIndicator
import io.element.android.libraries.matrix.api.notification.CallIntent
import io.element.android.libraries.matrix.api.room.RoomNotificationMode
import io.element.android.libraries.matrix.api.user.DisplayedStatus
import io.element.android.libraries.matrix.ui.components.InviteSenderView
import io.element.android.libraries.matrix.ui.components.DisplayNameWithStatus
import io.element.android.libraries.matrix.ui.components.InviteSenderView
import io.element.android.libraries.matrix.ui.model.InviteSender
import io.element.android.libraries.matrix.ui.model.toEmojiText
import io.element.android.libraries.ui.strings.CommonStrings
@@ -315,7 +315,12 @@ private fun inReplyToInvalidContent(): InReplyToDetails.Ready = InReplyToDetails
)
),
textContent = "A text content",
senderProfile = ProfileDetails.Ready(displayName = "Sender", displayNameAmbiguous = false, avatarUrl = null)
senderProfile = ProfileDetails.Ready(
displayName = "Sender",
displayNameAmbiguous = false,
avatarUrl = null,
displayedStatus = null
)
)
private fun inReplyToTextContent(): InReplyToDetails.Ready = InReplyToDetails.Ready(
@@ -332,5 +337,10 @@ private fun inReplyToTextContent(): InReplyToDetails.Ready = InReplyToDetails.Re
)
),
textContent = "A text content",
senderProfile = ProfileDetails.Ready(displayName = "Sender", displayNameAmbiguous = false, avatarUrl = null)
senderProfile = ProfileDetails.Ready(
displayName = "Sender",
displayNameAmbiguous = false,
avatarUrl = null,
displayedStatus = null
)
)
@@ -32,9 +32,9 @@ sealed interface UserStatusPickerState {
}
enum class PredefinedUserStatus(val emoji: String, @StringRes val labelRes: Int) {
IN_A_MEETING("💬", R.string.common_user_status_in_a_meeting),
FOCUS_TIME("💡", R.string.common_user_status_focus_time),
ON_THE_ROAD("🚙", R.string.common_user_status_on_the_road),
BE_RIGHT_BACK("☕", R.string.common_user_status_be_right_back),
AWAY("🌴", R.string.common_user_status_away),
IN_A_MEETING("💬", R.string.screen_settings_user_status_in_a_meeting),
FOCUS_TIME("💡", R.string.screen_settings_user_status_focus_time),
ON_THE_ROAD("🚙", R.string.screen_settings_user_status_on_the_road),
BE_RIGHT_BACK("☕", R.string.screen_settings_user_status_be_right_back),
AWAY("🌴", R.string.screen_settings_user_status_away),
}
@@ -117,7 +117,7 @@ private fun EmptyStatusRow(
ListItem(
headlineContent = {
Text(
text = stringResource(R.string.screen_preferences_user_status_placeholder),
text = stringResource(R.string.screen_settings_user_status_placeholder),
modifier = Modifier.padding(vertical = 16.dp),
)
},
@@ -135,7 +135,7 @@ private fun CurrentStatusRow(
) {
val (emoji, text) = when (displayedStatus) {
is DisplayedStatus.UserSet -> displayedStatus.status.emoji to displayedStatus.status.text
is DisplayedStatus.InCall -> "🎧" to stringResource(R.string.common_user_status_on_a_call)
is DisplayedStatus.InCall -> "🎧" to stringResource(CommonStrings.common_on_a_call)
}
ListItem(
headlineContent = { Text(text = text, modifier = Modifier.padding(vertical = 16.dp)) },
@@ -210,7 +210,7 @@ private fun UserStatusPickerBottomSheet(
}
ListItem(
headlineContent = {
Text(text = stringResource(R.string.common_user_status_custom))
Text(text = stringResource(R.string.screen_settings_user_status_custom))
},
leadingContent = ListItemContent.Custom { EmojiText("✏️") },
onClick = {
@@ -249,7 +249,7 @@ private fun CustomStatusInputRow(
TextField(
modifier = Modifier.focusRequester(focusRequester),
state = textFieldState,
placeholder = stringResource(R.string.screen_preferences_user_status_custom_hint),
placeholder = stringResource(R.string.screen_settings_user_status_custom_hint),
inputTransformation = InputTransformation.maxLength(CUSTOM_STATUS_TEXT_MAX_LENGTH),
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Done),
onKeyboardAction = { if (hasChanges) onConfirm() },
@@ -101,6 +101,14 @@ If you proceed, some of your settings may change."</string>
<string name="screen_notification_settings_system_notifications_action_required_content_link">"system settings"</string>
<string name="screen_notification_settings_system_notifications_turned_off">"System notifications turned off"</string>
<string name="screen_notification_settings_title">"Notifications"</string>
<string name="screen_settings_user_status_away">"Away"</string>
<string name="screen_settings_user_status_be_right_back">"Be right back"</string>
<string name="screen_settings_user_status_custom">"Custom…"</string>
<string name="screen_settings_user_status_custom_hint">"Custom status…"</string>
<string name="screen_settings_user_status_focus_time">"Focus time"</string>
<string name="screen_settings_user_status_in_a_meeting">"In a meeting"</string>
<string name="screen_settings_user_status_on_the_road">"On the road"</string>
<string name="screen_settings_user_status_placeholder">"What\'s your status?"</string>
<string name="theme_black">"Black"</string>
<string name="theme_dark">"Dark"</string>
<string name="theme_light">"Light"</string>
@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2026 Element Creations Ltd.
~
~ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
~ Please see LICENSE files in the repository root for full details.
-->
<resources>
<string name="common_user_status_in_a_meeting">In a meeting</string>
<string name="common_user_status_focus_time">Focus time</string>
<string name="common_user_status_on_the_road">On the road</string>
<string name="common_user_status_be_right_back">Be right back</string>
<string name="common_user_status_away">Away</string>
<string name="common_user_status_on_a_call">On a call</string>
<string name="common_user_status_custom">Custom…</string>
<string name="screen_preferences_user_status_placeholder">What\'s your status?</string>
<string name="screen_preferences_user_status_custom_hint">Custom status…</string>
</resources>
@@ -552,7 +552,7 @@ private fun DmHeaderSection(
textAlign = TextAlign.Center,
)
val userStatus = otherMember.displayedStatus?.toText()
if(userStatus != null){
if (userStatus != null) {
Spacer(modifier = Modifier.height(12.dp))
Text(
text = userStatus,
@@ -269,7 +269,7 @@ private fun RoomMemberActionsBottomSheet(
.fillMaxWidth()
)
val userStatus = user.displayedStatus?.toText()
if(userStatus != null){
if (userStatus != null) {
Text(
text = userStatus,
style = ElementTheme.typography.fontBodyLgMedium,
@@ -30,7 +30,7 @@ object RoomMemberMapper {
role = mapRole(roomMember.suggestedRoleForPowerLevel, powerLevel),
membershipChangeReason = roomMember.membershipChangeReason,
isServiceMember = roomMember.isServiceMember,
//TODO map this value when available
// TODO map this value when available
displayedStatus = null,
)
}
@@ -75,7 +75,7 @@ fun RustProfileDetails.map(): ProfileDetails {
displayName = displayName,
displayNameAmbiguous = displayNameAmbiguous,
avatarUrl = avatarUrl,
//TODO map this value when available
// TODO map this value when available
displayedStatus = null,
)
}
@@ -17,7 +17,6 @@ import androidx.compose.ui.draw.clipToBounds
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontStyle
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import io.element.android.compound.theme.ElementTheme
@@ -18,7 +18,6 @@ import androidx.compose.foundation.layout.width
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clipToBounds
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.PreviewParameter
import androidx.compose.ui.unit.dp
@@ -29,7 +29,7 @@ open class MatrixUserProvider : PreviewParameterProvider<MatrixUser> {
get() = sequenceOf(
aMatrixUser(),
aMatrixUser(displayName = null),
aMatrixUser(displayedStatus = DisplayedStatus.InCall(0L) ),
aMatrixUser(displayedStatus = DisplayedStatus.InCall(0L)),
)
}
@@ -10,10 +10,10 @@ package io.element.android.libraries.matrix.ui.components
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import io.element.android.compound.theme.ElementTheme
import androidx.compose.ui.tooling.preview.PreviewParameter
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import io.element.android.compound.theme.ElementTheme
import io.element.android.libraries.designsystem.components.avatar.AvatarSize
import io.element.android.libraries.designsystem.preview.ElementPreview
import io.element.android.libraries.designsystem.preview.PreviewsDayNight
@@ -36,5 +36,4 @@ class RoomMemberProfilesCache {
fun getDisplayedStatus(userId: UserId): DisplayedStatus? {
return cache.value[userId]?.displayedStatus
}
}
@@ -10,7 +10,7 @@ package io.element.android.libraries.matrix.ui.model
import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource
import io.element.android.libraries.matrix.api.user.DisplayedStatus
import io.element.android.libraries.matrix.ui.R
import io.element.android.libraries.ui.strings.CommonStrings
fun DisplayedStatus.toEmojiText(): String = when (this) {
is DisplayedStatus.UserSet -> status.emoji
@@ -20,5 +20,5 @@ fun DisplayedStatus.toEmojiText(): String = when (this) {
@Composable
fun DisplayedStatus.toText(): String = when (this) {
is DisplayedStatus.UserSet -> "${status.emoji} ${status.text}"
is DisplayedStatus.InCall -> "🎧 ${stringResource(R.string.common_user_status_on_a_call)}"
is DisplayedStatus.InCall -> "🎧 ${stringResource(CommonStrings.common_on_a_call)}"
}
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2026 Element Creations Ltd.
~
~ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
~ Please see LICENSE files in the repository root for full details.
-->
<resources>
<string name="common_user_status_on_a_call">On a call</string>
</resources>
@@ -86,7 +86,7 @@ class MentionSpan(
displayText = formatter.formatDisplayText(type)
}
fun updateTrailingText(trailingText: String?){
fun updateTrailingText(trailingText: String?) {
this.trailingText = trailingText
}
@@ -23,6 +23,7 @@
<string name="a11y_join_call">"Join call"</string>
<string name="a11y_jump_to_bottom">"Jump to bottom"</string>
<string name="a11y_jump_to_unread">"Jump to unread"</string>
<string name="a11y_jump_to_unread_messages">"Jump to first unread message"</string>
<string name="a11y_move_the_map_to_my_location">"Move the map to my location"</string>
<string name="a11y_notifications_mentions_only">"Mentions only"</string>
<string name="a11y_notifications_muted">"Muted"</string>
@@ -143,6 +144,7 @@
<string name="action_manage_account_and_devices">"Manage account &amp; devices"</string>
<string name="action_manage_devices">"Manage devices"</string>
<string name="action_manage_rooms">"Manage rooms"</string>
<string name="action_mark_as_read">"Mark as read"</string>
<string name="action_message">"Message"</string>
<string name="action_minimize">"Minimise"</string>
<string name="action_next">"Next"</string>
@@ -516,6 +518,8 @@ Are you sure you want to continue?"</string>
<item quantity="other">"%1$d people"</item>
</plurals>
<string name="screen_live_location_sheet_title">"On the map"</string>
<string name="screen_local_network_opt_in_subtitle">"Your homeserver is on your local network. To connect, Element needs permission to reach devices on this network."</string>
<string name="screen_local_network_opt_in_title">"Allow access to local network"</string>
<string name="screen_media_picker_error_failed_selection">"Failed selecting media, please try again."</string>
<string name="screen_pinned_timeline_empty_state_description">"Press on a message and choose “%1$s” to include here."</string>
<string name="screen_pinned_timeline_empty_state_headline">"Pin important messages so that they can be easily discovered"</string>
+1
View File
@@ -330,6 +330,7 @@
"includeRegex" : [
"screen_advanced_settings_.*",
"screen\\.advanced_settings\\..*",
"screen\\.settings\\..*",
"screen_edit_profile_.*",
"screen_notification_settings_.*",
"screen\\.notification_settings\\..*",