Browse Source

fix(video-quality): different tooltips for different definitions

master
Leonard Kim 7 years ago
parent
commit
10c8d380b7
2 changed files with 18 additions and 7 deletions
  1. 3
    0
      lang/main.json
  2. 15
    7
      react/features/video-quality/components/VideoQualityLabel.web.js

+ 3
- 0
lang/main.json View File

@@ -451,11 +451,13 @@
451 451
     "videoStatus": {
452 452
         "callQuality": "Call Quality",
453 453
         "hd": "HD",
454
+        "hdTooltip": "Viewing high definition video",
454 455
         "highDefinition": "High definition",
455 456
         "labelTooltipAudioOnly":  "Audio-only mode enabled",
456 457
         "labelTooiltipNoVideo": "No video",
457 458
         "labelTooltipVideo": "Current video quality",
458 459
         "ld": "LD",
460
+        "ldTooltip": "Viewing low definition video",
459 461
         "lowDefinition": "Low definition",
460 462
         "onlyAudioAvailable": "Only audio is available",
461 463
         "onlyAudioSupported": "We only support audio in this browser.",
@@ -463,6 +465,7 @@
463 465
         "p2pVideoQualityDescription": "In peer to peer mode, received call quality can only be toggled between high and audio only. Other settings will not be honored until peer to peer is exited.",
464 466
         "recHighDefinitionOnly": "Will prefer high definition.",
465 467
         "sd": "SD",
468
+        "sdTooltip": "Viewing standard definition video",
466 469
         "standardDefinition": "Standard definition",
467 470
         "qualityButtonTip": "Change received video quality"
468 471
     },

+ 15
- 7
react/features/video-quality/components/VideoQualityLabel.web.js View File

@@ -153,8 +153,11 @@ export class VideoQualityLabel extends Component {
153 153
             labelContent = <i className = 'icon-visibility-off' />;
154 154
             tooltipKey = 'videoStatus.labelTooiltipNoVideo';
155 155
         } else {
156
-            labelContent = this._mapResolutionToTranslation(_resolution);
157
-            tooltipKey = 'videoStatus.labelTooltipVideo';
156
+            const translationKeys
157
+                = this._mapResolutionToTranslationsKeys(_resolution);
158
+
159
+            labelContent = t(translationKeys.labelKey);
160
+            tooltipKey = translationKeys.tooltipKey;
158 161
         }
159 162
 
160 163
 
@@ -174,16 +177,16 @@ export class VideoQualityLabel extends Component {
174 177
     }
175 178
 
176 179
     /**
177
-     * Matches the passed in resolution with a translation key for describing
180
+     * Matches the passed in resolution with a translation keys for describing
178 181
      * the resolution. The passed in resolution will be matched with a known
179 182
      * resolution that it is at least greater than or equal to.
180 183
      *
181 184
      * @param {number} resolution - The video height to match with a
182 185
      * translation.
183 186
      * @private
184
-     * @returns {string}
187
+     * @returns {Object}
185 188
      */
186
-    _mapResolutionToTranslation(resolution) {
189
+    _mapResolutionToTranslationsKeys(resolution) {
187 190
         // Set the default matching resolution of the lowest just in case a
188 191
         // match is not found.
189 192
         let highestMatchingResolution = RESOLUTIONS[0];
@@ -198,8 +201,13 @@ export class VideoQualityLabel extends Component {
198 201
             }
199 202
         }
200 203
 
201
-        return this.props.t(
202
-            RESOLUTION_TO_TRANSLATION_KEY[highestMatchingResolution]);
204
+        const labelKey
205
+            = RESOLUTION_TO_TRANSLATION_KEY[highestMatchingResolution];
206
+
207
+        return {
208
+            labelKey,
209
+            tooltipKey: `${labelKey}Tooltip`
210
+        };
203 211
     }
204 212
 }
205 213
 

Loading…
Cancel
Save