Skip to content

Commit

Permalink
[MM-60824] Replace FormattedMarkdownMessage in 'webapp/channels/src/c…
Browse files Browse the repository at this point in the history
…omponents/leave_team_modal/leave_team_modal.tsx' with FormattedMessage (mattermost#28547)
  • Loading branch information
TheInvincibleRalph authored Oct 11, 2024
1 parent 2780b87 commit 7895000
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ exports[`components/LeaveTeamModal should render the leave team model 1`] = `
bsClass="modal-body"
componentClass="div"
>
<FormattedMarkdownMessage
defaultMessage="**You will be removed from {num_of_private_channels} private {num_of_private_channels,one {channel} other {channels}} on this team.** If the team is private you won't be able to rejoin it without an invitation from another team member. Are you sure?"
id="leave_team_modal_private.desc"
<MemoizedFormattedMessage
defaultMessage="<strong>You will be removed from {num_of_private_channels} private {num_of_private_channels,plural,one {channel} other {channels}} on this team.</strong> If the team is private you won't be able to rejoin it without an invitation from another team member. Are you sure?"
id="leave_team_modal_private.description"
values={
Object {
"num_of_private_channels": 0,
"num_of_public_channels": 0,
"strong": [Function],
}
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import type {UserProfile} from '@mattermost/types/users';

import * as UserUtils from 'mattermost-redux/utils/user_utils';

import FormattedMarkdownMessage from 'components/formatted_markdown_message';

import Constants from 'utils/constants';
import {isKeyPressed} from 'utils/keyboard';

Expand Down Expand Up @@ -83,66 +81,70 @@ export default class LeaveTeamModal extends React.PureComponent<Props, State> {
if (isGuest) {
if (numOfPublicChannels !== 0 && numOfPrivateChannels !== 0) {
modalMessage = (
<FormattedMarkdownMessage
id='leave_team_modal_guest.desc'
defaultMessage="** You will be removed from {num_of_public_channels} public { num_of_public_channels,plural,one {channel} other {channels}} and {num_of_private_channels} private { num_of_private_channels,plural,one {channel} other {channels}} on this team.** You won't be able to rejoin it without an invitation from another team member. Are you sure?"
<FormattedMessage
id='leave_team_modal_guest.description'
defaultMessage='<strong>You will be removed from {num_of_public_channels} public {num_of_public_channels,plural,one {channel} other {channels}} and {num_of_private_channels} private {num_of_private_channels,plural,one {channel} other {channels}} on this team.</strong> You won&apos;t be able to rejoin it without an invitation from another team member. Are you sure?'
values={{
num_of_public_channels: numOfPublicChannels,
num_of_private_channels: numOfPrivateChannels,
strong: (chunks: React.ReactNode) => <strong>{chunks}</strong>,
}}
/>
);
} else if (numOfPublicChannels === 0) {
modalMessage = (
<FormattedMarkdownMessage
id='leave_team_modal_guest_only_private.desc'
defaultMessage="** You will be removed from {num_of_private_channels} private { num_of_private_channels,plural,one {channel} other {channels}} on this team.** You won't be able to rejoin it without an invitation from another team member. Are you sure?"
<FormattedMessage
id='leave_team_modal_guest_only_private.description'
defaultMessage='<strong>You will be removed from {num_of_private_channels} private {num_of_private_channels,plural,one {channel} other {channels}} on this team.</strong> You won&apos;t be able to rejoin it without an invitation from another team member. Are you sure?'
values={{
num_of_public_channels: numOfPublicChannels,
num_of_private_channels: numOfPrivateChannels,
strong: (chunks: React.ReactNode) => <strong>{chunks}</strong>,
}}
/>
);
} else {
modalMessage = (
<FormattedMarkdownMessage
id='leave_team_modal_guest_only_public.desc'
defaultMessage="** You will be removed from {num_of_public_channels} public { num_of_public_channels,plural,one {channel} other {channels}} on this team.** You won't be able to rejoin it without an invitation from another team member. Are you sure?"
<FormattedMessage
id='leave_team_modal_guest_only_public.description'
defaultMessage='<strong>You will be removed from {num_of_public_channels} public {num_of_public_channels,plural,one {channel} other {channels}} on this team.</strong> You won&apos;t be able to rejoin it without an invitation from another team member. Are you sure?'
values={{
num_of_public_channels: numOfPublicChannels,
num_of_private_channels: numOfPrivateChannels,
strong: (chunks: React.ReactNode) => <strong>{chunks}</strong>,
}}
/>);
/>
);
}
} else if (numOfPublicChannels !== 0 && numOfPrivateChannels !== 0) {
modalMessage = (
<FormattedMarkdownMessage
id='leave_team_modal.desc'
defaultMessage="**You will be removed from {num_of_public_channels} public { num_of_public_channels,plural,one {channel} other {channels} } and {num_of_private_channels} private {num_of_private_channels,one {channel} other {channels}} on this team.** If the team is private you won't be able to rejoin it without an invitation from another team member. Are you sure?"

<FormattedMessage
id='leave_team_modal.description'
defaultMessage='<strong>You will be removed from {num_of_public_channels} public {num_of_public_channels,plural,one {channel} other {channels}} and {num_of_private_channels} private {num_of_private_channels,plural,one {channel} other {channels}} on this team.</strong> If the team is private you won&apos;t be able to rejoin it without an invitation from another team member. Are you sure?'
values={{
num_of_public_channels: numOfPublicChannels,
num_of_private_channels: numOfPrivateChannels,
strong: (chunks: React.ReactNode) => <strong>{chunks}</strong>,
}}
/>);
/>
);
} else if (numOfPublicChannels === 0) {
modalMessage = (
<FormattedMarkdownMessage
id='leave_team_modal_private.desc'
defaultMessage="**You will be removed from {num_of_private_channels} private {num_of_private_channels,one {channel} other {channels}} on this team.** If the team is private you won't be able to rejoin it without an invitation from another team member. Are you sure?"
<FormattedMessage
id='leave_team_modal_private.description'
defaultMessage='<strong>You will be removed from {num_of_private_channels} private {num_of_private_channels,plural,one {channel} other {channels}} on this team.</strong> If the team is private you won&apos;t be able to rejoin it without an invitation from another team member. Are you sure?'
values={{
num_of_public_channels: numOfPublicChannels,
num_of_private_channels: numOfPrivateChannels,
strong: (chunks: React.ReactNode) => <strong>{chunks}</strong>,
}}
/>);
/>
);
} else {
modalMessage = (
<FormattedMarkdownMessage
id='leave_team_modal_public.desc'
defaultMessage='**You will be removed from {num_of_public_channels} public { num_of_public_channels,plural,one {channel} other {channels} } on this team.** Are you sure?'
<FormattedMessage
id='leave_team_modal_public.description'
defaultMessage='<strong>You will be removed from {num_of_public_channels} public {num_of_public_channels,plural,one {channel} other {channels}} on this team.</strong> Are you sure?'
values={{
num_of_public_channels: numOfPublicChannels,
num_of_private_channels: numOfPrivateChannels,
strong: (chunks: React.ReactNode) => <strong>{chunks}</strong>,
}}
/>
);
Expand Down
12 changes: 6 additions & 6 deletions webapp/channels/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4135,12 +4135,12 @@
"leave_private_channel_modal.title": "Leave Private Channel {channel}",
"leave_public_channel_modal.message": "Are you sure you wish to leave the channel {channel}? You can re-join this channel in the future if you change your mind.",
"leave_public_channel_modal.title": "Leave Channel {channel}",
"leave_team_modal_guest_only_private.desc": "**You will be removed from {num_of_private_channels} private { num_of_private_channels,plural,one {channel} other {channels}} on this team.** You won't be able to rejoin it without an invitation from another team member. Are you sure?",
"leave_team_modal_guest_only_public.desc": "**You will be removed from {num_of_public_channels} public { num_of_public_channels,plural,one {channel} other {channels}} on this team.** You won't be able to rejoin it without an invitation from another team member. Are you sure?",
"leave_team_modal_guest.desc": "**You will be removed from {num_of_public_channels} public { num_of_public_channels,plural,one {channel} other {channels}} and {num_of_private_channels} private { num_of_private_channels,plural,one {channel} other {channels}} on this team.** You won't be able to rejoin it without an invitation from another team member. Are you sure?",
"leave_team_modal_private.desc": "**You will be removed from {num_of_private_channels} private { num_of_private_channels,plural,one {channel} other {channels} } on this team.** If the team is private you won't be able to rejoin it the team without an invitation from another team member. Are you sure?",
"leave_team_modal_public.desc": "**You will be removed from {num_of_public_channels} public { num_of_public_channels,plural,one {channel} other {channels} } on this team.** Are you sure?",
"leave_team_modal.desc": "**You will be removed from {num_of_public_channels} public { num_of_public_channels,plural,one {channel} other {channels}} and {num_of_private_channels} private { num_of_private_channels,plural,one {channel} other {channels}} on this team.** If the team is private you won't be able to rejoin it without an invitation from another team member. Are you sure?",
"leave_team_modal_guest_only_private.description": "<strong>You will be removed from {num_of_private_channels} private {num_of_private_channels,plural,one {channel} other {channels}} on this team.</strong> You won't be able to rejoin it without an invitation from another team member. Are you sure?",
"leave_team_modal_guest_only_public.description": "<strong>You will be removed from {num_of_public_channels} public {num_of_public_channels,plural,one {channel} other {channels}} on this team.</strong> You won't be able to rejoin it without an invitation from another team member. Are you sure?",
"leave_team_modal_guest.description": "<strong>You will be removed from {num_of_public_channels} public {num_of_public_channels,plural,one {channel} other {channels}} and {num_of_private_channels} private {num_of_private_channels,plural,one {channel} other {channels}} on this team.</strong> You won't be able to rejoin it without an invitation from another team member. Are you sure?",
"leave_team_modal_private.description": "<strong>You will be removed from {num_of_private_channels} private {num_of_private_channels,plural,one {channel} other {channels}} on this team.</strong> If the team is private you won't be able to rejoin it without an invitation from another team member. Are you sure?",
"leave_team_modal_public.description": "<strong>You will be removed from {num_of_public_channels} public {num_of_public_channels,plural,one {channel} other {channels}} on this team.</strong> Are you sure?",
"leave_team_modal.description": "<strong>You will be removed from {num_of_public_channels} public {num_of_public_channels,plural,one {channel} other {channels}} and {num_of_private_channels} private {num_of_private_channels,plural,one {channel} other {channels}} on this team.</strong> If the team is private you won't be able to rejoin it without an invitation from another team member. Are you sure?",
"leave_team_modal.no": "No",
"leave_team_modal.title": "Leave the team?",
"leave_team_modal.yes": "Yes",
Expand Down

0 comments on commit 7895000

Please sign in to comment.