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

Unified Diff: ui/webui/resources/js/i18n_behavior.js

Issue 1952253004: I18nBehavior: make i18nRaw private as raw_, add tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@i18n-behavior
Patch Set: . Created 4 years, 7 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
« no previous file with comments | « chrome/test/data/webui/webui_resource_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/js/i18n_behavior.js
diff --git a/ui/webui/resources/js/i18n_behavior.js b/ui/webui/resources/js/i18n_behavior.js
index 2a8a6c38797042f467fe2719b7e4aabd1d63f86b..f8c97ad6bdf4b42cd061d1bc152234d248933d36 100644
--- a/ui/webui/resources/js/i18n_behavior.js
+++ b/ui/webui/resources/js/i18n_behavior.js
@@ -22,8 +22,9 @@ var I18nBehavior = {
* @param {...string} var_args Values to replace the placeholders $1 to $9
* in the string.
* @return {string} A translated, substituted string.
+ * @private
*/
- i18nRaw: function(id, var_args) {
+ i18nRaw_: function(id, var_args) {
return arguments.length == 1 ? loadTimeData.getString(id) :
loadTimeData.getStringF.apply(loadTimeData, arguments);
},
@@ -37,7 +38,7 @@ var I18nBehavior = {
* @return {string} A translated, sanitized, substituted string.
*/
i18n: function(id, var_args) {
- var rawString = this.i18nRaw.apply(this, arguments);
+ var rawString = this.i18nRaw_.apply(this, arguments);
return parseHtmlSubset('<b>' + rawString + '</b>').firstChild.innerHTML;
},
@@ -52,8 +53,8 @@ var I18nBehavior = {
*/
i18nAdvanced: function(id, opts) {
var args = [id].concat(opts.substitutions || []);
- var rawString = this.i18nRaw.apply(this, args);
+ var rawString = this.i18nRaw_.apply(this, args);
return parseHtmlSubset('<b>' + rawString + '</b>', opts.tags, opts.attrs)
.firstChild.innerHTML;
- }
+ },
};
« no previous file with comments | « chrome/test/data/webui/webui_resource_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698