diff --git a/app/ui.js b/app/ui.js index ceb72092..fd769c57 100644 --- a/app/ui.js +++ b/app/ui.js @@ -51,6 +51,8 @@ var UI; window.onscriptsload = function () { UI.load(); }; /* [end skip-as-module] */ + var _ = Util.Localisation.get; + UI = { connected: false, @@ -390,26 +392,26 @@ var UI; switch (state) { case 'connecting': - document.getElementById("noVNC_transition_text").innerHTML = Util.Localisation.get("Connecting..."); + document.getElementById("noVNC_transition_text").innerHTML = _("Connecting..."); document.documentElement.classList.add("noVNC_connecting"); break; case 'connected': UI.connected = true; document.documentElement.classList.add("noVNC_connected"); if (rfb && rfb.get_encrypt()) { - msg = Util.Localisation.get("Connected (encrypted) to ") + UI.desktopName; + msg = _("Connected (encrypted) to ") + UI.desktopName; } else { - msg = Util.Localisation.get("Connected (unencrypted) to ") + UI.desktopName; + msg = _("Connected (unencrypted) to ") + UI.desktopName; } UI.showStatus(msg); break; case 'disconnecting': - document.getElementById("noVNC_transition_text").innerHTML = Util.Localisation.get("Disconnecting..."); + document.getElementById("noVNC_transition_text").innerHTML = _("Disconnecting..."); document.documentElement.classList.add("noVNC_disconnecting"); break; case 'disconnected': UI.connected = false; - UI.showStatus(Util.Localisation.get("Disconnected")); + UI.showStatus(_("Disconnected")); break; default: msg = "Invalid UI state"; @@ -994,7 +996,7 @@ var UI; } if ((!host) || (!port)) { - var msg = Util.Localisation.get("Must set host and port"); + var msg = _("Must set host and port"); Util.Error(msg); UI.showStatus(msg, 'error'); return; @@ -1260,9 +1262,9 @@ var UI; // The browser is IE and we are in fullscreen mode. // - We need to force clipping while in fullscreen since // scrollbars doesn't work. - var msg = Util.Localisation.get("Forcing clipping mode since " + - "scrollbars aren't supported " + - "by IE in fullscreen"); + var msg = _("Forcing clipping mode since " + + "scrollbars aren't supported " + + "by IE in fullscreen"); Util.Debug(msg); UI.showStatus(msg); UI.rememberedClipSetting = UI.getSetting('clip'); diff --git a/core/rfb.js b/core/rfb.js index d10d6662..ddc92bbb 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -263,6 +263,8 @@ }; (function() { + var _ = Util.Localisation.get; + RFB.prototype = { // Public methods connect: function (host, port, password, path) { @@ -273,7 +275,7 @@ if (!this._rfb_host || !this._rfb_port) { return this._fail( - Util.Localisation.get("Must set host and port")); + _("Must set host and port")); } this._rfb_init_state = '';