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

Unified Diff: chrome/browser/resources/settings/i18n_behavior/i18n_behavior.js

Issue 1391333005: [MD settings] adding load time data behavior for i18n strings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review changes Created 5 years, 2 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: chrome/browser/resources/settings/i18n_behavior/i18n_behavior.js
diff --git a/chrome/browser/resources/settings/i18n_behavior/i18n_behavior.js b/chrome/browser/resources/settings/i18n_behavior/i18n_behavior.js
new file mode 100644
index 0000000000000000000000000000000000000000..f499e837c3061a5d88ddd1e0cd35be7e520f623b
--- /dev/null
+++ b/chrome/browser/resources/settings/i18n_behavior/i18n_behavior.js
@@ -0,0 +1,27 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * @fileoverview
+ * 'I18nBehavior' is a behavior to mix in loading of
+ * internationalization strings.
+ *
+ * Example:
+ * behaviors: [
+ * I18nBehavior,
+ * ],
+ *
+ * @group Chrome Settings Elements
+ */
+
+var I18nBehavior = {
+ /**
+ * @param {string} id The ID of the string to translate.
+ * @param {...var_args} Placeholders required by the string ($1-9).
+ * @return {string} A translated, substituted string.
+ */
+ i18n: function(id, var_args) {
+ return loadTimeData.getStringF.apply(loadTimeData, arguments);
+ },
+};

Powered by Google App Engine
This is Rietveld 408576698