From 62a731e244d6c7d4b082670e9932eefce97973dc Mon Sep 17 00:00:00 2001 From: hristoterezov Date: Fri, 3 Jul 2015 12:34:05 +0300 Subject: [PATCH] Fixes typo in translation module interface. --- index.html | 2 +- lang/Translation.md | 4 +- libs/app.bundle.js | 80 ++++++++++----------- modules/UI/UI.js | 16 ++--- modules/UI/authentication/Authentication.js | 6 +- modules/UI/authentication/LoginDialog.js | 4 +- modules/UI/prezi/Prezi.js | 10 +-- modules/UI/toolbars/Toolbar.js | 18 ++--- modules/UI/util/MessageHandler.js | 12 ++-- modules/UI/videolayout/LocalVideo.js | 10 +-- modules/UI/videolayout/RemoteVideo.js | 2 +- modules/translation/translation.js | 2 +- 12 files changed, 83 insertions(+), 83 deletions(-) diff --git a/index.html b/index.html index 861b078d6..bb66bf92b 100644 --- a/index.html +++ b/index.html @@ -22,7 +22,7 @@ - + diff --git a/lang/Translation.md b/lang/Translation.md index 5fb6d9db1..2911c3412 100644 --- a/lang/Translation.md +++ b/lang/Translation.md @@ -30,11 +30,11 @@ You can add translatable text in the HTML: ``` - You can also use APP.translation.generateTranslatonHTML(key, options) to get this HTML code as Javascript string. + You can also use APP.translation.generateTranslationHTML(key, options) to get this HTML code as Javascript string. ``` - APP.translation.generateTranslatonHTML("dialog.OK") // returns OK + APP.translation.generateTranslationHTML("dialog.OK") // returns OK ``` The value in the options parameter will be added in data-i18n-options attribute of the element. diff --git a/libs/app.bundle.js b/libs/app.bundle.js index 244bfe043..d411ecc39 100644 --- a/libs/app.bundle.js +++ b/libs/app.bundle.js @@ -1564,7 +1564,7 @@ function promptDisplayName() { '" autofocus>'; var buttonTxt - = APP.translation.generateTranslatonHTML("dialog.Ok"); + = APP.translation.generateTranslationHTML("dialog.Ok"); var buttons = []; buttons.push({title: buttonTxt, value: "ok"}); @@ -1642,15 +1642,15 @@ function streamHandler(stream, isMuted) { function onXmppConnectionFailed(stropheErrorMsg) { - var title = APP.translation.generateTranslatonHTML( + var title = APP.translation.generateTranslationHTML( "dialog.error"); var message; if (stropheErrorMsg) { - message = APP.translation.generateTranslatonHTML( + message = APP.translation.generateTranslationHTML( "dialog.connectErrorWithMsg", {msg: stropheErrorMsg}); } else { - message = APP.translation.generateTranslatonHTML( + message = APP.translation.generateTranslationHTML( "dialog.connectError"); } @@ -1731,9 +1731,9 @@ function registerListeners() { ); }); APP.xmpp.addListener(XMPPEvents.RESERVATION_ERROR, function (code, msg) { - var title = APP.translation.generateTranslatonHTML( + var title = APP.translation.generateTranslationHTML( "dialog.reservationError"); - var message = APP.translation.generateTranslatonHTML( + var message = APP.translation.generateTranslationHTML( "dialog.reservationErrorMsg", {code: code, msg: msg}); messageHandler.openDialog( title, @@ -1752,7 +1752,7 @@ function registerListeners() { APP.xmpp.addListener(XMPPEvents.MUC_DESTROYED, function (reason) { //FIXME: use Session Terminated from translation, but // 'reason' text comes from XMPP packet and is not translated - var title = APP.translation.generateTranslatonHTML("dialog.sessTerminated"); + var title = APP.translation.generateTranslationHTML("dialog.sessTerminated"); messageHandler.openDialog( title, reason, true, {}, function (event, value, message, formVals) @@ -1979,7 +1979,7 @@ function updateChatConversation(from, displayName, message, myjid, stamp) { function onMucJoined(jid, info) { Toolbar.updateRoomUrl(window.location.href); - var meHTML = APP.translation.generateTranslatonHTML("me"); + var meHTML = APP.translation.generateTranslationHTML("me"); $("#localNick").html(Strophe.getResourceFromJid(jid) + " (" + meHTML + ")"); var settings = Settings.getSettings(); @@ -2778,13 +2778,13 @@ var Authentication = { var room = roomName.substr(0, roomName.indexOf('@')); var title - = APP.translation.generateTranslatonHTML("dialog.WaitingForHost"); + = APP.translation.generateTranslationHTML("dialog.WaitingForHost"); var msg - = APP.translation.generateTranslatonHTML( + = APP.translation.generateTranslationHTML( "dialog.WaitForHostMsg", {room: room}); var buttonTxt - = APP.translation.generateTranslatonHTML("dialog.IamHost"); + = APP.translation.generateTranslationHTML("dialog.IamHost"); var buttons = []; buttons.push({title: buttonTxt, value: "authNow"}); @@ -2912,9 +2912,9 @@ function Dialog(callback, obtainSession) { 'type="password" data-i18n="[placeholder]dialog.userPassword"' + ' placeholder="user password">'; - var okButton = APP.translation.generateTranslatonHTML("dialog.Ok"); + var okButton = APP.translation.generateTranslationHTML("dialog.Ok"); - var cancelButton = APP.translation.generateTranslatonHTML("dialog.Cancel"); + var cancelButton = APP.translation.generateTranslationHTML("dialog.Cancel"); var states = { login: { @@ -3389,13 +3389,13 @@ var Prezi = { ); } else { - var html = APP.translation.generateTranslatonHTML( + var html = APP.translation.generateTranslationHTML( "dialog.sharePreziTitle"); - var cancelButton = APP.translation.generateTranslatonHTML( + var cancelButton = APP.translation.generateTranslationHTML( "dialog.Cancel"); - var shareButton = APP.translation.generateTranslatonHTML( + var shareButton = APP.translation.generateTranslationHTML( "dialog.Share"); - var backButton = APP.translation.generateTranslatonHTML( + var backButton = APP.translation.generateTranslationHTML( "dialog.Back"); var buttons = []; var buttons1 = []; @@ -3406,7 +3406,7 @@ var Prezi = { buttons.push({title: shareButton, value: true}); // Back button buttons1.push({title: backButton, value: true}); - var linkError = APP.translation.generateTranslatonHTML( + var linkError = APP.translation.generateTranslationHTML( "dialog.preziLinkError"); var defaultUrl = APP.translation.translateString("defaultPreziLink", {url: "http://prezi.com/wz7vhjycl7e6/my-prezi"}); @@ -5201,11 +5201,11 @@ function hangup() { } - var title = APP.translation.generateTranslatonHTML( + var title = APP.translation.generateTranslationHTML( "dialog.sessTerminated"); - var msg = APP.translation.generateTranslatonHTML( + var msg = APP.translation.generateTranslationHTML( "dialog.hungUp"); - var button = APP.translation.generateTranslatonHTML( + var button = APP.translation.generateTranslationHTML( "dialog.joinAgain"); var buttons = []; buttons.push({title: button, value: true}); @@ -5229,7 +5229,7 @@ function hangup() { function toggleRecording() { APP.xmpp.toggleRecording(function (callback) { - var msg = APP.translation.generateTranslatonHTML( + var msg = APP.translation.generateTranslationHTML( "dialog.recordingToken"); var token = APP.translation.translateString("dialog.token"); APP.UI.messageHandler.openTwoButtonDialog(null, null, null, @@ -5334,7 +5334,7 @@ function callSipButtonClicked() var defaultNumber = config.defaultSipNumber ? config.defaultSipNumber : ''; - var sipMsg = APP.translation.generateTranslatonHTML( + var sipMsg = APP.translation.generateTranslationHTML( "dialog.sipMsg"); messageHandler.openTwoButtonDialog(null, null, null, '

' + sipMsg + '

' + @@ -5474,7 +5474,7 @@ var Toolbar = (function (my) { } }); } else { - var msg = APP.translation.generateTranslatonHTML( + var msg = APP.translation.generateTranslationHTML( "dialog.passwordMsg"); var yourPassword = APP.translation.translateString( "dialog.yourPassword"); @@ -5544,11 +5544,11 @@ var Toolbar = (function (my) { * FIXME: not used ? */ my.openSettingsDialog = function () { - var settings1 = APP.translation.generateTranslatonHTML( + var settings1 = APP.translation.generateTranslationHTML( "dialog.settings1"); - var settings2 = APP.translation.generateTranslatonHTML( + var settings2 = APP.translation.generateTranslationHTML( "dialog.settings2"); - var settings3 = APP.translation.generateTranslatonHTML( + var settings3 = APP.translation.generateTranslationHTML( "dialog.settings3"); var yourPassword = APP.translation.translateString( @@ -6002,9 +6002,9 @@ var messageHandler = (function(my) { var title = null; if(titleKey) { - title = APP.translation.generateTranslatonHTML(titleKey); + title = APP.translation.generateTranslationHTML(titleKey); } - var message = APP.translation.generateTranslatonHTML(messageKey); + var message = APP.translation.generateTranslationHTML(messageKey); $.prompt(message, { title: title, @@ -6034,20 +6034,20 @@ var messageHandler = (function(my) { { var buttons = []; - var leftButton = APP.translation.generateTranslatonHTML(leftButtonKey); + var leftButton = APP.translation.generateTranslationHTML(leftButtonKey); buttons.push({ title: leftButton, value: true}); var cancelButton - = APP.translation.generateTranslatonHTML("dialog.Cancel"); + = APP.translation.generateTranslationHTML("dialog.Cancel"); buttons.push({title: cancelButton, value: false}); var message = msgString, title = titleString; if (titleKey) { - title = APP.translation.generateTranslatonHTML(titleKey); + title = APP.translation.generateTranslationHTML(titleKey); } if (msgKey) { - message = APP.translation.generateTranslatonHTML(msgKey); + message = APP.translation.generateTranslationHTML(msgKey); } $.prompt(message, { title: title, @@ -7239,7 +7239,7 @@ LocalVideo.prototype.setDisplayName = function(displayName, key) { } var nameSpan = $('#' + this.videoSpanId + '>span.displayname'); - var defaultLocalDisplayName = APP.translation.generateTranslatonHTML( + var defaultLocalDisplayName = APP.translation.generateTranslationHTML( interfaceConfig.DEFAULT_LOCAL_DISPLAY_NAME); // If we already have a display name for this video. @@ -7248,7 +7248,7 @@ LocalVideo.prototype.setDisplayName = function(displayName, key) { if (nameSpan.text() !== displayName) { if (displayName && displayName.length > 0) { - var meHTML = APP.translation.generateTranslatonHTML("me"); + var meHTML = APP.translation.generateTranslationHTML("me"); $('#localDisplayName').html(displayName + ' (' + meHTML + ')'); } else @@ -7263,7 +7263,7 @@ LocalVideo.prototype.setDisplayName = function(displayName, key) { if (displayName && displayName.length > 0) { - var meHTML = APP.translation.generateTranslatonHTML("me"); + var meHTML = APP.translation.generateTranslationHTML("me"); nameSpan.innerHTML = displayName + meHTML; } else { @@ -7327,12 +7327,12 @@ LocalVideo.prototype.inputDisplayNameHandler = function (name) { if (!$('#localDisplayName').is(":visible")) { if (NicknameHandler.getNickname()) { - var meHTML = APP.translation.generateTranslatonHTML("me"); + var meHTML = APP.translation.generateTranslationHTML("me"); $('#localDisplayName').html(NicknameHandler.getNickname() + " (" + meHTML + ")"); } else { - var defaultHTML = APP.translation.generateTranslatonHTML( + var defaultHTML = APP.translation.generateTranslationHTML( interfaceConfig.DEFAULT_LOCAL_DISPLAY_NAME); $('#localDisplayName') .html(defaultHTML); @@ -7768,7 +7768,7 @@ RemoteVideo.prototype.setDisplayName = function(displayName, key) { } else if (key && key.length > 0) { - var nameHtml = APP.translation.generateTranslatonHTML(key); + var nameHtml = APP.translation.generateTranslationHTML(key); $('#' + this.videoSpanId + '_name').html(nameHtml); } else @@ -11375,7 +11375,7 @@ module.exports = { translateElement: function (selector) { selector.i18n(); }, - generateTranslatonHTML: function (key, options) { + generateTranslationHTML: function (key, options) { var str = "'; var buttonTxt - = APP.translation.generateTranslatonHTML("dialog.Ok"); + = APP.translation.generateTranslationHTML("dialog.Ok"); var buttons = []; buttons.push({title: buttonTxt, value: "ok"}); @@ -122,15 +122,15 @@ function streamHandler(stream, isMuted) { function onXmppConnectionFailed(stropheErrorMsg) { - var title = APP.translation.generateTranslatonHTML( + var title = APP.translation.generateTranslationHTML( "dialog.error"); var message; if (stropheErrorMsg) { - message = APP.translation.generateTranslatonHTML( + message = APP.translation.generateTranslationHTML( "dialog.connectErrorWithMsg", {msg: stropheErrorMsg}); } else { - message = APP.translation.generateTranslatonHTML( + message = APP.translation.generateTranslationHTML( "dialog.connectError"); } @@ -211,9 +211,9 @@ function registerListeners() { ); }); APP.xmpp.addListener(XMPPEvents.RESERVATION_ERROR, function (code, msg) { - var title = APP.translation.generateTranslatonHTML( + var title = APP.translation.generateTranslationHTML( "dialog.reservationError"); - var message = APP.translation.generateTranslatonHTML( + var message = APP.translation.generateTranslationHTML( "dialog.reservationErrorMsg", {code: code, msg: msg}); messageHandler.openDialog( title, @@ -232,7 +232,7 @@ function registerListeners() { APP.xmpp.addListener(XMPPEvents.MUC_DESTROYED, function (reason) { //FIXME: use Session Terminated from translation, but // 'reason' text comes from XMPP packet and is not translated - var title = APP.translation.generateTranslatonHTML("dialog.sessTerminated"); + var title = APP.translation.generateTranslationHTML("dialog.sessTerminated"); messageHandler.openDialog( title, reason, true, {}, function (event, value, message, formVals) @@ -459,7 +459,7 @@ function updateChatConversation(from, displayName, message, myjid, stamp) { function onMucJoined(jid, info) { Toolbar.updateRoomUrl(window.location.href); - var meHTML = APP.translation.generateTranslatonHTML("me"); + var meHTML = APP.translation.generateTranslationHTML("me"); $("#localNick").html(Strophe.getResourceFromJid(jid) + " (" + meHTML + ")"); var settings = Settings.getSettings(); diff --git a/modules/UI/authentication/Authentication.js b/modules/UI/authentication/Authentication.js index 61de93578..9cefee1b2 100644 --- a/modules/UI/authentication/Authentication.js +++ b/modules/UI/authentication/Authentication.js @@ -22,13 +22,13 @@ var Authentication = { var room = roomName.substr(0, roomName.indexOf('@')); var title - = APP.translation.generateTranslatonHTML("dialog.WaitingForHost"); + = APP.translation.generateTranslationHTML("dialog.WaitingForHost"); var msg - = APP.translation.generateTranslatonHTML( + = APP.translation.generateTranslationHTML( "dialog.WaitForHostMsg", {room: room}); var buttonTxt - = APP.translation.generateTranslatonHTML("dialog.IamHost"); + = APP.translation.generateTranslationHTML("dialog.IamHost"); var buttons = []; buttons.push({title: buttonTxt, value: "authNow"}); diff --git a/modules/UI/authentication/LoginDialog.js b/modules/UI/authentication/LoginDialog.js index f2d7ce2f9..c1fd0f9f5 100644 --- a/modules/UI/authentication/LoginDialog.js +++ b/modules/UI/authentication/LoginDialog.js @@ -31,9 +31,9 @@ function Dialog(callback, obtainSession) { 'type="password" data-i18n="[placeholder]dialog.userPassword"' + ' placeholder="user password">'; - var okButton = APP.translation.generateTranslatonHTML("dialog.Ok"); + var okButton = APP.translation.generateTranslationHTML("dialog.Ok"); - var cancelButton = APP.translation.generateTranslatonHTML("dialog.Cancel"); + var cancelButton = APP.translation.generateTranslationHTML("dialog.Cancel"); var states = { login: { diff --git a/modules/UI/prezi/Prezi.js b/modules/UI/prezi/Prezi.js index baaeb197f..3935d6fe3 100644 --- a/modules/UI/prezi/Prezi.js +++ b/modules/UI/prezi/Prezi.js @@ -58,13 +58,13 @@ var Prezi = { ); } else { - var html = APP.translation.generateTranslatonHTML( + var html = APP.translation.generateTranslationHTML( "dialog.sharePreziTitle"); - var cancelButton = APP.translation.generateTranslatonHTML( + var cancelButton = APP.translation.generateTranslationHTML( "dialog.Cancel"); - var shareButton = APP.translation.generateTranslatonHTML( + var shareButton = APP.translation.generateTranslationHTML( "dialog.Share"); - var backButton = APP.translation.generateTranslatonHTML( + var backButton = APP.translation.generateTranslationHTML( "dialog.Back"); var buttons = []; var buttons1 = []; @@ -75,7 +75,7 @@ var Prezi = { buttons.push({title: shareButton, value: true}); // Back button buttons1.push({title: backButton, value: true}); - var linkError = APP.translation.generateTranslatonHTML( + var linkError = APP.translation.generateTranslationHTML( "dialog.preziLinkError"); var defaultUrl = APP.translation.translateString("defaultPreziLink", {url: "http://prezi.com/wz7vhjycl7e6/my-prezi"}); diff --git a/modules/UI/toolbars/Toolbar.js b/modules/UI/toolbars/Toolbar.js index 6f90afffe..16e2af2ca 100644 --- a/modules/UI/toolbars/Toolbar.js +++ b/modules/UI/toolbars/Toolbar.js @@ -101,11 +101,11 @@ function hangup() { } - var title = APP.translation.generateTranslatonHTML( + var title = APP.translation.generateTranslationHTML( "dialog.sessTerminated"); - var msg = APP.translation.generateTranslatonHTML( + var msg = APP.translation.generateTranslationHTML( "dialog.hungUp"); - var button = APP.translation.generateTranslatonHTML( + var button = APP.translation.generateTranslationHTML( "dialog.joinAgain"); var buttons = []; buttons.push({title: button, value: true}); @@ -129,7 +129,7 @@ function hangup() { function toggleRecording() { APP.xmpp.toggleRecording(function (callback) { - var msg = APP.translation.generateTranslatonHTML( + var msg = APP.translation.generateTranslationHTML( "dialog.recordingToken"); var token = APP.translation.translateString("dialog.token"); APP.UI.messageHandler.openTwoButtonDialog(null, null, null, @@ -234,7 +234,7 @@ function callSipButtonClicked() var defaultNumber = config.defaultSipNumber ? config.defaultSipNumber : ''; - var sipMsg = APP.translation.generateTranslatonHTML( + var sipMsg = APP.translation.generateTranslationHTML( "dialog.sipMsg"); messageHandler.openTwoButtonDialog(null, null, null, '

' + sipMsg + '

' + @@ -374,7 +374,7 @@ var Toolbar = (function (my) { } }); } else { - var msg = APP.translation.generateTranslatonHTML( + var msg = APP.translation.generateTranslationHTML( "dialog.passwordMsg"); var yourPassword = APP.translation.translateString( "dialog.yourPassword"); @@ -444,11 +444,11 @@ var Toolbar = (function (my) { * FIXME: not used ? */ my.openSettingsDialog = function () { - var settings1 = APP.translation.generateTranslatonHTML( + var settings1 = APP.translation.generateTranslationHTML( "dialog.settings1"); - var settings2 = APP.translation.generateTranslatonHTML( + var settings2 = APP.translation.generateTranslationHTML( "dialog.settings2"); - var settings3 = APP.translation.generateTranslatonHTML( + var settings3 = APP.translation.generateTranslationHTML( "dialog.settings3"); var yourPassword = APP.translation.translateString( diff --git a/modules/UI/util/MessageHandler.js b/modules/UI/util/MessageHandler.js index f4f1a32d3..148015d65 100644 --- a/modules/UI/util/MessageHandler.js +++ b/modules/UI/util/MessageHandler.js @@ -11,9 +11,9 @@ var messageHandler = (function(my) { var title = null; if(titleKey) { - title = APP.translation.generateTranslatonHTML(titleKey); + title = APP.translation.generateTranslationHTML(titleKey); } - var message = APP.translation.generateTranslatonHTML(messageKey); + var message = APP.translation.generateTranslationHTML(messageKey); $.prompt(message, { title: title, @@ -43,20 +43,20 @@ var messageHandler = (function(my) { { var buttons = []; - var leftButton = APP.translation.generateTranslatonHTML(leftButtonKey); + var leftButton = APP.translation.generateTranslationHTML(leftButtonKey); buttons.push({ title: leftButton, value: true}); var cancelButton - = APP.translation.generateTranslatonHTML("dialog.Cancel"); + = APP.translation.generateTranslationHTML("dialog.Cancel"); buttons.push({title: cancelButton, value: false}); var message = msgString, title = titleString; if (titleKey) { - title = APP.translation.generateTranslatonHTML(titleKey); + title = APP.translation.generateTranslationHTML(titleKey); } if (msgKey) { - message = APP.translation.generateTranslatonHTML(msgKey); + message = APP.translation.generateTranslationHTML(msgKey); } $.prompt(message, { title: title, diff --git a/modules/UI/videolayout/LocalVideo.js b/modules/UI/videolayout/LocalVideo.js index d035299e0..62dfaaaa0 100644 --- a/modules/UI/videolayout/LocalVideo.js +++ b/modules/UI/videolayout/LocalVideo.js @@ -46,7 +46,7 @@ LocalVideo.prototype.setDisplayName = function(displayName, key) { } var nameSpan = $('#' + this.videoSpanId + '>span.displayname'); - var defaultLocalDisplayName = APP.translation.generateTranslatonHTML( + var defaultLocalDisplayName = APP.translation.generateTranslationHTML( interfaceConfig.DEFAULT_LOCAL_DISPLAY_NAME); // If we already have a display name for this video. @@ -55,7 +55,7 @@ LocalVideo.prototype.setDisplayName = function(displayName, key) { if (nameSpan.text() !== displayName) { if (displayName && displayName.length > 0) { - var meHTML = APP.translation.generateTranslatonHTML("me"); + var meHTML = APP.translation.generateTranslationHTML("me"); $('#localDisplayName').html(displayName + ' (' + meHTML + ')'); } else @@ -70,7 +70,7 @@ LocalVideo.prototype.setDisplayName = function(displayName, key) { if (displayName && displayName.length > 0) { - var meHTML = APP.translation.generateTranslatonHTML("me"); + var meHTML = APP.translation.generateTranslationHTML("me"); nameSpan.innerHTML = displayName + meHTML; } else { @@ -134,12 +134,12 @@ LocalVideo.prototype.inputDisplayNameHandler = function (name) { if (!$('#localDisplayName').is(":visible")) { if (NicknameHandler.getNickname()) { - var meHTML = APP.translation.generateTranslatonHTML("me"); + var meHTML = APP.translation.generateTranslationHTML("me"); $('#localDisplayName').html(NicknameHandler.getNickname() + " (" + meHTML + ")"); } else { - var defaultHTML = APP.translation.generateTranslatonHTML( + var defaultHTML = APP.translation.generateTranslationHTML( interfaceConfig.DEFAULT_LOCAL_DISPLAY_NAME); $('#localDisplayName') .html(defaultHTML); diff --git a/modules/UI/videolayout/RemoteVideo.js b/modules/UI/videolayout/RemoteVideo.js index 61e2a90ff..8e0d31d51 100644 --- a/modules/UI/videolayout/RemoteVideo.js +++ b/modules/UI/videolayout/RemoteVideo.js @@ -347,7 +347,7 @@ RemoteVideo.prototype.setDisplayName = function(displayName, key) { } else if (key && key.length > 0) { - var nameHtml = APP.translation.generateTranslatonHTML(key); + var nameHtml = APP.translation.generateTranslationHTML(key); $('#' + this.videoSpanId + '_name').html(nameHtml); } else diff --git a/modules/translation/translation.js b/modules/translation/translation.js index ecf3864db..a1bafc38d 100644 --- a/modules/translation/translation.js +++ b/modules/translation/translation.js @@ -122,7 +122,7 @@ module.exports = { translateElement: function (selector) { selector.i18n(); }, - generateTranslatonHTML: function (key, options) { + generateTranslationHTML: function (key, options) { var str = "