You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ClosedCaptionButton.tsx 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { connect } from 'react-redux';
  2. import { translate } from '../../../base/i18n/functions';
  3. import { IconSubtitles } from '../../../base/icons/svg';
  4. import { toggleLanguageSelectorDialog } from '../../actions.web';
  5. import {
  6. AbstractClosedCaptionButton,
  7. _abstractMapStateToProps
  8. } from '../AbstractClosedCaptionButton';
  9. /**
  10. * A button which starts/stops the transcriptions.
  11. */
  12. class ClosedCaptionButton
  13. extends AbstractClosedCaptionButton {
  14. accessibilityLabel = 'toolbar.accessibilityLabel.cc';
  15. icon = IconSubtitles;
  16. tooltip = 'transcribing.ccButtonTooltip';
  17. label = 'toolbar.startSubtitles';
  18. labelProps = {
  19. language: this.props.t(this.props._language),
  20. languages: this.props.t(this.props.languages ?? ''),
  21. languagesHead: this.props.t(this.props.languagesHead ?? '')
  22. };
  23. /**
  24. * Toggle language selection dialog.
  25. *
  26. * @returns {void}
  27. */
  28. _handleClickOpenLanguageSelector() {
  29. const { dispatch } = this.props;
  30. dispatch(toggleLanguageSelectorDialog());
  31. }
  32. }
  33. export default translate(connect(_abstractMapStateToProps)(ClosedCaptionButton));