|
@@ -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
|
|