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

Side by Side Diff: ui/webui/resources/js/i18n_behavior.js

Issue 1842403004: MD Settings: Certificate manager, move "Import" button to the tab level. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « chrome/test/data/webui/settings/certificate_manager_page_test.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * 'I18nBehavior' is a behavior to mix in loading of 7 * 'I18nBehavior' is a behavior to mix in loading of
8 * internationalization strings. 8 * internationalization strings.
9 * 9 *
10 * Example: 10 * Example:
11 * behaviors: [ 11 * behaviors: [
12 * I18nBehavior, 12 * I18nBehavior,
13 * ], 13 * ],
14 */ 14 */
15 15
16 /** @polymerBehavior */ 16 /** @polymerBehavior */
17 var I18nBehavior = { 17 var I18nBehavior = {
18 /** 18 /**
19 * @param {string} id The ID of the string to translate. 19 * @param {string} id The ID of the string to translate.
20 * @param {...string} var_args Placeholders required by the string ($1-9). 20 * @param {...string=} var_args Placeholders required by the string ($0-9).
21 * @return {string} A translated, substituted string. 21 * @return {string} A translated, substituted string.
22 */ 22 */
23 i18n: function(id, var_args) { 23 i18n: function(id, var_args) {
24 return loadTimeData.getStringF.apply(loadTimeData, arguments); 24 return arguments.length > 1 ?
Dan Beam 2016/04/02 02:08:16 nit: return arguments.length == 1 ? loadTimeData.
dpapad 2016/04/04 17:25:51 Done.
25 loadTimeData.getStringF.apply(loadTimeData, arguments) :
26 loadTimeData.getString.apply(loadTimeData, arguments);
Dan Beam 2016/04/02 02:08:16 this is equivalent to loadTimeData.getString(id)
dpapad 2016/04/04 17:25:51 Done.
25 }, 27 },
26 }; 28 };
OLDNEW
« no previous file with comments | « chrome/test/data/webui/settings/certificate_manager_page_test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698