Updates some translations for login dialog.

This commit is contained in:
damencho 2016-10-18 11:16:52 -05:00
parent 0455c26fb2
commit 54cfbaaba0
2 changed files with 14 additions and 16 deletions

View File

@ -146,16 +146,13 @@ function doXmppAuth (room, lockPassword) {
room.getName(), APP.conference._getConferenceOptions()
);
loginDialog.displayConnectionStatus(
APP.translation.translateString('connection.FETCH_SESSION_ID')
);
loginDialog.displayConnectionStatus('connection.FETCH_SESSION_ID');
newRoom.room.moderator.authenticate().then(function () {
connection.disconnect();
loginDialog.displayConnectionStatus(
APP.translation.translateString('connection.GOT_SESSION_ID')
);
'connection.GOT_SESSION_ID');
// authenticate conference on the fly
room.join(lockPassword);
@ -166,11 +163,8 @@ function doXmppAuth (room, lockPassword) {
console.error('Auth on the fly failed', error);
let errorMsg = APP.translation.translateString(
'connection.GET_SESSION_ID_ERROR'
);
loginDialog.displayError(errorMsg + code);
loginDialog.displayError(
'connection.GET_SESSION_ID_ERROR', code);
});
}, function (err) {
loginDialog.displayError(err);

View File

@ -128,27 +128,31 @@ function LoginDialog(successCallback, cancelCallback) {
/**
* Displays error message in 'finished' state which allows either to cancel
* or retry.
* @param message the final message to be displayed.
* @param messageKey the key to the message to be displayed.
* @param code the code error (optional)
*/
this.displayError = function (message) {
this.displayError = function (messageKey, code) {
let finishedState = connDialog.getState('finished');
let errorMessageElem = finishedState.find('#errorMessage');
errorMessageElem.text(message);
errorMessageElem.attr("data-i18n", messageKey);
errorMessageElem.text(
APP.translation.translateString(messageKey) + (code ? code : ''));
connDialog.goToState('finished');
};
/**
* Show message as connection status.
* @param {string} message
* @param {string} messageKey the key to the message
*/
this.displayConnectionStatus = function (message) {
this.displayConnectionStatus = function (messageKey) {
let connectingState = connDialog.getState('connecting');
let connectionStatus = connectingState.find('#connectionStatus');
connectionStatus.text(message);
connectionStatus.attr("data-i18n", messageKey);
connectionStatus.text(APP.translation.translateString(messageKey));
};
/**