Skip to content

fix(issues): Show 50+ Replays whenever the count is maxed out like that #80809

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

Merged
merged 1 commit into from
Nov 15, 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
11 changes: 7 additions & 4 deletions static/app/components/events/eventReplay/replayClipSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,13 @@ export function ReplayClipSection({event, group, replayId}: Props) {
replayCount && replayCount > 1 ? (
<Fragment>
<div>
{t(
'There are %s for this issue.',
tn('%s replay', '%s replays', replayCount ?? 0)
)}
Comment on lines -68 to -71
Copy link
Member Author

Choose a reason for hiding this comment

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

This was never the right way to translate the sentence. Using tn() inside a t()... or any other combination of nesting like that... is going to make it hard for translators and lead to bad translations.

{replayCount > 50
? t('There are 50+ replays fro this issue.')
: tn(
'There is %s replay for this issue.',
'there are %s replays for this issue.',
replayCount ?? 0
)}
</div>
{allReplaysButton}
</Fragment>
Expand Down
16 changes: 11 additions & 5 deletions static/app/views/issueDetails/groupReplays/groupReplays.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,17 @@ function GroupReplaysTable({
<StyledLayoutPage withPadding hasStreamlinedUI={hasStreamlinedUI}>
<ReplayCountHeader>
<IconUser size="sm" />
{t(
'There %s for this issue across %s.',
tn('is %s replay', 'are %s replays', replayCount ?? 0),
tn('%s event', '%s events', group.count)
)}
{replayCount ?? 0 > 50
? tn(
'There are 50+ replays for this issue across %s event',
'There are 50+ replays for this issue across %s events',
group.count
)
: t(
'There %s for this issue across %s.',
tn('is %s replay', 'are %s replays', replayCount ?? 0),
tn('%s event', '%s events', group.count)
)}
</ReplayCountHeader>
{inner}
</StyledLayoutPage>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,12 @@ export function IssueEventNavigation({event, group, query}: IssueEventNavigation
key: Tab.REPLAYS,
label: (
<DropdownCountWrapper isCurrentTab={currentTab === Tab.REPLAYS}>
{TabName[Tab.REPLAYS]} <ItemCount value={replaysCount} />
{TabName[Tab.REPLAYS]}{' '}
{replaysCount > 50 ? (
<CustomItemCount>50+</CustomItemCount>
) : (
<ItemCount value={replaysCount} />
)}
</DropdownCountWrapper>
),
textValue: TabName[Tab.REPLAYS],
Expand Down
4 changes: 3 additions & 1 deletion static/app/views/issueDetails/streamline/replayBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ export function ReplayBadge({group, project}: {group: Group; project: Project})
}}
aria-label={t("View this issue's replays")}
>
{tn('%s Replay', '%s Replays', replaysCount)}
{replaysCount > 50
? t('50+ Replays')
: tn('%s Replay', '%s Replays', replaysCount)}
</ReplayButton>
</Fragment>
);
Expand Down
Loading