OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 * Namespace for utility functions. | 6 * Namespace for utility functions. |
7 */ | 7 */ |
8 var util = {}; | 8 var util = {}; |
9 | 9 |
10 /** | 10 /** |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 pending--; | 603 pending--; |
604 maybeDone(); | 604 maybeDone(); |
605 } else { | 605 } else { |
606 readEntry(childEntry, depth + 1); | 606 readEntry(childEntry, depth + 1); |
607 } | 607 } |
608 }); | 608 }); |
609 } | 609 } |
610 | 610 |
611 readEntry(root, 0); | 611 readEntry(root, 0); |
612 }; | 612 }; |
| 613 |
| 614 /** |
| 615 * Return a translated string. |
| 616 * |
| 617 * Wrapper function to make dealing with translated strings more concise. |
| 618 * Equivalent to loadTimeData.getString(id). |
| 619 * |
| 620 * @param {string} id The id of the string to return. |
| 621 * @return {string} The translated string. |
| 622 */ |
| 623 function str(id) { |
| 624 return loadTimeData.getString(id); |
| 625 } |
| 626 |
| 627 /** |
| 628 * Return a translated string with arguments replaced. |
| 629 * |
| 630 * Wrapper function to make dealing with translated strings more concise. |
| 631 * Equivilant to loadTimeData.getStringF(id, ...). |
| 632 * |
| 633 * @param {string} id The id of the string to return. |
| 634 * @param {...string} var_args The values to replace into the string. |
| 635 * @return {string} The translated string with replaced values. |
| 636 */ |
| 637 function strf(id, var_args) { |
| 638 return loadTimeData.getStringF.apply(loadTimeData, arguments); |
| 639 } |
| 640 |
OLD | NEW |