Skip to content

Commit

Permalink
Added internationalization for file filter dropdown (mattermost#28809)
Browse files Browse the repository at this point in the history
Co-authored-by: Sahariar Alam Khandoker <sahariar.alam@therapservices.net>
Co-authored-by: Mattermost Build <build@mattermost.com>
  • Loading branch information
3 people authored Oct 29, 2024
1 parent 2424358 commit da2a84e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 18 deletions.
37 changes: 19 additions & 18 deletions webapp/channels/src/components/search_results/files_filter_menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// See LICENSE.txt for license information.

import React from 'react';
import {FormattedMessage} from 'react-intl';
import {FormattedMessage, useIntl} from 'react-intl';

import {FilterVariantIcon} from '@mattermost/compass-icons/components';

Expand All @@ -20,6 +20,7 @@ type Props = {
};

export default function FilesFilterMenu(props: Props): JSX.Element {
const intl = useIntl();
return (
<div className='FilesFilterMenu'>
<MenuWrapper>
Expand All @@ -46,54 +47,54 @@ export default function FilesFilterMenu(props: Props): JSX.Element {
</WithTooltip>

<Menu
ariaLabel={'file menu'}
ariaLabel={intl.formatMessage({id: 'channel_info_rhs.menu.files.filter.file_menu', defaultMessage: 'file menu'})}
openLeft={true}
>
<Menu.ItemAction
ariaLabel={'All file types'}
text={'All file types'}
ariaLabel={intl.formatMessage({id: 'channel_info_rhs.menu.files.filter.all_file_types', defaultMessage: 'All file types'})}
text={intl.formatMessage({id: 'channel_info_rhs.menu.files.filter.all_file_types', defaultMessage: 'All file types'})}
onClick={() => props.onFilter('all')}
icon={props.selectedFilter === 'all' ? <i className='icon icon-check'/> : null}
/>
<Menu.ItemAction
ariaLabel={'Documents'}
text={'Documents'}
ariaLabel={intl.formatMessage({id: 'channel_info_rhs.menu.files.filter.documents', defaultMessage: 'Documents'})}
text={intl.formatMessage({id: 'channel_info_rhs.menu.files.filter.documents', defaultMessage: 'Documents'})}
onClick={() => props.onFilter('documents')}
icon={props.selectedFilter === 'documents' ? <i className='icon icon-check'/> : null}
/>
<Menu.ItemAction
ariaLabel={'Spreadsheets'}
text={'Spreadsheets'}
ariaLabel={intl.formatMessage({id: 'channel_info_rhs.menu.files.filter.spreadsheets', defaultMessage: 'Spreadsheets'})}
text={intl.formatMessage({id: 'channel_info_rhs.menu.files.filter.spreadsheets', defaultMessage: 'Spreadsheets'})}
onClick={() => props.onFilter('spreadsheets')}
icon={props.selectedFilter === 'spreadsheets' ? <i className='icon icon-check'/> : null}
/>
<Menu.ItemAction
ariaLabel={'Presentations'}
text={'Presentations'}
ariaLabel={intl.formatMessage({id: 'channel_info_rhs.menu.files.filter.presentations', defaultMessage: 'Presentations'})}
text={intl.formatMessage({id: 'channel_info_rhs.menu.files.filter.presentations', defaultMessage: 'Presentations'})}
onClick={() => props.onFilter('presentations')}
icon={props.selectedFilter === 'presentations' ? <i className='icon icon-check'/> : null}
/>
<Menu.ItemAction
ariaLabel={'Code'}
text={'Code'}
ariaLabel={intl.formatMessage({id: 'channel_info_rhs.menu.files.filter.code', defaultMessage: 'Code'})}
text={intl.formatMessage({id: 'channel_info_rhs.menu.files.filter.code', defaultMessage: 'Code'})}
onClick={() => props.onFilter('code')}
icon={props.selectedFilter === 'code' ? <i className='icon icon-check'/> : null}
/>
<Menu.ItemAction
ariaLabel={'Images'}
text={'Images'}
ariaLabel={intl.formatMessage({id: 'channel_info_rhs.menu.files.filter.images', defaultMessage: 'Images'})}
text={intl.formatMessage({id: 'channel_info_rhs.menu.files.filter.images', defaultMessage: 'Images'})}
onClick={() => props.onFilter('images')}
icon={props.selectedFilter === 'images' ? <i className='icon icon-check'/> : null}
/>
<Menu.ItemAction
ariaLabel={'Audio'}
text={'Audio'}
ariaLabel={intl.formatMessage({id: 'channel_info_rhs.menu.files.filter.audio', defaultMessage: 'Audio'})}
text={intl.formatMessage({id: 'channel_info_rhs.menu.files.filter.audio', defaultMessage: 'Audio'})}
onClick={() => props.onFilter('audio')}
icon={props.selectedFilter === 'audio' ? <i className='icon icon-check'/> : null}
/>
<Menu.ItemAction
ariaLabel={'Videos'}
text={'Videos'}
ariaLabel={intl.formatMessage({id: 'channel_info_rhs.menu.files.filter.videos', defaultMessage: 'Videos'})}
text={intl.formatMessage({id: 'channel_info_rhs.menu.files.filter.videos', defaultMessage: 'Videos'})}
onClick={() => props.onFilter('video')}
icon={props.selectedFilter === 'video' ? <i className='icon icon-check'/> : null}
/>
Expand Down
9 changes: 9 additions & 0 deletions webapp/channels/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3200,6 +3200,15 @@
"channel_info_rhs.header.title": "Info",
"channel_info_rhs.menu.files": "Files",
"channel_info_rhs.menu.files.filter": "Filter",
"channel_info_rhs.menu.files.filter.all_file_types": "All file types",
"channel_info_rhs.menu.files.filter.audio": "Audio",
"channel_info_rhs.menu.files.filter.code": "Code",
"channel_info_rhs.menu.files.filter.documents": "Documents",
"channel_info_rhs.menu.files.filter.file_menu": "file menu",
"channel_info_rhs.menu.files.filter.images": "Images",
"channel_info_rhs.menu.files.filter.presentations": "Presentations",
"channel_info_rhs.menu.files.filter.spreadsheets": "Spreadsheets",
"channel_info_rhs.menu.files.filter.videos": "Videos",
"channel_info_rhs.menu.members": "Members",
"channel_info_rhs.menu.notification_preferences": "Notification Preferences",
"channel_info_rhs.menu.pinned": "Pinned messages",
Expand Down

0 comments on commit da2a84e

Please sign in to comment.