2023-03-21 09:47:52 +02:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
|
2023-04-18 16:01:34 +03:00
|
|
|
import { translate } from '../../../base/i18n/functions';
|
|
|
|
|
import { IconSubtitles } from '../../../base/icons/svg';
|
|
|
|
|
import { toggleLanguageSelectorDialog } from '../../actions.web';
|
2018-08-24 13:12:12 -05:00
|
|
|
import {
|
|
|
|
|
AbstractClosedCaptionButton,
|
|
|
|
|
_abstractMapStateToProps
|
2023-04-18 16:01:34 +03:00
|
|
|
} from '../AbstractClosedCaptionButton';
|
2018-07-26 18:33:40 +02:00
|
|
|
|
|
|
|
|
/**
|
2018-08-24 13:12:12 -05:00
|
|
|
* A button which starts/stops the transcriptions.
|
2018-07-26 18:33:40 +02:00
|
|
|
*/
|
2018-08-24 13:12:12 -05:00
|
|
|
class ClosedCaptionButton
|
|
|
|
|
extends AbstractClosedCaptionButton {
|
|
|
|
|
accessibilityLabel = 'toolbar.accessibilityLabel.cc';
|
2022-11-08 12:24:32 +02:00
|
|
|
icon = IconSubtitles;
|
2018-08-24 13:12:12 -05:00
|
|
|
tooltip = 'transcribing.ccButtonTooltip';
|
2019-03-05 14:26:45 +00:00
|
|
|
label = 'toolbar.startSubtitles';
|
2022-08-31 18:57:31 +03:00
|
|
|
labelProps = {
|
2023-12-12 14:36:54 +02:00
|
|
|
language: this.props.t(this.props._language ?? 'transcribing.subtitlesOff'),
|
2023-03-30 11:27:53 +03:00
|
|
|
languages: this.props.t(this.props.languages ?? ''),
|
|
|
|
|
languagesHead: this.props.t(this.props.languagesHead ?? '')
|
2022-08-31 18:57:31 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Toggle language selection dialog.
|
|
|
|
|
*
|
|
|
|
|
* @returns {void}
|
|
|
|
|
*/
|
|
|
|
|
_handleClickOpenLanguageSelector() {
|
|
|
|
|
const { dispatch } = this.props;
|
|
|
|
|
|
2022-09-29 14:44:59 +03:00
|
|
|
dispatch(toggleLanguageSelectorDialog());
|
2022-08-31 18:57:31 +03:00
|
|
|
}
|
2018-07-26 18:33:40 +02:00
|
|
|
}
|
|
|
|
|
|
2020-04-01 13:08:02 +02:00
|
|
|
export default translate(connect(_abstractMapStateToProps)(ClosedCaptionButton));
|