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

make maximum participants reached msg consistent #9144

Merged
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
5 changes: 2 additions & 3 deletions src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ export default {
leaveRoom: 'Leave room',
your: 'your',
conciergeHelp: 'Please reach out to Concierge for help.',
youAppearToBeOffline: 'You appear to be offline',
maxParticipantsReached: ({count}) => `You've selected the maximum number (${count}) of participants.`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

NAB: But any specific reason we moved it as common.maxParticipantsReached instead of messages.maxParticipantsReached ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All the other texts that are commonly used are in common object, so it made sense to add this one to common as well.

youAppearToBeOffline: 'You appear to be offline.',
thisFeatureRequiresInternet: 'This feature requires an active internet connection to be used.',
},
attachmentPicker: {
Expand Down Expand Up @@ -235,7 +236,6 @@ export default {
split: ({amount}) => `Split ${amount}`,
send: ({amount}) => `Send ${amount}`,
noReimbursableExpenses: 'This report has an invalid amount',
maxParticipantsReached: ({count}) => `You've selected the maximum number (${count}) of participants.`,
error: {
invalidSplit: 'Split amounts do not equal total amount',
other: 'Unexpected error, please try again later',
Expand Down Expand Up @@ -581,7 +581,6 @@ export default {
},
messages: {
errorMessageInvalidPhone: 'Please enter a valid phone number without brackets or dashes. If you\'re outside the US please include your country code, eg. +447782339811',
maxParticipantsReached: 'You\'ve reached the maximum number of participants for a group chat.',
},
onfidoStep: {
acceptTerms: 'By continuing with the request to activate your Expensify wallet, you confirm that you have read, understand and accept ',
Expand Down
5 changes: 2 additions & 3 deletions src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ export default {
leaveRoom: 'Salir de la sala de chat',
your: 'tu',
conciergeHelp: 'Por favor contacta con Concierge para obtener ayuda.',
youAppearToBeOffline: 'Parece que estás desconectado',
maxParticipantsReached: ({count}) => `Has seleccionado el número máximo (${count}) de participantes.`,
youAppearToBeOffline: 'Parece que estás desconectado.',
thisFeatureRequiresInternet: 'Esta función requiere una conexión a Internet activa para ser utilizada.',
},
attachmentPicker: {
Expand Down Expand Up @@ -235,7 +236,6 @@ export default {
split: ({amount}) => `Dividir ${amount}`,
send: ({amount}) => `Enviar ${amount}`,
noReimbursableExpenses: 'El monto de este informe es inválido',
maxParticipantsReached: ({count}) => `Has seleccionado el número máximo (${count}) de participantes.`,
error: {
invalidSplit: 'La suma de las partes no equivale al monto total',
other: 'Error inesperado, por favor inténtalo más tarde',
Expand Down Expand Up @@ -581,7 +581,6 @@ export default {
},
messages: {
errorMessageInvalidPhone: 'Por favor, introduce un número de teléfono válido sin paréntesis o guiones. Si reside fuera de Estados Unidos, por favor incluye el prefijo internacional. P. ej. +447782339811',
maxParticipantsReached: 'Has llegado al número máximo de participantes para un grupo.',
},
onfidoStep: {
acceptTerms: 'Al continuar con la solicitud para activar su billetera Expensify, confirma que ha leído, comprende y acepta ',
Expand Down
2 changes: 1 addition & 1 deletion src/libs/OptionsListUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ function getSidebarOptions(
*/
function getHeaderMessage(hasSelectableOptions, hasUserToInvite, searchValue, maxParticipantsReached = false) {
if (maxParticipantsReached) {
return Localize.translate(preferredLocale, 'messages.maxParticipantsReached');
return Localize.translate(preferredLocale, 'common.maxParticipantsReached', {count: CONST.REPORT.MAXIMUM_PARTICIPANTS});
}

if (searchValue && CONST.REGEX.DIGITS_AND_PLUS.test(searchValue) && !Str.isValidPhone(searchValue)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,12 @@ class IOUParticipantsSplit extends Component {
render() {
const maxParticipantsReached = this.props.participants.length === CONST.REPORT.MAXIMUM_PARTICIPANTS;
const sections = this.getSections(maxParticipantsReached);
const headerMessage = !maxParticipantsReached ? OptionsListUtils.getHeaderMessage(
const headerMessage = OptionsListUtils.getHeaderMessage(
this.state.personalDetails.length + this.state.recentReports.length !== 0,
Boolean(this.state.userToInvite),
this.state.searchValue,
) : '';
maxParticipantsReached,
);
return (
<>
<View style={[styles.flex1, styles.w100]}>
Expand Down Expand Up @@ -234,11 +235,6 @@ class IOUParticipantsSplit extends Component {
</View>
{lodashGet(this.props, 'participants', []).length > 0 && (
<FixedFooter>
{maxParticipantsReached && (
<Text style={[styles.textLabelSupporting, styles.textAlignCenter, styles.mt1, styles.mb3]}>
{this.props.translate('iou.maxParticipantsReached', {count: CONST.REPORT.MAXIMUM_PARTICIPANTS})}
</Text>
)}
<Button
success
style={[styles.w100]}
Expand Down