Pārlūkot izejas kodu

feat(config): Add config option for e2ee label

master
Vlad Piersec 4 gadus atpakaļ
vecāks
revīzija
f5dee99131

+ 1
- 0
config.js Parādīt failu

@@ -859,6 +859,7 @@ var config = {
859 859
      disableRemoteControl
860 860
      displayJids
861 861
      externalConnectUrl
862
+     e2eeLabel
862 863
      firefox_fake_device
863 864
      googleApiApplicationClientID
864 865
      iAmRecorder

+ 3
- 0
lang/main.json Parādīt failu

@@ -210,8 +210,11 @@
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.",
213 214
         "e2eeLabel": "Enable End-to-End Encryption",
215
+        "e2eeLabelCustom": "Enable {{label}}",
214 216
         "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.",
215 218
         "enterDisplayName": "Enter your name here",
216 219
         "embedMeeting": "Embed meeting",
217 220
         "error": "Error",

+ 1
- 0
react/features/base/config/configWhitelist.js Parādīt failu

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

+ 23
- 4
react/features/e2ee/components/E2EESection.js Parādīt failu

@@ -12,6 +12,11 @@ import { doesEveryoneSupportE2EE } from '../functions';
12 12
 
13 13
 type Props = {
14 14
 
15
+    /**
16
+     * Custom e2ee label.
17
+     */
18
+    _e2eeLabel: string,
19
+
15 20
     /**
16 21
      * Whether E2EE is currently enabled or not.
17 22
      */
@@ -87,9 +92,21 @@ class E2EESection extends Component<Props, State> {
87 92
      * @returns {ReactElement}
88 93
      */
89 94
     render() {
90
-        const { _everyoneSupportE2EE, t } = this.props;
95
+        const { _e2eeLabel, _everyoneSupportE2EE, t } = this.props;
91 96
         const { enabled } = this.state;
92
-        const description = t('dialog.e2eeDescription');
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
+        }
93 110
 
94 111
         return (
95 112
             <div id = 'e2ee-section'>
@@ -99,11 +116,11 @@ class E2EESection extends Component<Props, State> {
99 116
                     id = 'e2ee-section-description'>
100 117
                     { description }
101 118
                     { !_everyoneSupportE2EE && <br /> }
102
-                    { !_everyoneSupportE2EE && t('dialog.e2eeWarning') }
119
+                    { !_everyoneSupportE2EE && warning }
103 120
                 </p>
104 121
                 <div className = 'control-row'>
105 122
                     <label htmlFor = 'e2ee-section-switch'>
106
-                        { t('dialog.e2eeLabel') }
123
+                        { label }
107 124
                     </label>
108 125
                     <Switch
109 126
                         id = 'e2ee-section-switch'
@@ -143,8 +160,10 @@ class E2EESection extends Component<Props, State> {
143 160
  */
144 161
 function mapStateToProps(state) {
145 162
     const { enabled } = state['features/e2ee'];
163
+    const { e2eeLabel } = state['features/base/config'];
146 164
 
147 165
     return {
166
+        _e2eeLabel: e2eeLabel,
148 167
         _enabled: enabled,
149 168
         _everyoneSupportE2EE: doesEveryoneSupportE2EE(state)
150 169
     };

Notiek ielāde…
Atcelt
Saglabāt