Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(894)

Unified Diff: ui/base/webui/jstemplate_builder.cc

Issue 2908353003: [i18n] components directory to $i18n{} (Closed)
Patch Set: handle blank cohort name Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/base/webui/jstemplate_builder.cc
diff --git a/ui/base/webui/jstemplate_builder.cc b/ui/base/webui/jstemplate_builder.cc
index 16a338a8755a7c601e523a20164ea48fdff5795c..9a46766553d2fd09a672914117b1f2ce2e4ceb63 100644
--- a/ui/base/webui/jstemplate_builder.cc
+++ b/ui/base/webui/jstemplate_builder.cc
@@ -121,7 +121,15 @@ std::string GetI18nTemplateHtml(const base::StringPiece& html_template,
std::string GetTemplatesHtml(const base::StringPiece& html_template,
const base::DictionaryValue* json,
const base::StringPiece& template_id) {
- std::string output(html_template.data(), html_template.size());
+ ui::TemplateReplacements replacements;
+ ui::TemplateReplacementsFromDictionaryValue(*json, &replacements);
+ std::string output =
+ ui::ReplaceTemplateExpressions(html_template, replacements);
+
+ // TODO(dschuyler): After the i18n-content and i18n-values are replaced with
+ // $i18n{} replacements, we will be able to return output at this point.
+ // Remove Append*() lines that builds up the i18n replacement work to be done
+ // in JavaScript.
AppendLoadTimeData(&output);
AppendJsonHtml(json, &output);
AppendI18nTemplateSourceHtml(&output);
« chrome/browser/ui/webui/version_ui.cc ('K') | « components/version_ui/resources/about_version.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698