| OLD | NEW |
| 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 * @group Chrome Settings Elements | 15 * @group Chrome UI Behavior |
| 16 */ | 16 */ |
| 17 | 17 |
| 18 var I18nBehavior = { | 18 var I18nBehavior = { |
| 19 /** | 19 /** |
| 20 * @param {string} id The ID of the string to translate. | 20 * @param {string} id The ID of the string to translate. |
| 21 * @param {...var_args} Placeholders required by the string ($1-9). | 21 * @param {...var_args} Placeholders required by the string ($1-9). |
| 22 * @return {string} A translated, substituted string. | 22 * @return {string} A translated, substituted string. |
| 23 */ | 23 */ |
| 24 i18n: function(id, var_args) { | 24 i18n: function(id, var_args) { |
| 25 return loadTimeData.getStringF.apply(loadTimeData, arguments); | 25 return loadTimeData.getStringF.apply(loadTimeData, arguments); |
| 26 }, | 26 }, |
| 27 }; | 27 }; |
| OLD | NEW |