Bug 1685133 - String changes due to newtab updates r=preferences-reviewers,prathiksha,fluent-reviewers,flod,ntim

Differential Revision: https://phabricator.services.mozilla.com/D100819
This commit is contained in:
Erica Wright 2021-01-08 07:34:44 +00:00
Родитель 8a8ce8a54f
Коммит eed886e7e2
9 изменённых файлов: 71 добавлений и 10 удалений

Просмотреть файл

@ -569,6 +569,25 @@ const PanelUI = {
); );
} }
// When these prefs are made the default, add this data-l10n-id directly to browser.xhtml.
if (
Services.prefs.getBoolPref(
"browser.newtabpage.activity-stream.customizationMenu.enabled"
) ||
Services.prefs.getBoolPref(
"browser.newtabpage.activity-stream.newNewtabExperience.enabled"
)
) {
this.libraryRecentHighlights.previousElementSibling.setAttribute(
"data-l10n-id",
"library-recent-activity-label"
);
} else {
this.libraryRecentHighlights.previousElementSibling.removeAttribute(
"data-l10n-id"
);
}
// Make the elements invisible synchronously, before the view is shown. // Make the elements invisible synchronously, before the view is shown.
this.makeLibraryRecentHighlightsInvisible(); this.makeLibraryRecentHighlightsInvisible();

Просмотреть файл

@ -238,15 +238,25 @@ export class TopSiteForm extends React.PureComponent {
const onSubmit = previewMode const onSubmit = previewMode
? this.onPreviewButtonClick ? this.onPreviewButtonClick
: this.onDoneButtonClick; : this.onDoneButtonClick;
// When the newNewtabExperience is enabled by default, use only shortcut ids.
const addTopsitesHeaderL10nId =
this.props.newNewtabExperienceEnabled ||
this.props.customizationMenuEnabled
? "newtab-topsites-add-shortcut-header"
: "newtab-topsites-add-topsites-header";
const editTopsitesHeaderL10nId =
this.props.newNewtabExperienceEnabled ||
this.props.customizationMenuEnabled
? "newtab-topsites-edit-shortcut-header"
: "newtab-topsites-edit-topsites-header";
return ( return (
<form className="topsite-form" onSubmit={onSubmit}> <form className="topsite-form" onSubmit={onSubmit}>
<div className="form-input-container"> <div className="form-input-container">
<h3 <h3
className="section-title grey-title" className="section-title grey-title"
data-l10n-id={ data-l10n-id={
showAsAdd showAsAdd ? addTopsitesHeaderL10nId : editTopsitesHeaderL10nId
? "newtab-topsites-add-topsites-header"
: "newtab-topsites-edit-topsites-header"
} }
/> />
<div className="fields-and-preview"> <div className="fields-and-preview">

Просмотреть файл

@ -141,6 +141,8 @@ export class _TopSites extends React.PureComponent {
const extraMenuOptions = ["AddTopSite"]; const extraMenuOptions = ["AddTopSite"];
const newNewtabExperienceEnabled = const newNewtabExperienceEnabled =
props.Prefs.values["newNewtabExperience.enabled"]; props.Prefs.values["newNewtabExperience.enabled"];
const customizationMenuEnabled =
props.Prefs.values["customizationMenu.enabled"];
const colors = props.Prefs.values["newNewtabExperience.colors"]; const colors = props.Prefs.values["newNewtabExperience.colors"];
if (props.Prefs.values["improvesearch.topSiteSearchShortcuts"]) { if (props.Prefs.values["improvesearch.topSiteSearchShortcuts"]) {
@ -148,8 +150,7 @@ export class _TopSites extends React.PureComponent {
} }
const canShowCustomizationMenu = const canShowCustomizationMenu =
props.Prefs.values["newNewtabExperience.enabled"] || newNewtabExperienceEnabled || customizationMenuEnabled;
props.Prefs.values["customizationMenu.enabled"];
const hideTitle = const hideTitle =
props.Prefs.values.hideTopSitesTitle || canShowCustomizationMenu; props.Prefs.values.hideTopSitesTitle || canShowCustomizationMenu;
@ -205,6 +206,7 @@ export class _TopSites extends React.PureComponent {
dispatch={this.props.dispatch} dispatch={this.props.dispatch}
{...editForm} {...editForm}
newNewtabExperienceEnabled={newNewtabExperienceEnabled} newNewtabExperienceEnabled={newNewtabExperienceEnabled}
customizationMenuEnabled={customizationMenuEnabled}
/> />
</ModalOverlayWrapper> </ModalOverlayWrapper>
</div> </div>

Просмотреть файл

@ -8618,13 +8618,14 @@ class _TopSites extends react__WEBPACK_IMPORTED_MODULE_6___default.a.PureCompone
} = props.TopSites; } = props.TopSites;
const extraMenuOptions = ["AddTopSite"]; const extraMenuOptions = ["AddTopSite"];
const newNewtabExperienceEnabled = props.Prefs.values["newNewtabExperience.enabled"]; const newNewtabExperienceEnabled = props.Prefs.values["newNewtabExperience.enabled"];
const customizationMenuEnabled = props.Prefs.values["customizationMenu.enabled"];
const colors = props.Prefs.values["newNewtabExperience.colors"]; const colors = props.Prefs.values["newNewtabExperience.colors"];
if (props.Prefs.values["improvesearch.topSiteSearchShortcuts"]) { if (props.Prefs.values["improvesearch.topSiteSearchShortcuts"]) {
extraMenuOptions.push("AddSearchShortcut"); extraMenuOptions.push("AddSearchShortcut");
} }
const canShowCustomizationMenu = props.Prefs.values["newNewtabExperience.enabled"] || props.Prefs.values["customizationMenu.enabled"]; const canShowCustomizationMenu = newNewtabExperienceEnabled || customizationMenuEnabled;
const hideTitle = props.Prefs.values.hideTopSitesTitle || canShowCustomizationMenu; // `collapsed` should be sent to CollapsibleSection as undefined if const hideTitle = props.Prefs.values.hideTopSitesTitle || canShowCustomizationMenu; // `collapsed` should be sent to CollapsibleSection as undefined if
// `props.TopSites.pref` is not set to true. // `props.TopSites.pref` is not set to true.
@ -8674,7 +8675,8 @@ class _TopSites extends react__WEBPACK_IMPORTED_MODULE_6___default.a.PureCompone
onClose: this.onEditFormClose, onClose: this.onEditFormClose,
dispatch: this.props.dispatch dispatch: this.props.dispatch
}, editForm, { }, editForm, {
newNewtabExperienceEnabled: newNewtabExperienceEnabled newNewtabExperienceEnabled: newNewtabExperienceEnabled,
customizationMenuEnabled: customizationMenuEnabled
})))), showSearchShortcutsForm && react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement("div", { })))), showSearchShortcutsForm && react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement("div", {
className: "edit-search-shortcuts" className: "edit-search-shortcuts"
}, react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_asrouter_components_ModalOverlay_ModalOverlay__WEBPACK_IMPORTED_MODULE_5__["ModalOverlayWrapper"], { }, react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_asrouter_components_ModalOverlay_ModalOverlay__WEBPACK_IMPORTED_MODULE_5__["ModalOverlayWrapper"], {
@ -15842,7 +15844,10 @@ class TopSiteForm_TopSiteForm extends external_React_default.a.PureComponent {
} // Handles the form submit so an enter press performs the correct action } // Handles the form submit so an enter press performs the correct action
const onSubmit = previewMode ? this.onPreviewButtonClick : this.onDoneButtonClick; const onSubmit = previewMode ? this.onPreviewButtonClick : this.onDoneButtonClick; // When the newNewtabExperience is enabled by default, use only "newtab-topsites-add-shortcut-header".
const addTopsitesHeaderL10nId = this.props.newNewtabExperienceEnabled || this.props.customizationMenuEnabled ? "newtab-topsites-add-shortcut-header" : "newtab-topsites-add-topsites-header";
const editTopsitesHeaderL10nId = this.props.newNewtabExperienceEnabled || this.props.customizationMenuEnabled ? "newtab-topsites-edit-shortcut-header" : "newtab-topsites-edit-topsites-header";
return external_React_default.a.createElement("form", { return external_React_default.a.createElement("form", {
className: "topsite-form", className: "topsite-form",
onSubmit: onSubmit onSubmit: onSubmit
@ -15850,7 +15855,7 @@ class TopSiteForm_TopSiteForm extends external_React_default.a.PureComponent {
className: "form-input-container" className: "form-input-container"
}, external_React_default.a.createElement("h3", { }, external_React_default.a.createElement("h3", {
className: "section-title grey-title", className: "section-title grey-title",
"data-l10n-id": showAsAdd ? "newtab-topsites-add-topsites-header" : "newtab-topsites-edit-topsites-header" "data-l10n-id": showAsAdd ? addTopsitesHeaderL10nId : editTopsitesHeaderL10nId
}), external_React_default.a.createElement("div", { }), external_React_default.a.createElement("div", {
className: "fields-and-preview" className: "fields-and-preview"
}, external_React_default.a.createElement("div", { }, external_React_default.a.createElement("div", {

Просмотреть файл

@ -630,7 +630,7 @@
preference="browser.urlbar.suggest.bookmark"/> preference="browser.urlbar.suggest.bookmark"/>
<checkbox id="openpageSuggestion" data-l10n-id="addressbar-locbar-openpage-option" <checkbox id="openpageSuggestion" data-l10n-id="addressbar-locbar-openpage-option"
preference="browser.urlbar.suggest.openpage"/> preference="browser.urlbar.suggest.openpage"/>
<checkbox id="topSitesSuggestion" data-l10n-id="addressbar-locbar-topsites-option" <checkbox id="topSitesSuggestion"
preference="browser.urlbar.suggest.topsites"/> preference="browser.urlbar.suggest.topsites"/>
<checkbox id="enginesSuggestion" data-l10n-id="addressbar-locbar-engines-option" <checkbox id="enginesSuggestion" data-l10n-id="addressbar-locbar-engines-option"
preference="browser.urlbar.suggest.engines"/> preference="browser.urlbar.suggest.engines"/>

Просмотреть файл

@ -729,6 +729,24 @@ var gPrivacyPane = {
} }
} }
// When these prefs are made the default, add this data-l10n-id directly to privacy.inc.xhtml.
if (
Services.prefs.getBoolPref(
"browser.newtabpage.activity-stream.newNewtabExperience.enabled"
) ||
Services.prefs.getBoolPref(
"browser.newtabpage.activity-stream.customizationMenu.enabled"
)
) {
document
.getElementById("topSitesSuggestion")
.setAttribute("data-l10n-id", "addressbar-locbar-shortcuts-option");
} else {
document
.getElementById("topSitesSuggestion")
.setAttribute("data-l10n-id", "addressbar-locbar-topsites-option");
}
this.initSiteDataControls(); this.initSiteDataControls();
setEventListener( setEventListener(
"clearSiteDataButton", "clearSiteDataButton",

Просмотреть файл

@ -585,6 +585,7 @@ library-bookmarks-bookmark-this-page =
.label = Bookmark This Page .label = Bookmark This Page
library-bookmarks-bookmark-edit = library-bookmarks-bookmark-edit =
.label = Edit This Bookmark .label = Edit This Bookmark
library-recent-activity-label = Recent Activity
## More items ## More items

Просмотреть файл

@ -33,7 +33,9 @@ newtab-search-box-input =
newtab-topsites-add-search-engine-header = Add Search Engine newtab-topsites-add-search-engine-header = Add Search Engine
newtab-topsites-add-topsites-header = New Top Site newtab-topsites-add-topsites-header = New Top Site
newtab-topsites-add-shortcut-header = New Shortcut
newtab-topsites-edit-topsites-header = Edit Top Site newtab-topsites-edit-topsites-header = Edit Top Site
newtab-topsites-edit-shortcut-header = Edit Shortcut
newtab-topsites-title-label = Title newtab-topsites-title-label = Title
newtab-topsites-title-input = newtab-topsites-title-input =
.placeholder = Enter a title .placeholder = Enter a title

Просмотреть файл

@ -1112,6 +1112,10 @@ addressbar-locbar-bookmarks-option =
addressbar-locbar-openpage-option = addressbar-locbar-openpage-option =
.label = Open tabs .label = Open tabs
.accesskey = O .accesskey = O
# Shortcuts refers to the shortcut tiles on the new tab page, previously known as top sites. Translation should be consistent.
addressbar-locbar-shortcuts-option =
.label = Shortcuts
.accesskey = S
addressbar-locbar-topsites-option = addressbar-locbar-topsites-option =
.label = Top sites .label = Top sites
.accesskey = T .accesskey = T