handleClickCaption(locale.locale, selected)}
+ iconRight={selected == locale.locale ? 'check' : null}
+ />
+ ))
+ );
+};
+
+const CaptionsButton = ({ intl, isActive, handleOnClick, translatedLocales, selectedLocale }) => (
+
+
+ {isActive &&
+
+
+
+
+
+
+ {getAvailableCaptions(translatedLocales, selectedLocale)}
+
+
+
+ }
+
);
CaptionsButton.propTypes = propTypes;
From 9f4e84f7abdeacc88d63445d2737d9b6d704fe9f Mon Sep 17 00:00:00 2001
From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com>
Date: Sun, 28 May 2023 20:54:26 +0900
Subject: [PATCH 07/50] Update container.jsx
---
.../imports/ui/components/captions/button/container.jsx | 2 ++
1 file changed, 2 insertions(+)
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));
From d6fd312ef1227a68fe6b514d755da3f336d62f38 Mon Sep 17 00:00:00 2001
From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com>
Date: Sun, 28 May 2023 21:04:24 +0900
Subject: [PATCH 08/50] Update component.jsx
---
.../ui/components/captions/component.jsx | 111 ++++++++++++++----
1 file changed, 90 insertions(+), 21 deletions(-)
diff --git a/bigbluebutton-html5/imports/ui/components/captions/component.jsx b/bigbluebutton-html5/imports/ui/components/captions/component.jsx
index 3b5f4a5a82b5..99c989ade055 100644
--- a/bigbluebutton-html5/imports/ui/components/captions/component.jsx
+++ b/bigbluebutton-html5/imports/ui/components/captions/component.jsx
@@ -9,6 +9,9 @@ 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 Toggle from '/imports/ui/components/common/switch/component';
+import StyledHeader from '/imports/ui/components/common/control-header//styles';
+import { components } from 'react-select';
const intlMessages = defineMessages({
hide: {
@@ -39,17 +42,22 @@ 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,
@@ -59,17 +67,57 @@ const propTypes = {
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;
+ }
+ };
+
+ const MultiValueRemove = (props) => {
+ if (props.data.isFixed) {
+ return null;
+ }
+ return ;
+ };
+
return (