Commit 918d530e authored by estade's avatar estade Committed by Commit bot

get rid of almost all old fashioned i18nTemplates

BUG=122753

Review URL: https://codereview.chromium.org/586953002

Cr-Commit-Position: refs/heads/master@{#296131}
parent 186f0c58
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<title i18n-content="title"></title> <title i18n-content="title"></title>
<link rel="stylesheet" href="image_burner.css"> <link rel="stylesheet" href="image_burner.css">
<script src="chrome://resources/js/util.js"></script> <script src="chrome://resources/js/util.js"></script>
<script src="chrome://resources/js/local_strings.js"></script> <script src="chrome://resources/js/load_time_data.js"></script>
<script src="chrome://imageburner/strings.js"></script> <script src="chrome://imageburner/strings.js"></script>
<script src="chrome://imageburner/image_burner.js"></script> <script src="chrome://imageburner/image_burner.js"></script>
</head> </head>
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<header id="burn-header"> <header id="burn-header">
<h1 i18n-content="headerTitle"></h1> <h1 i18n-content="headerTitle"></h1>
<p i18n-content="headerDescription"></p> <p i18n-content="headerDescription"></p>
<a id="more-info-link" jsvalues="href:moreInfoLink" target="_blank" <a id="more-info-link" i18n-values="href:moreInfoLink" target="_blank"
i18n-content="headerLink"></a> i18n-content="headerLink"></a>
</header> </header>
<div id="main-content"> <div id="main-content">
...@@ -40,8 +40,6 @@ ...@@ -40,8 +40,6 @@
</div> </div>
<div id="burn-footer"></div> <div id="burn-footer"></div>
</div> </div>
<script src="chrome://resources/js/i18n_template.js"></script> <script src="chrome://resources/js/i18n_template2.js"></script>
<script src="chrome://resources/js/i18n_process.js"></script>
<script src="chrome://resources/js/jstemplate_compiled.js"></script>
</body> </body>
</html> </html>
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
var localStrings;
var browserBridge; var browserBridge;
/** /**
...@@ -102,10 +101,10 @@ State.prototype = { ...@@ -102,10 +101,10 @@ State.prototype = {
$('warning-text').textContent = this.state.warningText; $('warning-text').textContent = this.state.warningText;
if (this.isInitialState() && this.state != State.StatesEnum.DEVICE_NONE) { if (this.isInitialState() && this.state != State.StatesEnum.DEVICE_NONE) {
$('warning-button').textContent = localStrings.getString('confirmButton'); $('warning-button').textContent = loadTimeData.getString('confirmButton');
} else if (this.state == State.StatesEnum.FAIL) { } else if (this.state == State.StatesEnum.FAIL) {
$('warning-button').textContent = $('warning-button').textContent =
localStrings.getString('retryButton'); loadTimeData.getString('retryButton');
} }
}, },
...@@ -184,7 +183,7 @@ DeviceSelection.prototype = { ...@@ -184,7 +183,7 @@ DeviceSelection.prototype = {
this.selectedDevice = devicePath; this.selectedDevice = devicePath;
$('warning-text').textContent = $('warning-text').textContent =
localStrings.getStringF('warningDevices', label); loadTimeData.getStringF('warningDevices', label);
}, },
/** /**
...@@ -303,7 +302,7 @@ DeviceSelection.prototype = { ...@@ -303,7 +302,7 @@ DeviceSelection.prototype = {
* @constructor * @constructor
*/ */
function BrowserBridge() { function BrowserBridge() {
this.currentState = new State(localStrings); this.currentState = new State(loadTimeData);
this.deviceSelection = new DeviceSelection(); this.deviceSelection = new DeviceSelection();
// We will use these often so it makes sence making them class members to // We will use these often so it makes sence making them class members to
// avoid frequent document.getElementById calls. // avoid frequent document.getElementById calls.
...@@ -426,7 +425,7 @@ BrowserBridge.prototype = { ...@@ -426,7 +425,7 @@ BrowserBridge.prototype = {
reportDeviceTooSmall: function(deviceSize) { reportDeviceTooSmall: function(deviceSize) {
this.currentState.changeState(State.StatesEnum.ERROR_DEVICE_TOO_SMALL); this.currentState.changeState(State.StatesEnum.ERROR_DEVICE_TOO_SMALL);
$('warning-text').textContent = $('warning-text').textContent =
localStrings.getStringF('warningNoSpace', deviceSize); loadTimeData.getStringF('warningNoSpace', deviceSize);
}, },
/** /**
...@@ -439,11 +438,8 @@ BrowserBridge.prototype = { ...@@ -439,11 +438,8 @@ BrowserBridge.prototype = {
}; };
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
localStrings = new LocalStrings();
browserBridge = new BrowserBridge(); browserBridge = new BrowserBridge();
jstProcess(new JsEvalContext(templateData), $('more-info-link'));
$('cancel-button').onclick = $('cancel-button').onclick =
browserBridge.sendCancelMessage.bind(browserBridge); browserBridge.sendCancelMessage.bind(browserBridge);
browserBridge.sendGetDevicesMessage(); browserBridge.sendGetDevicesMessage();
......
...@@ -34,7 +34,7 @@ function copyAttributes_(source, destination) { ...@@ -34,7 +34,7 @@ function copyAttributes_(source, destination) {
for (var i in source) for (var i in source)
destination[i] = source[i]; destination[i] = source[i];
return destination; return destination;
}; }
/** /**
* Apply localization to |element| with i18n_template.js if available. * Apply localization to |element| with i18n_template.js if available.
...@@ -42,9 +42,9 @@ function copyAttributes_(source, destination) { ...@@ -42,9 +42,9 @@ function copyAttributes_(source, destination) {
* @private * @private
*/ */
function localize_(element) { function localize_(element) {
if (window.i18nTemplate && window.templateData) if (window.i18nTemplate && window.loadTimeData)
i18nTemplate.process(element, templateData); i18nTemplate.process(element, loadTimeData);
}; }
/** /**
* Returns 'N/A' (Not Available) text if |value| is undefined. * Returns 'N/A' (Not Available) text if |value| is undefined.
...@@ -518,7 +518,6 @@ function dump() { ...@@ -518,7 +518,6 @@ function dump() {
function onLoad() { function onLoad() {
cr.ui.decorate('tabbox', cr.ui.TabBox); cr.ui.decorate('tabbox', cr.ui.TabBox);
localize_(document);
cr.quota.onAvailableSpaceUpdated.addEventListener('update', cr.quota.onAvailableSpaceUpdated.addEventListener('update',
handleAvailableSpace); handleAvailableSpace);
......
...@@ -12,7 +12,7 @@ found in the LICENSE file. ...@@ -12,7 +12,7 @@ found in the LICENSE file.
<script src="chrome://resources/js/util.js"></script> <script src="chrome://resources/js/util.js"></script>
<script src="chrome://resources/js/cr.js"></script> <script src="chrome://resources/js/cr.js"></script>
<script src="chrome://resources/js/cr/event_target.js"></script> <script src="chrome://resources/js/cr/event_target.js"></script>
<script src="chrome://resources/js/i18n_template.js"></script> <script src="chrome://resources/js/load_time_data.js"></script>
<link rel="stylesheet" href="chrome://resources/css/tabs.css"> <link rel="stylesheet" href="chrome://resources/css/tabs.css">
<link rel="stylesheet" href="chrome://resources/css/tree.css"> <link rel="stylesheet" href="chrome://resources/css/tree.css">
...@@ -24,6 +24,7 @@ found in the LICENSE file. ...@@ -24,6 +24,7 @@ found in the LICENSE file.
<script src="chrome://quota-internals/message_dispatcher.js"></script> <script src="chrome://quota-internals/message_dispatcher.js"></script>
<script src="chrome://quota-internals/event_handler.js"></script> <script src="chrome://quota-internals/event_handler.js"></script>
<script src="chrome://quota-internals/strings.js"></script>
<body i18n-values=".style.fontFamily:fontfamily;.style.fontSize:fontsize"> <body i18n-values=".style.fontFamily:fontfamily;.style.fontSize:fontsize">
...@@ -72,5 +73,6 @@ found in the LICENSE file. ...@@ -72,5 +73,6 @@ found in the LICENSE file.
</tabpanels> </tabpanels>
</tabbox> </tabbox>
<script src="chrome://resources/js/i18n_template2.js"></script>
</body> </body>
</html> </html>
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title i18n-content="page-title"></title> <title i18n-content="page-title"></title>
<script src="chrome://resources/js/local_strings.js"></script>
<script src="chrome://resources/js/cr.js"></script> <script src="chrome://resources/js/cr.js"></script>
<script src="chrome://resources/js/load_time_data.js"></script>
<script src="chrome://resources/js/util.js"></script> <script src="chrome://resources/js/util.js"></script>
<script src="chrome://resources/js/cr/event_target.js"></script> <script src="chrome://resources/js/cr/event_target.js"></script>
<script src="strings.js"></script> <script src="strings.js"></script>
...@@ -37,6 +37,5 @@ ...@@ -37,6 +37,5 @@
</div> </div>
</div> </div>
</body> </body>
<script src="chrome://resources/js/i18n_template.js"></script> <script src="chrome://resources/js/i18n_template2.js"></script>
<script src="chrome://resources/js/i18n_process.js"></script>
</html> </html>
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<title>Signin Internals</title> <title>Signin Internals</title>
<script src="chrome://resources/js/cr.js"></script> <script src="chrome://resources/js/cr.js"></script>
<script src="chrome://resources/js/util.js"></script> <script src="chrome://resources/js/util.js"></script>
<script src="chrome://resources/js/load_time_data.js"></script>
<script src="chrome://signin-internals/strings.js"></script> <script src="chrome://signin-internals/strings.js"></script>
<link rel="stylesheet" type="text/css" href="signin_index.css"> <link rel="stylesheet" type="text/css" href="signin_index.css">
</head> </head>
...@@ -65,8 +66,7 @@ ...@@ -65,8 +66,7 @@
</table> </table>
</div> </div>
</div> </div>
<script src="chrome://resources/js/i18n_template.js"></script> <script src="chrome://resources/js/i18n_template2.js"></script>
<script src="chrome://resources/js/i18n_process.js"></script>
<script src="chrome://resources/js/jstemplate_compiled.js"></script> <script src="chrome://resources/js/jstemplate_compiled.js"></script>
<script src="chrome://signin-internals/signin_internals.js"></script> <script src="chrome://signin-internals/signin_internals.js"></script>
</body> </body>
......
...@@ -12,12 +12,13 @@ found in the LICENSE file. ...@@ -12,12 +12,13 @@ found in the LICENSE file.
<script src="chrome://resources/js/util.js"></script> <script src="chrome://resources/js/util.js"></script>
<script src="chrome://resources/js/cr.js"></script> <script src="chrome://resources/js/cr.js"></script>
<script src="chrome://resources/js/cr/event_target.js"></script> <script src="chrome://resources/js/cr/event_target.js"></script>
<script src="chrome://resources/js/i18n_template.js"></script>
<link rel="stylesheet" href="chrome://resources/css/tabs.css"> <link rel="stylesheet" href="chrome://resources/css/tabs.css">
<script src="chrome://resources/js/load_time_data.js"></script>
<script src="chrome://resources/js/cr/ui.js"></script> <script src="chrome://resources/js/cr/ui.js"></script>
<script src="chrome://resources/js/cr/ui/tabs.js"></script> <script src="chrome://resources/js/cr/ui/tabs.js"></script>
<script src="chrome://resources/js/cr/ui/focus_outline_manager.js"></script> <script src="chrome://resources/js/cr/ui/focus_outline_manager.js"></script>
<script src="chrome://syncfs-internals/strings.js"></script>
<script src="chrome://syncfs-internals/utils.js"></script> <script src="chrome://syncfs-internals/utils.js"></script>
<body i18n-values=".style.fontFamily:fontfamily;.style.fontSize:fontsize"> <body i18n-values=".style.fontFamily:fontfamily;.style.fontSize:fontsize">
...@@ -49,5 +50,6 @@ found in the LICENSE file. ...@@ -49,5 +50,6 @@ found in the LICENSE file.
</tabpanels> </tabpanels>
</tabbox> </tabbox>
<script src="chrome://resources/js/i18n_template2.js"></script>
</body> </body>
</html> </html>
...@@ -78,6 +78,7 @@ content::WebUIDataSource* CreateImageburnerUIHTMLSource() { ...@@ -78,6 +78,7 @@ content::WebUIDataSource* CreateImageburnerUIHTMLSource() {
source->AddLocalizedString("retryButton", IDS_IMAGEBURN_RETRY_BUTTON); source->AddLocalizedString("retryButton", IDS_IMAGEBURN_RETRY_BUTTON);
source->AddString("moreInfoLink", base::ASCIIToUTF16(kMoreInfoLink)); source->AddString("moreInfoLink", base::ASCIIToUTF16(kMoreInfoLink));
source->SetUseJsonJSFormatV2();
source->SetJsonPath("strings.js"); source->SetJsonPath("strings.js");
source->AddResourcePath("image_burner.js", IDR_IMAGEBURNER_JS); source->AddResourcePath("image_burner.js", IDR_IMAGEBURNER_JS);
source->SetDefaultResource(IDR_IMAGEBURNER_HTML); source->SetDefaultResource(IDR_IMAGEBURNER_HTML);
......
...@@ -22,6 +22,7 @@ content::WebUIDataSource* CreateQuotaInternalsHTMLSource() { ...@@ -22,6 +22,7 @@ content::WebUIDataSource* CreateQuotaInternalsHTMLSource() {
content::WebUIDataSource* source = content::WebUIDataSource* source =
content::WebUIDataSource::Create(chrome::kChromeUIQuotaInternalsHost); content::WebUIDataSource::Create(chrome::kChromeUIQuotaInternalsHost);
source->SetUseJsonJSFormatV2();
source->SetJsonPath("strings.js"); source->SetJsonPath("strings.js");
source->AddResourcePath( source->AddResourcePath(
"event_handler.js", IDR_QUOTA_INTERNALS_EVENT_HANDLER_JS); "event_handler.js", IDR_QUOTA_INTERNALS_EVENT_HANDLER_JS);
......
...@@ -64,6 +64,7 @@ enum MakeChromeDefaultResult { ...@@ -64,6 +64,7 @@ enum MakeChromeDefaultResult {
content::WebUIDataSource* CreateSetAsDefaultBrowserUIHTMLSource() { content::WebUIDataSource* CreateSetAsDefaultBrowserUIHTMLSource() {
content::WebUIDataSource* data_source = content::WebUIDataSource::Create( content::WebUIDataSource* data_source = content::WebUIDataSource::Create(
chrome::kChromeUIMetroFlowHost); chrome::kChromeUIMetroFlowHost);
data_source->SetUseJsonJSFormatV2();
data_source->AddLocalizedString("page-title", IDS_METRO_FLOW_TAB_TITLE); data_source->AddLocalizedString("page-title", IDS_METRO_FLOW_TAB_TITLE);
data_source->AddLocalizedString("flowTitle", IDS_METRO_FLOW_TITLE_SHORT); data_source->AddLocalizedString("flowTitle", IDS_METRO_FLOW_TITLE_SHORT);
data_source->AddLocalizedString("flowDescription", data_source->AddLocalizedString("flowDescription",
......
...@@ -19,9 +19,9 @@ content::WebUIDataSource* CreateSignInInternalsHTMLSource() { ...@@ -19,9 +19,9 @@ content::WebUIDataSource* CreateSignInInternalsHTMLSource() {
content::WebUIDataSource* source = content::WebUIDataSource* source =
content::WebUIDataSource::Create(chrome::kChromeUISignInInternalsHost); content::WebUIDataSource::Create(chrome::kChromeUISignInInternalsHost);
source->SetUseJsonJSFormatV2();
source->SetJsonPath("strings.js"); source->SetJsonPath("strings.js");
source->AddResourcePath("signin_internals.js", source->AddResourcePath("signin_internals.js", IDR_SIGNIN_INTERNALS_INDEX_JS);
IDR_SIGNIN_INTERNALS_INDEX_JS);
source->SetDefaultResource(IDR_SIGNIN_INTERNALS_INDEX_HTML); source->SetDefaultResource(IDR_SIGNIN_INTERNALS_INDEX_HTML);
return source; return source;
} }
......
...@@ -21,6 +21,7 @@ content::WebUIDataSource* CreateSyncFileSystemInternalsHTMLSource() { ...@@ -21,6 +21,7 @@ content::WebUIDataSource* CreateSyncFileSystemInternalsHTMLSource() {
content::WebUIDataSource* source = content::WebUIDataSource* source =
content::WebUIDataSource::Create( content::WebUIDataSource::Create(
chrome::kChromeUISyncFileSystemInternalsHost); chrome::kChromeUISyncFileSystemInternalsHost);
source->SetUseJsonJSFormatV2();
source->SetJsonPath("strings.js"); source->SetJsonPath("strings.js");
source->AddResourcePath( source->AddResourcePath(
"utils.js", "utils.js",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment