Chromium Code Reviews| Index: ui/webui/resources/js/i18n_template.js |
| diff --git a/ui/webui/resources/js/i18n_template.js b/ui/webui/resources/js/i18n_template.js |
| index f34d46e85c7cc5d927342be34614e5cb1fb7c412..ffc4119cb2595873ab7c1d111a91f085d9a796be 100644 |
| --- a/ui/webui/resources/js/i18n_template.js |
| +++ b/ui/webui/resources/js/i18n_template.js |
| @@ -1,7 +1,26 @@ |
| -// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// 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. |
| <include src="i18n_template_no_process.js"> |
| -i18nTemplate.process(document, loadTimeData); |
| +(function() { |
|
arv (Not doing code reviews)
2015/07/07 22:35:28
We have real block scope now =P
Dan Beam
2015/07/08 02:22:30
Done. (in https://codereview.chromium.org/12295730
|
| + |
| +var docs = [document]; |
| + |
| +var importLinks = document.querySelectorAll('link[rel=import]'); |
| +for (var i = 0; i < importLinks.length; ++i) { |
| + docs.push(importLinks[i].import); |
| +} |
| + |
| +for (var i = 0; i < docs.length; ++i) { |
| + var doc = docs[i]; |
| + i18nTemplate.process(doc, loadTimeData); |
| + |
| + var templates = doc.querySelectorAll('template'); |
| + for (var j = 0; j < templates.length; ++j) { |
| + i18nTemplate.process(templates[j].content, loadTimeData); |
| + } |
| +} |
| + |
| +}()); |