Просмотр исходного кода

fix(LargeVideoManager): frozen displayname in a msg

The "data-i18n-options" attribute value is stored in jQuery cache and
at the time when i18-next tries to access it to do the translation
it gets the old value from the cache and the message is not updated
correctly. Passing the "msgOptions" explicitly to "translateElement"
fixes the problem by avoiding jQuery cache.
j8
paweldomas 9 лет назад
Родитель
Сommit
ede4808ec4
1 измененных файлов: 4 добавлений и 5 удалений
  1. 4
    5
      modules/UI/videolayout/LargeVideoManager.js

+ 4
- 5
modules/UI/videolayout/LargeVideoManager.js Просмотреть файл

@@ -382,7 +382,8 @@ export default class LargeVideoManager {
382 382
             $('#remoteConnectionMessage')
383 383
                 .attr("data-i18n", msgKey)
384 384
                 .attr("data-i18n-options", JSON.stringify(msgOptions));
385
-            APP.translation.translateElement($('#remoteConnectionMessage'));
385
+            APP.translation.translateElement(
386
+                $('#remoteConnectionMessage'), msgOptions);
386 387
         }
387 388
 
388 389
         this.videoContainer.positionRemoteConnectionMessage();
@@ -394,14 +395,12 @@ export default class LargeVideoManager {
394 395
      *
395 396
      * @param {string} msgKey the translation key which will be used to get
396 397
      * the message text to be displayed on the large video.
397
-     * @param {object} msgOptions translation options object
398 398
      *
399 399
      * @private
400 400
      */
401
-    _setLocalConnectionMessage (msgKey, msgOptions) {
401
+    _setLocalConnectionMessage (msgKey) {
402 402
         $('#localConnectionMessage')
403
-            .attr("data-i18n", msgKey)
404
-            .attr("data-i18n-options", JSON.stringify(msgOptions));
403
+            .attr("data-i18n", msgKey);
405 404
         APP.translation.translateElement($('#localConnectionMessage'));
406 405
     }
407 406
 

Загрузка…
Отмена
Сохранить