Bug 1336434 - "Your Top Sites" heading should say "Top Sites" instead when using the default set. r?gijs
MozReview-Commit-ID: 3TXSxKSqgJy
--- a/browser/base/content/newtab/grid.js
+++ b/browser/base/content/newtab/grid.js
@@ -137,27 +137,34 @@ var gGrid = {
// Create cells.
let cells = Array.from(fragment.childNodes, (cell) => new Cell(this, cell));
// Fetch links.
let links = gLinks.getLinks();
// Create sites.
let numLinks = Math.min(links.length, cells.length);
+ let hasHistoryTiles = false;
for (let i = 0; i < numLinks; i++) {
if (links[i]) {
this.createSite(links[i], cells[i]);
+ if (links[i].type == "history") {
+ hasHistoryTiles = true;
+ }
}
}
this._cells = cells;
while (this._gridDefaultContent.nextSibling) {
this._gridDefaultContent.nextSibling.remove();
}
this._node.appendChild(fragment);
+
+ document.getElementById("topsites-heading").textContent =
+ newTabString(hasHistoryTiles ? "userTopSites.heading" : "defaultTopSites.heading");
},
/**
* Calculate the height for a number of rows up to the maximum rows
* @param rows Number of rows defaulting to the max
*/
_computeHeight: function Grid_computeHeight(aRows) {
let {gridRows} = gGridPrefs;
--- a/browser/base/content/newtab/newTab.xhtml
+++ b/browser/base/content/newtab/newTab.xhtml
@@ -75,17 +75,17 @@
<input id="newtab-search-submit" type="button"
title="&contentSearchSubmit.tooltip;"/>
</div>
</div>
<div id="newtab-horizontal-margin">
<div class="newtab-side-margin"/>
<div id="newtab-grid">
- <h1 id="topsites-heading">&newtab.topSites.heading;</h1>
+ <h1 id="topsites-heading"/>
</div>
<div class="newtab-side-margin"/>
</div>
<div id="newtab-margin-bottom"/>
</div>
<input id="newtab-customize-button" type="button" dir="&locale.dir;"
value="⚙"
--- a/browser/locales/en-US/chrome/browser/newTab.dtd
+++ b/browser/locales/en-US/chrome/browser/newTab.dtd
@@ -1,15 +1,14 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!-- These strings are used in the about:newtab page -->
<!ENTITY newtab.pageTitle "New Tab">
-<!ENTITY newtab.topSites.heading "Your Top Sites">
<!ENTITY newtab.customize.classic "Show your top sites">
<!ENTITY newtab.customize.cog.enhanced "Include suggested sites">
<!ENTITY newtab.customize.cog.title2 "NEW TAB CONTROLS">
<!ENTITY newtab.customize.cog.learn "Learn about New Tab">
<!ENTITY newtab.customize.title "Customize your New Tab page">
<!ENTITY newtab.customize.suggested "Show suggested and your top sites">
<!ENTITY newtab.customize.topsites "Show your top sites">
<!ENTITY newtab.customize.blank2 "Show blank page">
--- a/browser/locales/en-US/chrome/browser/newTab.properties
+++ b/browser/locales/en-US/chrome/browser/newTab.properties
@@ -1,12 +1,15 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+newtab.defaultTopSites.heading=Top Sites
+newtab.userTopSites.heading=Your Top Sites
+
newtab.pin=Pin this site at its current position
newtab.unpin=Unpin this site
newtab.block=Remove this site
# LOCALIZATION NOTE(newtab.sponsored.button): This text appears for sponsored
# and enhanced tiles on the same line as the tile's title, so prefer short
# strings to avoid overlap. This string should be uppercase.
newtab.sponsored.button=SPONSORED
# LOCALIZATION NOTE(newtab.suggested.button): This text appears for sponsored