summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-13 00:34:19 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-13 00:34:19 +0000
commit05fb21ad04a244abd969a843875dc9cf483ed890 (patch)
tree89041949e63b54687042b83c119955c76132bbe4 /remoting
parent1e0f45ab919ba4649c6757b7f84176a88a1076c0 (diff)
downloadchromium_src-05fb21ad04a244abd969a843875dc9cf483ed890.zip
chromium_src-05fb21ad04a244abd969a843875dc9cf483ed890.tar.gz
chromium_src-05fb21ad04a244abd969a843875dc9cf483ed890.tar.bz2
Don't replace $1 with an empty string when localizing string for host plugin.
Previously chrome.l18n.getString() wouldn't touch $1 within the resource when substitutions are not specified. This was fixed in crrev.com/141280, and now it replaced $1 with an empty strings, which broke chromoting host localization that relied on the previous incorrect behaviour. Fixed the webapp to correctly handle strings substitutions. BUG=132146 Review URL: https://chromiumcodereview.appspot.com/10533101 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141804 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/webapp/host_session.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/remoting/webapp/host_session.js b/remoting/webapp/host_session.js
index d1f9a14..fb064e5 100644
--- a/remoting/webapp/host_session.js
+++ b/remoting/webapp/host_session.js
@@ -72,7 +72,16 @@ remoting.HostSession.prototype.createPluginAndConnect =
this.plugin.onNatTraversalPolicyChanged = onNatTraversalPolicyChanged;
this.plugin.onStateChanged = onStateChanged;
this.plugin.logDebugInfo = logDebugInfo;
- this.plugin.localize(chrome.i18n.getMessage);
+ this.plugin.localize(
+ /** @param {string} id */
+ function(id) {
+ // Plugin takes care of string substitution, so we just keep
+ // $ placeholders.
+ // TODO(sergeyu): Refactor plugin location so that it
+ // doesn't need to do any substitutions. crbug.com/132370 .
+ return chrome.i18n.getMessage(id, ["$1", "$2", "$3"]);
+ }
+ );
this.plugin.connect(email, 'oauth2:' + accessToken);
};