diff options
author | arv@google.com <arv@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-16 23:08:55 +0000 |
---|---|---|
committer | arv@google.com <arv@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-16 23:08:55 +0000 |
commit | 4c8a86f8e37d96d6e0836215665698ad42577de4 (patch) | |
tree | 314ba04c72d74ed505c8163b002606601b89772f /chrome/common/jstemplate_builder.cc | |
parent | 4b87e474248a7d635df9b48983c89f61f7f6d570 (diff) | |
download | chromium_src-4c8a86f8e37d96d6e0836215665698ad42577de4.zip chromium_src-4c8a86f8e37d96d6e0836215665698ad42577de4.tar.gz chromium_src-4c8a86f8e37d96d6e0836215665698ad42577de4.tar.bz2 |
Make LocalStrings work without manipulating the DOM.
BUG=None
TEST=Make sure that localized text on NTP, History and Downloads still
look the same.
Review URL: http://codereview.chromium.org/125076
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18551 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/jstemplate_builder.cc')
-rw-r--r-- | chrome/common/jstemplate_builder.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/chrome/common/jstemplate_builder.cc b/chrome/common/jstemplate_builder.cc index 62e6a0f..8f2bab7 100644 --- a/chrome/common/jstemplate_builder.cc +++ b/chrome/common/jstemplate_builder.cc @@ -43,9 +43,12 @@ std::string GetTemplateHtml(const StringPiece& html_template, output.append(jstemplate_src.data(), jstemplate_src.size()); output.append("var tp = document.getElementById('"); output.append(template_id.data(), template_id.size()); - output.append("'); var cx = new JsEvalContext("); + output.append("');"); + output.append("var templateData = "); output.append(jstext); - output.append("); jstProcess(cx, tp);</script>"); + output.append(";"); + output.append("jstProcess(new JsEvalContext(templateData), tp);"); + output.append("</script>"); return output; } |