浏览代码

Updates some translations for login dialog.

master
damencho 8 年前
父节点
当前提交
54cfbaaba0
共有 2 个文件被更改,包括 14 次插入16 次删除
  1. 4
    10
      modules/UI/authentication/AuthHandler.js
  2. 10
    6
      modules/UI/authentication/LoginDialog.js

+ 4
- 10
modules/UI/authentication/AuthHandler.js 查看文件

@@ -146,16 +146,13 @@ function doXmppAuth (room, lockPassword) {
146 146
                 room.getName(), APP.conference._getConferenceOptions()
147 147
             );
148 148
 
149
-            loginDialog.displayConnectionStatus(
150
-                APP.translation.translateString('connection.FETCH_SESSION_ID')
151
-            );
149
+            loginDialog.displayConnectionStatus('connection.FETCH_SESSION_ID');
152 150
 
153 151
             newRoom.room.moderator.authenticate().then(function () {
154 152
                 connection.disconnect();
155 153
 
156 154
                 loginDialog.displayConnectionStatus(
157
-                    APP.translation.translateString('connection.GOT_SESSION_ID')
158
-                );
155
+                    'connection.GOT_SESSION_ID');
159 156
 
160 157
                 // authenticate conference on the fly
161 158
                 room.join(lockPassword);
@@ -166,11 +163,8 @@ function doXmppAuth (room, lockPassword) {
166 163
 
167 164
                 console.error('Auth on the fly failed', error);
168 165
 
169
-                let errorMsg = APP.translation.translateString(
170
-                    'connection.GET_SESSION_ID_ERROR'
171
-                );
172
-
173
-                loginDialog.displayError(errorMsg + code);
166
+                loginDialog.displayError(
167
+                    'connection.GET_SESSION_ID_ERROR', code);
174 168
             });
175 169
         }, function (err) {
176 170
             loginDialog.displayError(err);

+ 10
- 6
modules/UI/authentication/LoginDialog.js 查看文件

@@ -128,27 +128,31 @@ function LoginDialog(successCallback, cancelCallback) {
128 128
     /**
129 129
      * Displays error message in 'finished' state which allows either to cancel
130 130
      * or retry.
131
-     * @param message the final message to be displayed.
131
+     * @param messageKey the key to the message to be displayed.
132
+     * @param code the code error (optional)
132 133
      */
133
-    this.displayError = function (message) {
134
+    this.displayError = function (messageKey, code) {
134 135
 
135 136
         let finishedState = connDialog.getState('finished');
136 137
 
137 138
         let errorMessageElem = finishedState.find('#errorMessage');
138
-        errorMessageElem.text(message);
139
+        errorMessageElem.attr("data-i18n", messageKey);
140
+        errorMessageElem.text(
141
+            APP.translation.translateString(messageKey) + (code ? code : ''));
139 142
 
140 143
         connDialog.goToState('finished');
141 144
     };
142 145
 
143 146
     /**
144 147
      *  Show message as connection status.
145
-     * @param {string} message
148
+     * @param {string} messageKey the key to the message
146 149
      */
147
-    this.displayConnectionStatus = function (message) {
150
+    this.displayConnectionStatus = function (messageKey) {
148 151
         let connectingState = connDialog.getState('connecting');
149 152
 
150 153
         let connectionStatus = connectingState.find('#connectionStatus');
151
-        connectionStatus.text(message);
154
+        connectionStatus.attr("data-i18n", messageKey);
155
+        connectionStatus.text(APP.translation.translateString(messageKey));
152 156
     };
153 157
 
154 158
     /**

正在加载...
取消
保存