2018-07-26 16:33:40 +00:00
|
|
|
// @flow
|
|
|
|
|
2019-03-21 16:38:29 +00:00
|
|
|
import { translate } from '../../base/i18n';
|
2022-11-08 10:24:32 +00:00
|
|
|
import { IconSubtitles } from '../../base/icons';
|
2019-03-21 16:38:29 +00:00
|
|
|
import { connect } from '../../base/redux';
|
2022-09-29 11:44:59 +00:00
|
|
|
import { toggleLanguageSelectorDialog } 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';
|
2022-11-08 10:24:32 +00:00
|
|
|
icon = IconSubtitles;
|
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 = {
|
2022-09-29 11:44:59 +00:00
|
|
|
language: this.props.t(this.props._language),
|
|
|
|
languages: this.props.t(this.props.languages),
|
|
|
|
languagesHead: this.props.t(this.props.languagesHead)
|
2022-08-31 15:57:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Toggle language selection dialog.
|
|
|
|
*
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_handleClickOpenLanguageSelector() {
|
|
|
|
const { dispatch } = this.props;
|
|
|
|
|
2022-09-29 11:44:59 +00:00
|
|
|
dispatch(toggleLanguageSelectorDialog());
|
2022-08-31 15:57:31 +00:00
|
|
|
}
|
2018-07-26 16:33:40 +00:00
|
|
|
}
|
|
|
|
|
2020-04-01 11:08:02 +00:00
|
|
|
export default translate(connect(_abstractMapStateToProps)(ClosedCaptionButton));
|