2018-07-26 16:33:40 +00:00
|
|
|
// @flow
|
|
|
|
|
2019-03-21 16:38:29 +00:00
|
|
|
import { translate } from '../../base/i18n';
|
2019-08-30 16:39:06 +00:00
|
|
|
import { IconClosedCaption } from '../../base/icons';
|
2019-03-21 16:38:29 +00:00
|
|
|
import { connect } from '../../base/redux';
|
2022-08-31 15:57:31 +00:00
|
|
|
import { toggleLangugeSelectorDialog } from '../actions';
|
2018-07-26 16:33:40 +00:00
|
|
|
|
2018-08-24 18:12:12 +00:00
|
|
|
import {
|
|
|
|
AbstractClosedCaptionButton,
|
|
|
|
_abstractMapStateToProps
|
|
|
|
} from './AbstractClosedCaptionButton';
|
2018-07-26 16:33:40 +00:00
|
|
|
|
|
|
|
/**
|
2018-08-24 18:12:12 +00:00
|
|
|
* A button which starts/stops the transcriptions.
|
2018-07-26 16:33:40 +00:00
|
|
|
*/
|
2018-08-24 18:12:12 +00:00
|
|
|
class ClosedCaptionButton
|
|
|
|
extends AbstractClosedCaptionButton {
|
|
|
|
accessibilityLabel = 'toolbar.accessibilityLabel.cc';
|
2019-08-30 16:39:06 +00:00
|
|
|
icon = IconClosedCaption;
|
2018-08-24 18:12:12 +00:00
|
|
|
tooltip = 'transcribing.ccButtonTooltip';
|
2019-03-05 14:26:45 +00:00
|
|
|
label = 'toolbar.startSubtitles';
|
2022-08-31 15:57:31 +00:00
|
|
|
labelProps = {
|
|
|
|
language: this.props.t(this.props._language)
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Toggle language selection dialog.
|
|
|
|
*
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_handleClickOpenLanguageSelector() {
|
|
|
|
const { dispatch } = this.props;
|
|
|
|
|
|
|
|
dispatch(toggleLangugeSelectorDialog());
|
|
|
|
}
|
2018-07-26 16:33:40 +00:00
|
|
|
}
|
|
|
|
|
2020-04-01 11:08:02 +00:00
|
|
|
export default translate(connect(_abstractMapStateToProps)(ClosedCaptionButton));
|