Browse Source

Changes the configuration of translation module to retrieve the resources synchronous. Removes the default values.

master
hristoterezov 10 years ago
parent
commit
af682f8727

+ 1
- 1
index.html View File

19
     <script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
19
     <script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
20
     <script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
20
     <script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
21
     <script src="interface_config.js?v=5"></script>
21
     <script src="interface_config.js?v=5"></script>
22
-    <script src="libs/app.bundle.js?v=23"></script>
22
+    <script src="libs/app.bundle.js?v=24"></script>
23
     <script src="analytics.js?v=1"></script><!-- google analytics plugin -->
23
     <script src="analytics.js?v=1"></script><!-- google analytics plugin -->
24
     <link rel="stylesheet" href="css/font.css?v=6"/>
24
     <link rel="stylesheet" href="css/font.css?v=6"/>
25
     <link rel="stylesheet" href="css/toastr.css?v=1">
25
     <link rel="stylesheet" href="css/toastr.css?v=1">

+ 5
- 1
lang/main.json View File

175
         "yourPassword": "your password",
175
         "yourPassword": "your password",
176
         "Back": "Back",
176
         "Back": "Back",
177
         "serviceUnavailable": "Service unavailable",
177
         "serviceUnavailable": "Service unavailable",
178
-        "gracefulShutdown": "Our service is currently down for maintenance. Please try again later."
178
+        "gracefulShutdown": "Our service is currently down for maintenance. Please try again later.",
179
+        "Yes": "Yes",
180
+        "reservationError": "Reservation system error",
181
+        "reservationErrorMsg": "Error code: __code__, message: __msg__"
182
+
179
     }
183
     }
180
 }
184
 }

+ 17790
- 17870
libs/app.bundle.js
File diff suppressed because it is too large
View File


+ 2
- 4
modules/RTC/RTCUtils.js View File

317
             function (error) {
317
             function (error) {
318
                 console.error('failed to obtain audio/video stream - stop',
318
                 console.error('failed to obtain audio/video stream - stop',
319
                     error);
319
                     error);
320
-                APP.UI.messageHandler.showError("dialog.error", "Error",
321
-                    "dialog.failedpermissions",
322
-                    "Failed to obtain permissions to use the local microphone " +
323
-                    "and/or camera.");
320
+                APP.UI.messageHandler.showError("dialog.error",
321
+                    "dialog.failedpermissions");
324
             }
322
             }
325
         );
323
         );
326
     }
324
     }

+ 23
- 25
modules/UI/UI.js View File

137
     APP.xmpp.addListener(XMPPEvents.DISPOSE_CONFERENCE, onDisposeConference);
137
     APP.xmpp.addListener(XMPPEvents.DISPOSE_CONFERENCE, onDisposeConference);
138
     APP.xmpp.addListener(XMPPEvents.GRACEFUL_SHUTDOWN, function () {
138
     APP.xmpp.addListener(XMPPEvents.GRACEFUL_SHUTDOWN, function () {
139
         messageHandler.openMessageDialog(
139
         messageHandler.openMessageDialog(
140
-            'dialog.serviceUnavailable', 'Service unavailable',
141
-            'dialog.gracefulShutdown',
142
-            'Our service is currently down for maintenance.' +
143
-            ' Please try again later.'
140
+            'dialog.serviceUnavailable',
141
+            'dialog.gracefulShutdown'
144
         );
142
         );
145
     });
143
     });
146
     APP.xmpp.addListener(XMPPEvents.RESERVATION_ERROR, function (code, msg) {
144
     APP.xmpp.addListener(XMPPEvents.RESERVATION_ERROR, function (code, msg) {
145
+        var title = APP.translation.generateTranslatonHTML(
146
+            "dialog.reservationError");
147
+        var message = APP.translation.generateTranslatonHTML(
148
+            "dialog.reservationErrorMsg", {code: code, msg: msg});
147
         messageHandler.openDialog(
149
         messageHandler.openDialog(
148
-            'Reservation system error',
149
-            'Error code: ' + code + ', message: ' + msg,
150
+            title,
151
+            message,
150
             true, {},
152
             true, {},
151
             function (event, value, message, formVals)
153
             function (event, value, message, formVals)
152
             {
154
             {
155
         );
157
         );
156
     });
158
     });
157
     APP.xmpp.addListener(XMPPEvents.KICKED, function () {
159
     APP.xmpp.addListener(XMPPEvents.KICKED, function () {
158
-        messageHandler.openMessageDialog("dialog.sessTerminated", "Session Terminated",
159
-            "dialog.kickMessage", "Ouch! You have been kicked out of the meet!");
160
+        messageHandler.openMessageDialog("dialog.sessTerminated",
161
+            "dialog.kickMessage");
160
     });
162
     });
161
     APP.xmpp.addListener(XMPPEvents.MUC_DESTROYED, function (reason) {
163
     APP.xmpp.addListener(XMPPEvents.MUC_DESTROYED, function (reason) {
162
         //FIXME: use Session Terminated from translation, but
164
         //FIXME: use Session Terminated from translation, but
163
         // 'reason' text comes from XMPP packet and is not translated
165
         // 'reason' text comes from XMPP packet and is not translated
166
+        var title = APP.translation.generateTranslatonHTML("dialog.sessTerminated");
164
         messageHandler.openDialog(
167
         messageHandler.openDialog(
165
-            "Session Terminated", reason, true, {},
168
+            title, reason, true, {},
166
             function (event, value, message, formVals)
169
             function (event, value, message, formVals)
167
             {
170
             {
168
                 return false;
171
                 return false;
170
         );
173
         );
171
     });
174
     });
172
     APP.xmpp.addListener(XMPPEvents.BRIDGE_DOWN, function () {
175
     APP.xmpp.addListener(XMPPEvents.BRIDGE_DOWN, function () {
173
-        messageHandler.showError("dialog.error","Error",
174
-            "dialog.bridgeUnavailable",
175
-            "Jitsi Videobridge is currently unavailable. Please try again later!");
176
+        messageHandler.showError("dialog.error",
177
+            "dialog.bridgeUnavailable");
176
     });
178
     });
177
     APP.xmpp.addListener(XMPPEvents.USER_ID_CHANGED, function (from, id) {
179
     APP.xmpp.addListener(XMPPEvents.USER_ID_CHANGED, function (from, id) {
178
         Avatar.setUserAvatar(from, id);
180
         Avatar.setUserAvatar(from, id);
417
     console.log('left.muc', jid);
419
     console.log('left.muc', jid);
418
     var displayName = $('#participant_' + Strophe.getResourceFromJid(jid) +
420
     var displayName = $('#participant_' + Strophe.getResourceFromJid(jid) +
419
         '>.displayname').html();
421
         '>.displayname').html();
420
-    messageHandler.notify(displayName,'notify.somebody', "Somebody",
422
+    messageHandler.notify(displayName,'notify.somebody',
421
         'disconnected',
423
         'disconnected',
422
-        'notify.disconnected', "disconnected");
424
+        'notify.disconnected');
423
     // Need to call this with a slight delay, otherwise the element couldn't be
425
     // Need to call this with a slight delay, otherwise the element couldn't be
424
     // found for some reason.
426
     // found for some reason.
425
     // XXX(gp) it works fine without the timeout for me (with Chrome 38).
427
     // XXX(gp) it works fine without the timeout for me (with Chrome 38).
450
     if (isModerator) {
452
     if (isModerator) {
451
         Authentication.closeAuthenticationWindow();
453
         Authentication.closeAuthenticationWindow();
452
         messageHandler.notify(null, "notify.me",
454
         messageHandler.notify(null, "notify.me",
453
-            'Me', 'connected', "notify.moderator",
454
-            'Moderator rights granted !');
455
+            'connected', "notify.moderator");
455
     }
456
     }
456
 }
457
 }
457
 
458
 
475
     Toolbar.lockLockButton();
476
     Toolbar.lockLockButton();
476
     var message = '<h2 data-i18n="dialog.passwordRequired">';
477
     var message = '<h2 data-i18n="dialog.passwordRequired">';
477
     message += APP.translation.translateString(
478
     message += APP.translation.translateString(
478
-        "dialog.passwordRequired", null, "Password required");
479
+        "dialog.passwordRequired");
479
     message += '</h2>' +
480
     message += '</h2>' +
480
         '<input id="lockKey" type="text" placeholder="password" autofocus>';
481
         '<input id="lockKey" type="text" placeholder="password" autofocus>';
481
 
482
 
498
     );
499
     );
499
 }
500
 }
500
 function onMucEntered(jid, id, displayName) {
501
 function onMucEntered(jid, id, displayName) {
501
-    messageHandler.notify(displayName,'notify.somebody', "Somebody",
502
+    messageHandler.notify(displayName,'notify.somebody',
502
         'connected',
503
         'connected',
503
-        'notify.connected', "connected");
504
+        'notify.connected');
504
 
505
 
505
     // Add Peer's container
506
     // Add Peer's container
506
     VideoLayout.ensurePeerContainerExists(jid,id);
507
     VideoLayout.ensurePeerContainerExists(jid,id);
516
 
517
 
517
     if (role === 'moderator') {
518
     if (role === 'moderator') {
518
         var messageKey, messageOptions = {};
519
         var messageKey, messageOptions = {};
519
-        var lDisplayName = displayName;
520
-        if (!lDisplayName) {
521
-            lDisplayName = 'Somebody';
520
+        if (!displayName) {
522
             messageKey = "notify.grantedToUnknown";
521
             messageKey = "notify.grantedToUnknown";
523
         }
522
         }
524
         else
523
         else
527
             messageOptions = {to: displayName};
526
             messageOptions = {to: displayName};
528
         }
527
         }
529
         messageHandler.notify(
528
         messageHandler.notify(
530
-            displayName,'notify.somebody', "Somebody",
529
+            displayName,'notify.somebody',
531
             'connected', messageKey,
530
             'connected', messageKey,
532
-            'Moderator rights granted to ' + lDisplayName + '!',
533
             messageOptions);
531
             messageOptions);
534
     }
532
     }
535
 }
533
 }
641
     console.log('password is required');
639
     console.log('password is required');
642
     var message = '<h2 data-i18n="dialog.passwordRequired">';
640
     var message = '<h2 data-i18n="dialog.passwordRequired">';
643
     message += APP.translation.translateString(
641
     message += APP.translation.translateString(
644
-        "dialog.passwordRequired", null, "Password required");
642
+        "dialog.passwordRequired");
645
     message += '</h2>' +
643
     message += '</h2>' +
646
         '<input id="passwordrequired.username" type="text" ' +
644
         '<input id="passwordrequired.username" type="text" ' +
647
         'placeholder="user@domain.net" autofocus>' +
645
         'placeholder="user@domain.net" autofocus>' +

+ 3
- 8
modules/UI/authentication/Authentication.js View File

16
         // extract room name from 'room@muc.server.net'
16
         // extract room name from 'room@muc.server.net'
17
         var room = roomName.substr(0, roomName.indexOf('@'));
17
         var room = roomName.substr(0, roomName.indexOf('@'));
18
 
18
 
19
-        var title = APP.translation.generateTranslatonHTML("dialog.Stop",
20
-            "Stop");
21
-        var defMsg = 'Authentication is required to create room:<br/><b>' +
22
-            room +
23
-            '</b></br> You can either authenticate to create the room or ' +
24
-            'just wait for someone else to do so.';
19
+        var title = APP.translation.generateTranslatonHTML("dialog.Stop");
25
         var msg = APP.translation.generateTranslatonHTML("dialog.AuthMsg",
20
         var msg = APP.translation.generateTranslatonHTML("dialog.AuthMsg",
26
-            defMsg, {room: room});
21
+            {room: room});
27
         var button = APP.translation.generateTranslatonHTML(
22
         var button = APP.translation.generateTranslatonHTML(
28
-            "dialog.Authenticate", "Authenticate");
23
+            "dialog.Authenticate");
29
         var buttons = {};
24
         var buttons = {};
30
         buttons.authenticate = {title: button, value: "authNow"};
25
         buttons.authenticate = {title: button, value: "authNow"};
31
 
26
 

+ 10
- 10
modules/UI/prezi/Prezi.js View File

34
         var myprezi = APP.xmpp.getPrezi();
34
         var myprezi = APP.xmpp.getPrezi();
35
         if (myprezi) {
35
         if (myprezi) {
36
             messageHandler.openTwoButtonDialog("dialog.removePreziTitle",
36
             messageHandler.openTwoButtonDialog("dialog.removePreziTitle",
37
-                "Remove Prezi", "dialog.removePreziMsg",
38
-                "Are you sure you would like to remove your Prezi?",
37
+                null,
38
+                "dialog.removePreziMsg",
39
+                null,
39
                 false,
40
                 false,
40
                 "dialog.Remove",
41
                 "dialog.Remove",
41
                 function(e,v,m,f) {
42
                 function(e,v,m,f) {
47
         }
48
         }
48
         else if (preziPlayer != null) {
49
         else if (preziPlayer != null) {
49
             messageHandler.openTwoButtonDialog("dialog.sharePreziTitle",
50
             messageHandler.openTwoButtonDialog("dialog.sharePreziTitle",
50
-                "Share a Prezi", "dialog.sharePreziMsg",
51
-                "Another participant is already sharing a Prezi." +
52
-                    "This conference allows only one Prezi at a time.",
51
+                null, "dialog.sharePreziMsg",
52
+                null,
53
                 false,
53
                 false,
54
                 "dialog.Ok",
54
                 "dialog.Ok",
55
                 function(e,v,m,f) {
55
                 function(e,v,m,f) {
59
         }
59
         }
60
         else {
60
         else {
61
             var html = APP.translation.generateTranslatonHTML(
61
             var html = APP.translation.generateTranslatonHTML(
62
-                "dialog.sharePreziTitle", "Share a Prezi");
62
+                "dialog.sharePreziTitle");
63
             var cancelButton = APP.translation.generateTranslatonHTML(
63
             var cancelButton = APP.translation.generateTranslatonHTML(
64
-                "dialog.Cancel", "Cancel");
64
+                "dialog.Cancel");
65
             var shareButton = APP.translation.generateTranslatonHTML(
65
             var shareButton = APP.translation.generateTranslatonHTML(
66
-                "dialog.Share", "Share");
66
+                "dialog.Share");
67
             var backButton = APP.translation.generateTranslatonHTML(
67
             var backButton = APP.translation.generateTranslatonHTML(
68
-                "dialog.Back", "Back");
68
+                "dialog.Back");
69
             var buttons = {};
69
             var buttons = {};
70
             var buttons1 = {};
70
             var buttons1 = {};
71
             buttons1.button1 = buttons.button1 = {title: cancelButton, value: false};
71
             buttons1.button1 = buttons.button1 = {title: cancelButton, value: false};
72
             buttons.button2 = {title: shareButton, value: true};
72
             buttons.button2 = {title: shareButton, value: true};
73
             buttons1.button2 = {title: backButton, value: true};
73
             buttons1.button2 = {title: backButton, value: true};
74
             var linkError = APP.translation.generateTranslatonHTML(
74
             var linkError = APP.translation.generateTranslatonHTML(
75
-                "dialog.preziLinkError", "Please provide a correct prezi link.")
75
+                "dialog.preziLinkError");
76
             var openPreziState = {
76
             var openPreziState = {
77
                 state0: {
77
                 state0: {
78
                     html:   '<h2>' + html + '</h2>' +
78
                     html:   '<h2>' + html + '</h2>' +

+ 1
- 0
modules/UI/side_pannels/settings/SettingsMenu.js View File

27
 
27
 
28
     init: function () {
28
     init: function () {
29
         $("#updateSettings").before(generateLanguagesSelectBox());
29
         $("#updateSettings").before(generateLanguagesSelectBox());
30
+        APP.translation.translateElement($("#languages_selectbox"));
30
         $('#settingsmenu>input').keyup(function(event){
31
         $('#settingsmenu>input').keyup(function(event){
31
             if(event.keyCode === 13) {//enter
32
             if(event.keyCode === 13) {//enter
32
                 SettingsMenu.update();
33
                 SettingsMenu.update();

+ 26
- 41
modules/UI/toolbars/Toolbar.js View File

66
     "toolbar_button_logout": function () {
66
     "toolbar_button_logout": function () {
67
         // Ask for confirmation
67
         // Ask for confirmation
68
         messageHandler.openTwoButtonDialog(
68
         messageHandler.openTwoButtonDialog(
69
-            "dialog.logoutTitle", "Logout",
69
+            "dialog.logoutTitle",
70
+            null,
70
             "dialog.logoutQuestion",
71
             "dialog.logoutQuestion",
71
-            "Are you sure you want to logout and stop the conference ?",
72
-            false, "Yes",
72
+            null,
73
+            false,
74
+            "dialog.Yes",
73
             function (evt, yes) {
75
             function (evt, yes) {
74
                 if (yes) {
76
                 if (yes) {
75
                     APP.xmpp.logout(function (url) {
77
                     APP.xmpp.logout(function (url) {
97
     }
99
     }
98
 
100
 
99
     var title = APP.translation.generateTranslatonHTML(
101
     var title = APP.translation.generateTranslatonHTML(
100
-        "dialog.sessTerminated", "Session Terminated");
102
+        "dialog.sessTerminated");
101
     var msg = APP.translation.generateTranslatonHTML(
103
     var msg = APP.translation.generateTranslatonHTML(
102
-        "dialog.hungUp","You hung up the call");
104
+        "dialog.hungUp");
103
     var button = APP.translation.generateTranslatonHTML(
105
     var button = APP.translation.generateTranslatonHTML(
104
-        "dialog.joinAgain", "Join again");
106
+        "dialog.joinAgain");
105
     var buttons = {};
107
     var buttons = {};
106
     buttons.joinAgain = {title: button, value: true};
108
     buttons.joinAgain = {title: button, value: true};
107
 
109
 
125
 function toggleRecording() {
127
 function toggleRecording() {
126
     APP.xmpp.toggleRecording(function (callback) {
128
     APP.xmpp.toggleRecording(function (callback) {
127
         var msg = APP.translation.generateTranslatonHTML(
129
         var msg = APP.translation.generateTranslatonHTML(
128
-            "dialog.recordingToken", "Enter recording token");
130
+            "dialog.recordingToken");
129
         APP.UI.messageHandler.openTwoButtonDialog(null, null, null,
131
         APP.UI.messageHandler.openTwoButtonDialog(null, null, null,
130
                 '<h2>' + msg + '</h2>' +
132
                 '<h2>' + msg + '</h2>' +
131
                 '<input id="recordingToken" type="text" ' +
133
                 '<input id="recordingToken" type="text" ' +
172
         }
174
         }
173
     }, function (err) {
175
     }, function (err) {
174
         console.warn('setting password failed', err);
176
         console.warn('setting password failed', err);
175
-        messageHandler.showError("dialog.lockTitle", 'Lock failed',
176
-            "dialog.lockMessage",
177
-            'Failed to lock conference.',
178
-            err);
177
+        messageHandler.showError("dialog.lockTitle",
178
+            "dialog.lockMessage");
179
         Toolbar.setSharedKey('');
179
         Toolbar.setSharedKey('');
180
     }, function () {
180
     }, function () {
181
         console.warn('room passwords not supported');
181
         console.warn('room passwords not supported');
182
-        messageHandler.showError("dialog.warning", 'Warning',
183
-            "dialog.passwordNotSupported",
184
-            'Room passwords are currently not supported.');
182
+        messageHandler.showError("dialog.warning",
183
+            "dialog.passwordNotSupported");
185
         Toolbar.setSharedKey('');
184
         Toolbar.setSharedKey('');
186
     });
185
     });
187
 };
186
 };
233
         = config.defaultSipNumber ? config.defaultSipNumber : '';
232
         = config.defaultSipNumber ? config.defaultSipNumber : '';
234
 
233
 
235
     var sipMsg = APP.translation.generateTranslatonHTML(
234
     var sipMsg = APP.translation.generateTranslatonHTML(
236
-        "dialog.sipMsg", "Enter SIP number");
235
+        "dialog.sipMsg");
237
     messageHandler.openTwoButtonDialog(null, null, null,
236
     messageHandler.openTwoButtonDialog(null, null, null,
238
         '<h2>' + sipMsg + '</h2>' +
237
         '<h2>' + sipMsg + '</h2>' +
239
         '<input id="sipNumber" type="text"' +
238
         '<input id="sipNumber" type="text"' +
318
                     }, url);
317
                     }, url);
319
                 if (!authenticationWindow) {
318
                 if (!authenticationWindow) {
320
                     messageHandler.openMessageDialog(
319
                     messageHandler.openMessageDialog(
321
-                        null, null, "dialog.popupError",
322
-                        "Your browser is blocking popup windows from this site." +
323
-                        " Please enable popups in your browser security settings" +
324
-                        " and try again.");
320
+                        null, "dialog.popupError");
325
                 }
321
                 }
326
             });
322
             });
327
         }
323
         }
359
         // Only the focus is able to set a shared key.
355
         // Only the focus is able to set a shared key.
360
         if (!APP.xmpp.isModerator()) {
356
         if (!APP.xmpp.isModerator()) {
361
             if (sharedKey) {
357
             if (sharedKey) {
362
-                messageHandler.openMessageDialog(null, null,
363
-                    "dialog.passwordError",
364
-                        "This conversation is currently protected by" +
365
-                        " a password. Only the owner of the conference" +
366
-                        " could set a password.",
367
-                    false,
368
-                    "Password");
358
+                messageHandler.openMessageDialog(null,
359
+                    "dialog.passwordError");
369
             } else {
360
             } else {
370
-                messageHandler.openMessageDialog(null, null, "dialog.passwordError2",
371
-                    "This conversation isn't currently protected by" +
372
-                        " a password. Only the owner of the conference" +
373
-                        " could set a password.",
374
-                    false,
375
-                    "Password");
361
+                messageHandler.openMessageDialog(null, "dialog.passwordError2");
376
             }
362
             }
377
         } else {
363
         } else {
378
             if (sharedKey) {
364
             if (sharedKey) {
379
                 messageHandler.openTwoButtonDialog(null, null,
365
                 messageHandler.openTwoButtonDialog(null, null,
380
                     "dialog.passwordCheck",
366
                     "dialog.passwordCheck",
381
-                    "Are you sure you would like to remove your password?",
367
+                    null,
382
                     false,
368
                     false,
383
                     "dialog.Remove",
369
                     "dialog.Remove",
384
                     function (e, v) {
370
                     function (e, v) {
389
                     });
375
                     });
390
             } else {
376
             } else {
391
                 var msg = APP.translation.generateTranslatonHTML(
377
                 var msg = APP.translation.generateTranslatonHTML(
392
-                    "dialog.passwordMsg", "Set a password to lock your room");
378
+                    "dialog.passwordMsg");
393
                 var yourPassword = APP.translation.translateString(
379
                 var yourPassword = APP.translation.translateString(
394
-                    "dialog.yourPassword", null, "your password");
380
+                    "dialog.yourPassword");
395
                 messageHandler.openTwoButtonDialog(null, null, null,
381
                 messageHandler.openTwoButtonDialog(null, null, null,
396
                     '<h2>' + msg + '</h2>' +
382
                     '<h2>' + msg + '</h2>' +
397
                         '<input id="lockKey" type="text"' +
383
                         '<input id="lockKey" type="text"' +
427
             inviteLink = encodeURI(roomUrl);
413
             inviteLink = encodeURI(roomUrl);
428
         }
414
         }
429
         messageHandler.openTwoButtonDialog("dialog.shareLink",
415
         messageHandler.openTwoButtonDialog("dialog.shareLink",
430
-            "Share this link with everyone you want to invite", null,
416
+            null, null,
431
             '<input id="inviteLinkRef" type="text" value="' +
417
             '<input id="inviteLinkRef" type="text" value="' +
432
                 inviteLink + '" onclick="this.select();" readonly>',
418
                 inviteLink + '" onclick="this.select();" readonly>',
433
             false,
419
             false,
455
      */
441
      */
456
     my.openSettingsDialog = function () {
442
     my.openSettingsDialog = function () {
457
         var settings1 = APP.translation.generateTranslatonHTML(
443
         var settings1 = APP.translation.generateTranslatonHTML(
458
-            "dialog.settings1", "Configure your conference");
444
+            "dialog.settings1");
459
         var settings2 = APP.translation.generateTranslatonHTML(
445
         var settings2 = APP.translation.generateTranslatonHTML(
460
-            "dialog.settings2", "Participants join muted");
446
+            "dialog.settings2");
461
         var settings3 = APP.translation.generateTranslatonHTML(
447
         var settings3 = APP.translation.generateTranslatonHTML(
462
-            "dialog.settings3", "Require nicknames<br/><br/>" +
463
-                "Set a password to lock your room:");
448
+            "dialog.settings3");
464
 
449
 
465
         var yourPassword = APP.translation.translateString(
450
         var yourPassword = APP.translation.translateString(
466
-            "dialog.yourPassword", null, "your password");
451
+            "dialog.yourPassword");
467
 
452
 
468
         messageHandler.openTwoButtonDialog(null,
453
         messageHandler.openTwoButtonDialog(null,
469
             '<h2>' + settings1 + '</h2>' +
454
             '<h2>' + settings1 + '</h2>' +

+ 16
- 28
modules/UI/util/MessageHandler.js View File

7
      * @param titleString the title of the message
7
      * @param titleString the title of the message
8
      * @param messageString the text of the message
8
      * @param messageString the text of the message
9
      */
9
      */
10
-    my.openMessageDialog = function(titleKey, titleString,
11
-                                    messageKey, messageString) {
10
+    my.openMessageDialog = function(titleKey, messageKey) {
12
         var title = null;
11
         var title = null;
13
         if(titleKey)
12
         if(titleKey)
14
         {
13
         {
15
-            title = APP.translation.generateTranslatonHTML(titleKey,
16
-                titleString);
14
+            title = APP.translation.generateTranslatonHTML(titleKey);
17
         }
15
         }
18
-        var message = APP.translation.generateTranslatonHTML(messageKey,
19
-            messageString);
16
+        var message = APP.translation.generateTranslatonHTML(messageKey);
20
         $.prompt(message,
17
         $.prompt(message,
21
             {
18
             {
22
                 title: title,
19
                 title: title,
43
         var leftButton = APP.translation.generateTranslatonHTML(leftButtonKey);
40
         var leftButton = APP.translation.generateTranslatonHTML(leftButtonKey);
44
         var buttons = {};
41
         var buttons = {};
45
         buttons.button1 = {title: leftButton, value: true};
42
         buttons.button1 = {title: leftButton, value: true};
46
-        var cancelButton = APP.translation.generateTranslatonHTML("dialog.Cancel",
47
-            "Cancel");
43
+        var cancelButton = APP.translation.generateTranslatonHTML("dialog.Cancel");
48
         buttons.button2 = {title: cancelButton, value: false};
44
         buttons.button2 = {title: cancelButton, value: false};
49
         var message = msgString, title = titleString;
45
         var message = msgString, title = titleString;
50
         if(titleKey)
46
         if(titleKey)
51
         {
47
         {
52
-            title = APP.translation.generateTranslatonHTML(titleKey, titleString);
48
+            title = APP.translation.generateTranslatonHTML(titleKey);
53
         }
49
         }
54
         if(msgKey) {
50
         if(msgKey) {
55
-            message = APP.translation.generateTranslatonHTML(msgKey, msgString);
51
+            message = APP.translation.generateTranslatonHTML(msgKey);
56
         }
52
         }
57
         $.prompt(message, {
53
         $.prompt(message, {
58
             title: title,
54
             title: title,
76
      * @param submitFunction function to be called on submit
72
      * @param submitFunction function to be called on submit
77
      * @param loadedFunction function to be called after the prompt is fully loaded
73
      * @param loadedFunction function to be called after the prompt is fully loaded
78
      */
74
      */
79
-    my.openDialog = function (titleString,    msgString, persistent, buttons,
75
+    my.openDialog = function (titleString, msgString, persistent, buttons,
80
                               submitFunction, loadedFunction) {
76
                               submitFunction, loadedFunction) {
81
         var args = {
77
         var args = {
82
             title: titleString,
78
             title: titleString,
152
      * @param msgString the text of the message
148
      * @param msgString the text of the message
153
      * @param error the error that is being reported
149
      * @param error the error that is being reported
154
      */
150
      */
155
-    my.openReportDialog = function(titleKey, titleString, msgKey,
156
-                                   msgString, error) {
157
-        my.openMessageDialog(titleKey, titleString, msgKey, msgString);
151
+    my.openReportDialog = function(titleKey, msgKey, error) {
152
+        my.openMessageDialog(titleKey, msgKey);
158
         console.log(error);
153
         console.log(error);
159
         //FIXME send the error to the server
154
         //FIXME send the error to the server
160
     };
155
     };
164
      * @param title the title of the message
159
      * @param title the title of the message
165
      * @param message the text of the messafe
160
      * @param message the text of the messafe
166
      */
161
      */
167
-    my.showError = function(titleKey, title, msgKey, message) {
162
+    my.showError = function(titleKey, msgKey) {
168
 
163
 
169
         if(!titleKey) {
164
         if(!titleKey) {
170
-            title = "Oops!";
171
             titleKey = "dialog.oops";
165
             titleKey = "dialog.oops";
172
         }
166
         }
173
         if(!msgKey)
167
         if(!msgKey)
174
         {
168
         {
175
-            message = "There was some kind of error";
176
             msgKey = "dialog.defaultError";
169
             msgKey = "dialog.defaultError";
177
         }
170
         }
178
-        messageHandler.openMessageDialog(titleKey, title, msgKey, message);
171
+        messageHandler.openMessageDialog(titleKey, msgKey);
179
     };
172
     };
180
 
173
 
181
-    my.notify = function(displayName, displayNameKey, displayNameDefault,
182
-                         cls, messageKey, messageDefault, messageArguments) {
174
+    my.notify = function(displayName, displayNameKey,
175
+                         cls, messageKey, messageArguments) {
183
         var displayNameSpan = '<span class="nickname" ';
176
         var displayNameSpan = '<span class="nickname" ';
184
         if(displayName)
177
         if(displayName)
185
         {
178
         {
188
         else
181
         else
189
         {
182
         {
190
             displayNameSpan += "data-i18n='" + displayNameKey +
183
             displayNameSpan += "data-i18n='" + displayNameKey +
191
-                "'>" + APP.translation.translateString(displayNameKey, null,
192
-                {defaultValue: displayNameDefault});
184
+                "'>" + APP.translation.translateString(displayNameKey);
193
         }
185
         }
194
         displayNameSpan += "</span>";
186
         displayNameSpan += "</span>";
195
-        var lMessageArguments = messageArguments;
196
-        if(!messageArguments)
197
-            lMessageArguments = {};
198
-        lMessageArguments.defaultValue = messageDefault;
199
         toastr.info(
187
         toastr.info(
200
             displayNameSpan + '<br>' +
188
             displayNameSpan + '<br>' +
201
             '<span class=' + cls + ' data-i18n="' + messageKey + '"' +
189
             '<span class=' + cls + ' data-i18n="' + messageKey + '"' +
202
                 (messageArguments?
190
                 (messageArguments?
203
                     " i18n-options='" + JSON.stringify(messageArguments) + "'"
191
                     " i18n-options='" + JSON.stringify(messageArguments) + "'"
204
                     : "") + ">" +
192
                     : "") + ">" +
205
-            APP.translation.translateString(messageKey, null,
206
-                lMessageArguments) +
193
+            APP.translation.translateString(messageKey,
194
+                messageArguments) +
207
             '</span>');
195
             '</span>');
208
     };
196
     };
209
 
197
 

+ 4
- 6
modules/desktopsharing/desktopsharing.js View File

92
     catch (e)
92
     catch (e)
93
     {
93
     {
94
         console.error("Failed to parse extension version", e);
94
         console.error("Failed to parse extension version", e);
95
-        APP.UI.messageHandler.showError("dialog.error", 'Error',
96
-            "dialod.detectext",
97
-            'Error when trying to detect desktopsharing extension.');
95
+        APP.UI.messageHandler.showError("dialog.error",
96
+            "dialog.detectext");
98
         return true;
97
         return true;
99
     }
98
     }
100
 }
99
 }
175
                     function (arg) {
174
                     function (arg) {
176
                         console.log("Failed to install the extension", arg);
175
                         console.log("Failed to install the extension", arg);
177
                         failCallback(arg);
176
                         failCallback(arg);
178
-                        APP.UI.messageHandler.showError("dialog.error", 'Error',
179
-                            "dialog.failtoinstall",
180
-                            'Failed to install desktop sharing extension');
177
+                        APP.UI.messageHandler.showError("dialog.error",
178
+                            "dialog.failtoinstall");
181
                     }
179
                     }
182
                 );
180
                 );
183
             }
181
             }

+ 5
- 33
modules/translation/translation.js View File

2
 var languages = require("../../service/translation/languages");
2
 var languages = require("../../service/translation/languages");
3
 var Settings = require("../settings/Settings");
3
 var Settings = require("../settings/Settings");
4
 var DEFAULT_LANG = languages.EN;
4
 var DEFAULT_LANG = languages.EN;
5
-var initialized = false;
6
-var waitingForInit = [];
7
 
5
 
8
 i18n.addPostProcessor("resolveAppName", function(value, key, options) {
6
 i18n.addPostProcessor("resolveAppName", function(value, key, options) {
9
     return value.replace("__app__", interfaceConfig.APP_NAME);
7
     return value.replace("__app__", interfaceConfig.APP_NAME);
27
     fallbackOnEmpty: true,
25
     fallbackOnEmpty: true,
28
     useDataAttrOptions: true,
26
     useDataAttrOptions: true,
29
     app: interfaceConfig.APP_NAME,
27
     app: interfaceConfig.APP_NAME,
30
-    getAsync: true,
28
+    getAsync: false,
31
     customLoad: function(lng, ns, options, done) {
29
     customLoad: function(lng, ns, options, done) {
32
         var resPath = "lang/__ns__-__lng__.json";
30
         var resPath = "lang/__ns__-__lng__.json";
33
         if(lng === languages.EN)
31
         if(lng === languages.EN)
34
             resPath = "lang/__ns__.json";
32
             resPath = "lang/__ns__.json";
35
         var url = i18n.functions.applyReplacement(resPath, { lng: lng, ns: ns });
33
         var url = i18n.functions.applyReplacement(resPath, { lng: lng, ns: ns });
36
-        initialized = false;
37
         i18n.functions.ajax({
34
         i18n.functions.ajax({
38
             url: url,
35
             url: url,
39
             success: function(data, status, xhr) {
36
             success: function(data, status, xhr) {
67
 
64
 
68
 function initCompleted(t)
65
 function initCompleted(t)
69
 {
66
 {
70
-    initialized = true;
71
     $("[data-i18n]").i18n();
67
     $("[data-i18n]").i18n();
72
-    for(var i = 0; i < waitingForInit.length; i++)
73
-    {
74
-        var obj = waitingForInit[i];
75
-        obj.callback(i18n.t(obj.key));
76
-    }
77
-    waitingForInit = [];
78
 }
68
 }
79
 
69
 
80
 function checkForParameter() {
70
 function checkForParameter() {
92
 
82
 
93
 module.exports = {
83
 module.exports = {
94
     init: function (lang) {
84
     init: function (lang) {
95
-        initialized = false;
96
         var options = defaultOptions;
85
         var options = defaultOptions;
97
 
86
 
98
 
87
 
113
 
102
 
114
         i18n.init(options, initCompleted);
103
         i18n.init(options, initCompleted);
115
     },
104
     },
116
-    translateString: function (key, cb, options) {
117
-        if(!cb)
118
-            return i18n.t(key, options);
119
-
120
-        if(initialized)
121
-        {
122
-            cb(i18n.t(key, options));
123
-        }
124
-        else
125
-        {
126
-            waitingForInit.push({"callback": cb, "key": key});
127
-        }
105
+    translateString: function (key, options) {
106
+        return i18n.t(key, options);
128
     },
107
     },
129
     setLanguage: function (lang) {
108
     setLanguage: function (lang) {
130
-        initialized = false;
131
         if(!lang)
109
         if(!lang)
132
             lang = DEFAULT_LANG;
110
             lang = DEFAULT_LANG;
133
         i18n.setLng(lang, defaultOptions, initCompleted);
111
         i18n.setLng(lang, defaultOptions, initCompleted);
138
     translateElement: function (selector) {
116
     translateElement: function (selector) {
139
         selector.i18n();
117
         selector.i18n();
140
     },
118
     },
141
-    generateTranslatonHTML: function (key, defaultString, options) {
119
+    generateTranslatonHTML: function (key, options) {
142
         var str = "<span data-i18n=\"" + key + "\"";
120
         var str = "<span data-i18n=\"" + key + "\"";
143
         if(options)
121
         if(options)
144
         {
122
         {
145
             str += " data-i18n-options=\"" + JSON.stringify(options) + "\"";
123
             str += " data-i18n-options=\"" + JSON.stringify(options) + "\"";
146
         }
124
         }
147
         str += ">";
125
         str += ">";
148
-        if(!options)
149
-            options = {};
150
-        if(defaultString)
151
-        {
152
-            options.defaultValue = defaultString;
153
-        }
154
-        str += this.translateString(key, null, options);
126
+        str += this.translateString(key, options);
155
         str += "</span>";
127
         str += "</span>";
156
         return str;
128
         return str;
157
 
129
 

+ 2
- 3
modules/xmpp/JingleSession.js View File

1226
 {
1226
 {
1227
     this.service.sessionTerminated = true;
1227
     this.service.sessionTerminated = true;
1228
     this.connection.emuc.doLeave();
1228
     this.connection.emuc.doLeave();
1229
-    APP.UI.messageHandler.showError("dialog.sorry", "Sorry",
1230
-        "dialog.internalError",
1231
-        "Internal application error[setRemoteDescription]");
1229
+    APP.UI.messageHandler.showError("dialog.sorry",
1230
+        "dialog.internalError");
1232
 }
1231
 }
1233
 
1232
 
1234
 JingleSession.prototype.setLocalDescription = function () {
1233
 JingleSession.prototype.setLocalDescription = function () {

+ 1
- 3
modules/xmpp/moderator.js View File

324
                 if (!invalidSession) {
324
                 if (!invalidSession) {
325
                     APP.UI.messageHandler.notify(
325
                     APP.UI.messageHandler.notify(
326
                         null, "notify.focus",
326
                         null, "notify.focus",
327
-                        'Conference focus', 'disconnected', "notify.focusFail",
328
-                        focusComponent + " not available - retry in " +
329
-                            retrySec + " sec",
327
+                        'disconnected', "notify.focusFail",
330
                         {component: focusComponent, ms: retrySec});
328
                         {component: focusComponent, ms: retrySec});
331
                 }
329
                 }
332
                 // Reset response timeout
330
                 // Reset response timeout

+ 4
- 12
modules/xmpp/strophe.emuc.js View File

285
                     // We're either missing Jicofo/Prosody config for anonymous
285
                     // We're either missing Jicofo/Prosody config for anonymous
286
                     // domains or something is wrong.
286
                     // domains or something is wrong.
287
 //                    XMPP.promptLogin();
287
 //                    XMPP.promptLogin();
288
-                    APP.UI.messageHandler.openReportDialog(null, null,
289
-                        "dialog.joinError",
290
-                        'Oops ! We couldn`t join the conference.' +
291
-                        ' There might be some problem with security' +
292
-                        ' configuration. Please contact service' +
293
-                        ' administrator.', pres);
288
+                    APP.UI.messageHandler.openReportDialog(null,
289
+                        "dialog.joinError", pres);
294
                 } else {
290
                 } else {
295
                     console.warn('onPresError ', pres);
291
                     console.warn('onPresError ', pres);
296
-                    APP.UI.messageHandler.openReportDialog(null, null,
292
+                    APP.UI.messageHandler.openReportDialog(null,
297
                         "dialog.connectError",
293
                         "dialog.connectError",
298
-                        'Oops! Something went wrong and we couldn`t ' +
299
-                            'connect to the conference.',
300
                         pres);
294
                         pres);
301
                 }
295
                 }
302
             } else {
296
             } else {
303
                 console.warn('onPresError ', pres);
297
                 console.warn('onPresError ', pres);
304
-                APP.UI.messageHandler.openReportDialog(null, null,
298
+                APP.UI.messageHandler.openReportDialog(null,
305
                     "dialog.connectError",
299
                     "dialog.connectError",
306
-                    'Oops! Something went wrong and we couldn`t ' +
307
-                        'connect to the conference.',
308
                     pres);
300
                     pres);
309
             }
301
             }
310
             return true;
302
             return true;

+ 5
- 9
modules/xmpp/xmpp.js View File

252
         } else {
252
         } else {
253
             // We are done immediately
253
             // We are done immediately
254
             console.error("No conference handler");
254
             console.error("No conference handler");
255
-            APP.UI.messageHandler.showError("dialog.error", 'Error',
256
-                "dialog.unableToSwitch", 'Unable to switch video stream.');
255
+            APP.UI.messageHandler.showError("dialog.error",
256
+                "dialog.unableToSwitch");
257
             callback();
257
             callback();
258
         }
258
         }
259
     },
259
     },
315
                             function (error) {
315
                             function (error) {
316
                                 console.log('mute SLD error');
316
                                 console.log('mute SLD error');
317
                                 APP.UI.messageHandler.showError("dialog.error",
317
                                 APP.UI.messageHandler.showError("dialog.error",
318
-                                    'Error', "dialog.SLDFailure",
319
-                                    'Oops! Something went wrong and we failed to ' +
320
-                                    'mute! (SLD Failure)');
318
+                                    "dialog.SLDFailure");
321
                             }
319
                             }
322
                         );
320
                         );
323
                     },
321
                     },
329
             },
327
             },
330
             function (error) {
328
             function (error) {
331
                 console.log('muteVideo SRD error');
329
                 console.log('muteVideo SRD error');
332
-                APP.UI.messageHandler.showError("dialog.error", 'Error',
333
-                    "dialog.SRDFailure",
334
-                    'Oops! Something went wrong and we failed to stop video!' +
335
-                    '(SRD Failure)');
330
+                APP.UI.messageHandler.showError("dialog.error",
331
+                    "dialog.SRDFailure");
336
 
332
 
337
             }
333
             }
338
         );
334
         );

Loading…
Cancel
Save