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

Change the default text for User-Created Policy Rooms #7197

Merged
merged 1 commit into from
Jan 14, 2022
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
57 changes: 35 additions & 22 deletions src/components/ReportWelcomeText.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,32 +67,45 @@ const ReportWelcomeText = (props) => {
},
);
const chatUsers = props.shouldIncludeParticipants ? displayNamesWithTooltips : [{displayName: props.report.reportName}];
const isResctrictedRoom = lodashGet(props, 'report.visibility', '') === CONST.REPORT.VISIBILITY.RESTRICTED;

return (
<Text style={[styles.mt3, styles.w70, styles.textAlignCenter]}>
<Text>
{!props.shouldIncludeParticipants
? `${props.translate('reportActionsView.beginningOfChatHistoryPrivatePartOne')}`
: `${props.translate('reportActionsView.beginningOfChatHistory')} `}
</Text>
{!props.shouldIncludeParticipants && <Text style={[styles.textStrong]}>{` ${lodashGet(chatUsers, '[0].displayName', '')}`}</Text>}
{!props.shouldIncludeParticipants && <Text>{props.translate('reportActionsView.beginningOfChatHistoryPrivatePartTwo')}</Text>}
{props.shouldIncludeParticipants
&& (
<>
{_.map(chatUsers, ({displayName, pronouns}, index) => (
<Text key={displayName}>
<Text style={[styles.textStrong]}>
{displayName}
</Text>
{!_.isEmpty(pronouns) && <Text>{` (${pronouns})`}</Text>}
{(index === chatUsers.length - 1) && <Text>.</Text>}
{(index === chatUsers.length - 2) && <Text>{` ${props.translate('common.and')} `}</Text>}
{(index < chatUsers.length - 2) && <Text>, </Text>}
{!props.shouldIncludeParticipants
? (
<>
<Text>
{isResctrictedRoom
? `${props.translate('reportActionsView.beginningOfChatHistoryRestrictedPartOne')}`
: `${props.translate('reportActionsView.beginningOfChatHistoryPrivatePartOne')}`}
</Text>
<Text style={[styles.textStrong]}>
{lodashGet(chatUsers, '[0].displayName', '')}
</Text>
<Text>
{isResctrictedRoom
? `${props.translate('reportActionsView.beginningOfChatHistoryRestrictedPartTwo')}`
: `${props.translate('reportActionsView.beginningOfChatHistoryPrivatePartTwo')}`}
</Text>
))}
</>
)}
</>
) : (
<>
<Text>
{props.translate('reportActionsView.beginningOfChatHistory')}
</Text>
{_.map(chatUsers, ({displayName, pronouns}, index) => (
<Text key={displayName}>
<Text style={[styles.textStrong]}>
{displayName}
</Text>
{!_.isEmpty(pronouns) && <Text>{` (${pronouns})`}</Text>}
{(index === chatUsers.length - 1) && <Text>.</Text>}
{(index === chatUsers.length - 2) && <Text>{` ${props.translate('common.and')} `}</Text>}
{(index < chatUsers.length - 2) && <Text>, </Text>}
</Text>
))}
</>
)}
</Text>
);
};
Expand Down
6 changes: 4 additions & 2 deletions src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,11 @@ export default {
deleteConfirmation: 'Are you sure you want to delete this comment?',
},
reportActionsView: {
beginningOfChatHistory: 'This is the beginning of your chat history with',
beginningOfChatHistoryPrivatePartOne: 'This is the beginning of the private',
beginningOfChatHistory: 'This is the beginning of your chat history with ',
beginningOfChatHistoryPrivatePartOne: 'This is the beginning of the private ',
beginningOfChatHistoryRestrictedPartOne: 'This is the beginning of ',
beginningOfChatHistoryPrivatePartTwo: ' room, invite others by @mentioning them.',
beginningOfChatHistoryRestrictedPartTwo: ', invite others by @mentioning them.',
},
reportActionsViewMarkerBadge: {
newMsg: ({count}) => `${count} new message${count > 1 ? 's' : ''}`,
Expand Down
6 changes: 4 additions & 2 deletions src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,11 @@ export default {
deleteConfirmation: '¿Estás seguro de que quieres eliminar este comentario?',
},
reportActionsView: {
beginningOfChatHistory: 'Aquí comienza tu historial de conversaciones con',
beginningOfChatHistoryPrivatePartOne: 'Este es el principio de la sala privada',
beginningOfChatHistory: 'Aquí comienza tu historial de conversaciones con ',
beginningOfChatHistoryPrivatePartOne: 'Este es el principio de la sala privada ',
beginningOfChatHistoryRestrictedPartOne: 'Este es el principio de ',
beginningOfChatHistoryPrivatePartTwo: ', invita a otros @mencionándolos.',
beginningOfChatHistoryRestrictedPartTwo: ', invita a otros @mencionándolos.',
},
reportActionsViewMarkerBadge: {
newMsg: ({count}) => `${count} mensaje${count > 1 ? 's' : ''} nuevo${count > 1 ? 's' : ''}`,
Expand Down