From ac4e9909fa4f3f6c6a0d1e537d6039115d07a5e0 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Thu, 22 Jun 2017 06:30:03 -0400 Subject: Fixed incorrect formatting of numbers and plural words (#6696) * Fixed incorrect formatting of numbers and plural words * Removed unused i18n strings * Fixed eslint errors --- .../add_users_to_team/add_users_to_team.jsx | 2 +- .../system_users/system_users_list.jsx | 4 +-- webapp/components/delete_post_modal.jsx | 2 +- webapp/components/file_upload.jsx | 16 ++++----- webapp/components/filtered_user_list.jsx | 4 +-- .../more_direct_channels/more_direct_channels.jsx | 2 +- .../commented_on_files_message.jsx | 42 +++++++++++++--------- .../searchable_user_list/searchable_user_list.jsx | 4 +-- webapp/components/view_image_popover_bar.jsx | 2 +- webapp/i18n/en.json | 24 ++++++------- 10 files changed, 54 insertions(+), 48 deletions(-) diff --git a/webapp/components/add_users_to_team/add_users_to_team.jsx b/webapp/components/add_users_to_team/add_users_to_team.jsx index 691323568..34ad6eb0d 100644 --- a/webapp/components/add_users_to_team/add_users_to_team.jsx +++ b/webapp/components/add_users_to_team/add_users_to_team.jsx @@ -201,7 +201,7 @@ export default class AddUsersToTeam extends React.Component { const numRemainingText = ( 0) { - message = this.props.fileInfos[0].name; + if (!this.props.fileInfos || this.props.fileInfos.length === 0) { + return null; + } - if (this.props.fileInfos.length === 2) { - message += Utils.localizeMessage('post_body.plusOne', ' plus 1 other file'); - } else if (this.props.fileInfos.length > 2) { - message += Utils.localizeMessage('post_body.plusMore', ' plus {count} other files').replace('{count}', (this.props.fileInfos.length - 1).toString()); - } + let plusMore = null; + if (this.props.fileInfos.length > 1) { + plusMore = ( + + ); } - return {message}; + return ( + + {this.props.fileInfos[0].name} + {plusMore} + + ); } } diff --git a/webapp/components/searchable_user_list/searchable_user_list.jsx b/webapp/components/searchable_user_list/searchable_user_list.jsx index dae7835ac..e936ed25f 100644 --- a/webapp/components/searchable_user_list/searchable_user_list.jsx +++ b/webapp/components/searchable_user_list/searchable_user_list.jsx @@ -135,7 +135,7 @@ export default class SearchableUserList extends React.Component { return (