Skip to content

Commit

Permalink
Merge pull request #9144 from adeel0202/adeel-consistent-max-particip…
Browse files Browse the repository at this point in the history
…ants-msg

make maximum participants reached msg consistent
  • Loading branch information
Beamanator committed Jun 8, 2022
2 parents b0c52f2 + cf878b4 commit fb62f9a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
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.`,
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
10 changes: 3 additions & 7 deletions src/pages/iou/steps/IOUParticipantsPage/IOUParticipantsSplit.js
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

0 comments on commit fb62f9a

Please sign in to comment.