handleClickCaption(locale.locale, selected)}
+ iconRight={selected == locale.locale ? 'check' : null}
+ />
+ ))
+ );
+};
+
+const CaptionsButton = ({ intl, isActive, handleOnClick, translatedLocales, selectedLocale }) => (
+
+
+ {isActive &&
+
+
+
+
+
+
+ {getAvailableCaptions(translatedLocales, selectedLocale)}
+
+
+
+ }
+
);
CaptionsButton.propTypes = propTypes;
diff --git a/bigbluebutton-html5/imports/ui/components/captions/button/container.jsx b/bigbluebutton-html5/imports/ui/components/captions/button/container.jsx
index add5eb0a6673..064a8b410f03 100644
--- a/bigbluebutton-html5/imports/ui/components/captions/button/container.jsx
+++ b/bigbluebutton-html5/imports/ui/components/captions/button/container.jsx
@@ -12,4 +12,6 @@ export default withModalMounter(withTracker(({ mountModal }) => ({
handleOnClick: () => (Service.isCaptionsActive()
? Service.deactivateCaptions()
: mountModal()),
+ translatedLocales: Service.getLocalesAutoTranslated(),
+ selectedLocale: Service.getCaptionsActive(),
}))(Container));
diff --git a/bigbluebutton-html5/imports/ui/components/captions/component.jsx b/bigbluebutton-html5/imports/ui/components/captions/component.jsx
index 3b5f4a5a82b5..18c523184c30 100644
--- a/bigbluebutton-html5/imports/ui/components/captions/component.jsx
+++ b/bigbluebutton-html5/imports/ui/components/captions/component.jsx
@@ -9,6 +9,8 @@ import Styled from './styles';
import { PANELS, ACTIONS } from '/imports/ui/components/layout/enums';
import browserInfo from '/imports/utils/browserInfo';
import Header from '/imports/ui/components/common/control-header/component';
+import StyledHeader from '/imports/ui/components/common/control-header//styles';
+import { components } from 'react-select';
const intlMessages = defineMessages({
hide: {
@@ -39,37 +41,82 @@ const intlMessages = defineMessages({
id: 'app.captions.dictationOffDesc',
description: 'Aria description for button that turns off speech recognition',
},
+ autoTranslation: {
+ id: 'app.captions.pad.autoTranslation',
+ description: 'Label for auto translation of closed captions pad',
+ },
+ autoTranslationDesc: {
+ id: 'app.captions.pad.autoTranslationDesc',
+ description: 'Descriotion for auto translation of closed captions pad',
+ },
});
const propTypes = {
locale: PropTypes.string.isRequired,
name: PropTypes.string.isRequired,
- ownerId: PropTypes.string.isRequired,
intl: PropTypes.shape({
formatMessage: PropTypes.func.isRequired,
}).isRequired,
- dictation: PropTypes.bool.isRequired,
- dictating: PropTypes.bool.isRequired,
isRTL: PropTypes.bool.isRequired,
hasPermission: PropTypes.bool.isRequired,
layoutContextDispatch: PropTypes.func.isRequired,
isResizing: PropTypes.bool.isRequired,
};
+const MultiValueRemove = (props) => {
+ if (props.data.isFixed) {
+ return null;
+ }
+ return ;
+};
+
const Captions = ({
locale,
intl,
- ownerId,
name,
- dictation,
- dictating,
+ amISpeaker,
isRTL,
hasPermission,
layoutContextDispatch,
isResizing,
+ isAutoTranslated,
+ //toggleAutoTranslation,
}) => {
const { isChrome } = browserInfo;
+ const localeOptions = [];
+ const selectedLocales = [];
+ Service.getAvailableLocales().forEach((loc) => {
+ //The current locale not included
+ localeOptions.push({value: loc.locale, label: loc.name});
+ if (loc.translating) {
+ if (loc.locale == locale) {
+ selectedLocales.push({value: loc.locale, label: loc.name, isFixed: true});
+ } else {
+ selectedLocales.push({value: loc.locale, label: loc.name});
+ }
+ }
+ });
+
+ const onTranslationLocaleChanged = (
+ newValue,
+ actionMeta
+ ) => {
+ switch (actionMeta.action) {
+ case 'remove-value':
+ case 'pop-value':
+ Service.removeTranslation(actionMeta.removedValue.value);
+ break;
+ case 'select-option':
+ Service.selectTranslation(actionMeta.option.value);
+ break;
+ case 'clear':
+ //This would't happen..
+ Service.clearTranslation();
+ break;
+ }
+ };
+
return (