浏览代码

fix(config): Add separate entries for the e2ee labels

master
Vlad Piersec 4 年前
父节点
当前提交
d96246dea8

+ 1
- 1
config.js 查看文件

@@ -868,7 +868,7 @@ var config = {
868 868
      disableRemoteControl
869 869
      displayJids
870 870
      externalConnectUrl
871
-     e2eeLabel
871
+     e2eeLabels
872 872
      firefox_fake_device
873 873
      googleApiApplicationClientID
874 874
      iAmRecorder

+ 0
- 3
lang/main.json 查看文件

@@ -210,11 +210,8 @@
210 210
         "displayNameRequired": "Hi! What’s your name?",
211 211
         "done": "Done",
212 212
         "e2eeDescription": "End-to-End Encryption is currently EXPERIMENTAL. Please keep in mind that turning on end-to-end encryption will effectively disable server-side provided services such as: phone participation. Also keep in mind that the meeting will only work for people joining from browsers with support for insertable streams.",
213
-        "e2eeDescriptionCustom": "{{label}} is currently EXPERIMENTAL. Please keep in mind that turning on {{label}} will effectively disable server-side provided services such as: phone participation. Also keep in mind that the meeting will only work for people joining from browsers with support for insertable streams.",
214 213
         "e2eeLabel": "Enable End-to-End Encryption",
215
-        "e2eeLabelCustom": "Enable {{label}}",
216 214
         "e2eeWarning": "WARNING: Not all participants in this meeting seem to have support for End-to-End encryption. If you enable it they won't be able to see nor hear you.",
217
-      "e2eeWarningCustom": "WARNING: Not all participants in this meeting seem to have support for {{label}}. If you enable it they won't be able to see nor hear you.",
218 215
         "enterDisplayName": "Enter your name here",
219 216
         "embedMeeting": "Embed meeting",
220 217
         "error": "Error",

+ 1
- 1
react/features/base/config/configWhitelist.js 查看文件

@@ -110,7 +110,7 @@ export default [
110 110
     'doNotStoreRoom',
111 111
     'doNotFlipLocalVideo',
112 112
     'dropbox',
113
-    'e2eeLabel',
113
+    'e2eeLabels',
114 114
     'e2eping',
115 115
     'enableDisplayNameInStats',
116 116
     'enableEmailInStats',

+ 6
- 0
react/features/e2ee/components/AbstractE2EELabel.js 查看文件

@@ -3,6 +3,11 @@
3 3
 
4 4
 export type Props = {
5 5
 
6
+    /**
7
+     * Custom e2ee labels.
8
+     */
9
+    _e2eeLabels?: Object;
10
+
6 11
     /**
7 12
      * True if the label needs to be rendered, false otherwise.
8 13
      */
@@ -23,6 +28,7 @@ export type Props = {
23 28
  */
24 29
 export function _mapStateToProps(state: Object) {
25 30
     return {
31
+        _e2eeLabels: state['features/base/config'].e2eeLabels,
26 32
         _showLabel: state['features/e2ee'].everyoneEnabledE2EE
27 33
     };
28 34
 }

+ 3
- 1
react/features/e2ee/components/E2EELabel.js 查看文件

@@ -28,10 +28,12 @@ class E2EELabel extends Component<Props> {
28 28
         if (!this.props._showLabel) {
29 29
             return null;
30 30
         }
31
+        const { _e2eeLabels, t } = this.props;
32
+        const content = _e2eeLabels?.labelToolTip || t('e2ee.labelToolTip');
31 33
 
32 34
         return (
33 35
             <Tooltip
34
-                content = { this.props.t('e2ee.labelToolTip') }
36
+                content = { content }
35 37
                 position = { 'bottom' }>
36 38
                 <Label
37 39
                     className = 'label--green'

+ 8
- 18
react/features/e2ee/components/E2EESection.js 查看文件

@@ -13,9 +13,9 @@ import { doesEveryoneSupportE2EE } from '../functions';
13 13
 type Props = {
14 14
 
15 15
     /**
16
-     * Custom e2ee label.
16
+     * Custom e2ee labels.
17 17
      */
18
-    _e2eeLabel: string,
18
+    _e2eeLabels: Object,
19 19
 
20 20
     /**
21 21
      * Whether E2EE is currently enabled or not.
@@ -92,21 +92,11 @@ class E2EESection extends Component<Props, State> {
92 92
      * @returns {ReactElement}
93 93
      */
94 94
     render() {
95
-        const { _e2eeLabel, _everyoneSupportE2EE, t } = this.props;
95
+        const { _e2eeLabels, _everyoneSupportE2EE, t } = this.props;
96 96
         const { enabled } = this.state;
97
-        let description;
98
-        let label;
99
-        let warning;
100
-
101
-        if (_e2eeLabel) {
102
-            description = t('dialog.e2eeDescriptionCustom', { label: _e2eeLabel });
103
-            label = t('dialog.e2eeLabelCustom', { label: _e2eeLabel });
104
-            warning = t('dialog.e2eeWarningCustom', { label: _e2eeLabel });
105
-        } else {
106
-            description = t('dialog.e2eeDescription');
107
-            label = t('dialog.e2eeLabel');
108
-            warning = t('dialog.e2eeWarning');
109
-        }
97
+        const description = _e2eeLabels?.description || t('dialog.e2eeDescription');
98
+        const label = _e2eeLabels?.label || t('dialog.e2eeLabel');
99
+        const warning = _e2eeLabels?.warning || t('dialog.e2eeWarning');
110 100
 
111 101
         return (
112 102
             <div id = 'e2ee-section'>
@@ -160,10 +150,10 @@ class E2EESection extends Component<Props, State> {
160 150
  */
161 151
 function mapStateToProps(state) {
162 152
     const { enabled } = state['features/e2ee'];
163
-    const { e2eeLabel } = state['features/base/config'];
153
+    const { e2eeLabels } = state['features/base/config'];
164 154
 
165 155
     return {
166
-        _e2eeLabel: e2eeLabel,
156
+        _e2eeLabels: e2eeLabels,
167 157
         _enabled: enabled,
168 158
         _everyoneSupportE2EE: doesEveryoneSupportE2EE(state)
169 159
     };

正在加载...
取消
保存