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

Update the strings for unsupported calls #3857

Merged
merged 2 commits into from
Nov 12, 2024
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 @@ -7,45 +7,40 @@

package io.element.android.features.messages.impl.timeline.components.event

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.width
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import io.element.android.compound.theme.ElementTheme
import io.element.android.compound.tokens.generated.CompoundIcons
import io.element.android.features.messages.impl.R
import io.element.android.libraries.designsystem.preview.ElementPreview
import io.element.android.libraries.designsystem.preview.PreviewsDayNight
import io.element.android.libraries.designsystem.theme.components.Icon
import io.element.android.libraries.designsystem.theme.components.Text
import io.element.android.libraries.ui.strings.CommonStrings

@Composable
fun TimelineItemLegacyCallInviteView(
modifier: Modifier = Modifier,
) {
Row(
modifier = modifier,
horizontalArrangement = Arrangement.Center,
verticalAlignment = Alignment.CenterVertically
) {
Icon(
imageVector = CompoundIcons.VoiceCall(),
contentDescription = null,
tint = MaterialTheme.colorScheme.secondary,
tint = ElementTheme.colors.iconSecondary,
)
Spacer(modifier = Modifier.width(8.dp))
Text(
color = MaterialTheme.colorScheme.secondary,
color = ElementTheme.colors.textSecondary,
style = ElementTheme.typography.fontBodyMdRegular,
text = stringResource(CommonStrings.common_call_invite),
textAlign = TextAlign.Center,
text = stringResource(R.string.screen_room_timeline_legacy_call),
textAlign = TextAlign.Start,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class DefaultMessageSummaryFormatter @Inject constructor(
is TimelineItemVideoContent -> context.getString(CommonStrings.common_video)
is TimelineItemFileContent -> context.getString(CommonStrings.common_file)
is TimelineItemAudioContent -> context.getString(CommonStrings.common_audio)
is TimelineItemLegacyCallInviteContent -> context.getString(CommonStrings.common_call_invite)
is TimelineItemLegacyCallInviteContent -> context.getString(CommonStrings.common_unsupported_call)
is TimelineItemCallNotifyContent -> context.getString(CommonStrings.common_call_started)
}.take(MAX_SAFE_LENGTH)
}
Expand Down
1 change: 1 addition & 0 deletions features/messages/impl/src/main/res/values/localazy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<string name="screen_room_timeline_add_reaction">"Add emoji"</string>
<string name="screen_room_timeline_beginning_of_room">"This is the beginning of %1$s."</string>
<string name="screen_room_timeline_beginning_of_room_no_name">"This is the beginning of this conversation."</string>
<string name="screen_room_timeline_legacy_call">"Unsupported call. Ask if the caller can use the new Element X app."</string>
<string name="screen_room_timeline_less_reactions">"Show less"</string>
<string name="screen_room_timeline_message_copied">"Message copied"</string>
<string name="screen_room_timeline_no_permission_to_post">"You do not have permission to post to this room"</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class DefaultRoomLastMessageFormatter @Inject constructor(
val message = sp.getString(CommonStrings.common_unsupported_event)
message.prefixIfNeeded(senderDisambiguatedDisplayName, isDmRoom, isOutgoing)
}
is LegacyCallInviteContent -> sp.getString(CommonStrings.common_call_invite)
is LegacyCallInviteContent -> sp.getString(CommonStrings.common_unsupported_call)
is CallNotifyContent -> sp.getString(CommonStrings.common_call_started)
}?.take(MAX_SAFE_LENGTH)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,11 @@ class DefaultTimelineEventFormatter @Inject constructor(
is StateContent -> {
stateContentFormatter.format(content, senderDisambiguatedDisplayName, isOutgoing, RenderingMode.Timeline)
}
is LegacyCallInviteContent -> {
sp.getString(CommonStrings.common_call_invite)
}
is CallNotifyContent -> {
sp.getString(CommonStrings.common_call_started)
}
RedactedContent,
is LegacyCallInviteContent,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The case is CallNotifyContent should probably be moved here as well, but this is a bit out of scope of this PR.

is StickerContent,
is PollContent,
is UnableToDecryptContent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class DefaultNotifiableEventResolver @Inject constructor(
noisy = isNoisy,
timestamp = this.timestamp,
senderDisambiguatedDisplayName = getDisambiguatedDisplayName(content.senderId),
body = stringProvider.getString(CommonStrings.common_call_invite),
body = stringProvider.getString(CommonStrings.common_unsupported_call),
roomName = roomDisplayName,
roomIsDm = isDm,
roomAvatarPath = roomAvatarUrl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ class DefaultNotifiableEventResolverTest {
noisy = false,
timestamp = A_TIMESTAMP,
senderDisambiguatedDisplayName = A_USER_NAME_2,
body = "Call in progress (unsupported)",
body = "Unsupported call",
imageUriString = null,
imageMimeType = null,
threadId = null,
Expand Down
1 change: 1 addition & 0 deletions libraries/ui-strings/src/main/res/values/localazy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ Reason: %1$s."</string>
<string name="common_unable_to_invite_title">"Unable to send invite(s)"</string>
<string name="common_unlock">"Unlock"</string>
<string name="common_unmute">"Unmute"</string>
<string name="common_unsupported_call">"Unsupported call"</string>
<string name="common_unsupported_event">"Unsupported event"</string>
<string name="common_username">"Username"</string>
<string name="common_verification_cancelled">"Verification cancelled"</string>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions tools/localazy/checkForbiddenTerms.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
"screen_onboarding_welcome_title",
# Contains "Element Call"
"screen_incoming_call_subtitle_android",
# Contains "Element X"
"screen_room_timeline_legacy_call",
]
}

Expand Down
Loading